| 1108 | } |
| 1109 | |
| 1110 | Status Sorter::Open() { |
| 1111 | DCHECK(in_mem_tuple_sorter_ != nullptr) << "Not prepared"; |
| 1112 | DCHECK(unsorted_run_ == nullptr) << "Already open"; |
| 1113 | RETURN_IF_ERROR(compare_less_than_->Open(&obj_pool_, state_, &expr_perm_pool_, |
| 1114 | &expr_results_pool_)); |
| 1115 | TupleDescriptor* sort_tuple_desc = output_row_desc_->tuple_descriptors()[0]; |
| 1116 | unsorted_run_ = run_pool_.Add(new Run(this, sort_tuple_desc, true)); |
| 1117 | RETURN_IF_ERROR(unsorted_run_->Init()); |
| 1118 | RETURN_IF_ERROR(ScalarExprEvaluator::Open(sort_tuple_expr_evals_, state_)); |
| 1119 | return Status::OK(); |
| 1120 | } |
| 1121 | |
| 1122 | // Must be kept in sync with SortNode.computeNodeResourceProfile() in fe. |
| 1123 | int64_t Sorter::ComputeMinReservation() const { |