| 82 | } |
| 83 | |
| 84 | Status CardinalityCheckNode::GetNext( |
| 85 | RuntimeState* state, RowBatch* output_row_batch, bool* eos) { |
| 86 | SCOPED_TIMER(runtime_profile_->total_time_counter()); |
| 87 | ScopedGetNextEventAdder ea(this, eos); |
| 88 | RETURN_IF_ERROR(ExecDebugAction(TExecNodePhase::GETNEXT, state)); |
| 89 | RETURN_IF_CANCELLED(state); |
| 90 | RETURN_IF_ERROR(QueryMaintenance(state)); |
| 91 | DCHECK_LE(row_batch_->num_rows(), 1); |
| 92 | |
| 93 | if (row_batch_->num_rows() == 1) { |
| 94 | TupleRow* src_row = row_batch_->GetRow(0); |
| 95 | TupleRow* dst_row = output_row_batch->GetRow(output_row_batch->AddRow()); |
| 96 | output_row_batch->CopyRow(src_row, dst_row); |
| 97 | output_row_batch->CommitLastRow(); |
| 98 | row_batch_->TransferResourceOwnership(output_row_batch); |
| 99 | SetNumRowsReturned(1); |
| 100 | COUNTER_SET(rows_returned_counter_, rows_returned()); |
| 101 | } |
| 102 | *eos = true; |
| 103 | row_batch_->Reset(); |
| 104 | return Status::OK(); |
| 105 | } |
| 106 | |
| 107 | Status CardinalityCheckNode::Reset(RuntimeState* state, RowBatch* row_batch) { |
| 108 | row_batch_->Reset(); |
no test coverage detected