| 57 | } |
| 58 | |
| 59 | Status TupleRowComparator::Open(ObjectPool* pool, RuntimeState* state, |
| 60 | MemPool* expr_perm_pool, MemPool* expr_results_pool) { |
| 61 | if (ordering_expr_evals_lhs_.empty()) { |
| 62 | RETURN_IF_ERROR(ScalarExprEvaluator::Create(ordering_exprs_, state, pool, |
| 63 | expr_perm_pool, expr_results_pool, &ordering_expr_evals_lhs_)); |
| 64 | RETURN_IF_ERROR(ScalarExprEvaluator::Open(ordering_expr_evals_lhs_, state)); |
| 65 | } |
| 66 | DCHECK_EQ(ordering_exprs_.size(), ordering_expr_evals_lhs_.size()); |
| 67 | if (ordering_expr_evals_rhs_.empty()) { |
| 68 | RETURN_IF_ERROR(ScalarExprEvaluator::Clone(pool, state, expr_perm_pool, |
| 69 | expr_results_pool, ordering_expr_evals_lhs_, &ordering_expr_evals_rhs_)); |
| 70 | } |
| 71 | DCHECK_EQ(ordering_expr_evals_lhs_.size(), ordering_expr_evals_rhs_.size()); |
| 72 | return Status::OK(); |
| 73 | } |
| 74 | |
| 75 | void TupleRowComparator::Close(RuntimeState* state) { |
| 76 | ScalarExprEvaluator::Close(ordering_expr_evals_rhs_, state); |