| 23 | using namespace impala; |
| 24 | |
| 25 | void SelectNode::CopyRows(RowBatch* output_batch) { |
| 26 | ScalarExprEvaluator* const* conjunct_evals = conjunct_evals_.data(); |
| 27 | int num_conjuncts = conjuncts_.size(); |
| 28 | DCHECK_EQ(num_conjuncts, conjunct_evals_.size()); |
| 29 | |
| 30 | FOREACH_ROW(child_row_batch_.get(), child_row_idx_, batch_iter) { |
| 31 | // Add a new row to output_batch |
| 32 | int dst_row_idx = output_batch->AddRow(); |
| 33 | TupleRow* dst_row = output_batch->GetRow(dst_row_idx); |
| 34 | TupleRow* src_row = batch_iter.Get(); |
| 35 | ++child_row_idx_; |
| 36 | if (EvalConjuncts(conjunct_evals, num_conjuncts, src_row)) { |
| 37 | output_batch->CopyRow(src_row, dst_row); |
| 38 | output_batch->CommitLastRow(); |
| 39 | IncrementNumRowsReturned(1); |
| 40 | if (ReachedLimit() || output_batch->AtCapacity()) return; |
| 41 | } |
| 42 | } |
| 43 | } |
no test coverage detected