| 57 | } |
| 58 | |
| 59 | Status SystemTableScanNode::GetNext(RuntimeState* state, RowBatch* row_batch, bool* eos) { |
| 60 | SCOPED_TIMER(runtime_profile_->total_time_counter()); |
| 61 | ScopedGetNextEventAdder ea(this, eos); |
| 62 | RETURN_IF_ERROR(ExecDebugAction(TExecNodePhase::GETNEXT, state)); |
| 63 | RETURN_IF_CANCELLED(state); |
| 64 | RETURN_IF_ERROR(QueryMaintenance(state)); |
| 65 | |
| 66 | int64_t tuple_buffer_size; |
| 67 | uint8_t* tuple_mem; |
| 68 | RETURN_IF_ERROR( |
| 69 | row_batch->ResizeAndAllocateTupleBuffer(state, &tuple_buffer_size, &tuple_mem)); |
| 70 | |
| 71 | SCOPED_TIMER(materialize_tuple_timer()); |
| 72 | |
| 73 | // copy rows until we hit the limit/capacity or until we exhaust input batch |
| 74 | while (!ReachedLimit() && !row_batch->AtCapacity() && !scanner_->eos()) { |
| 75 | Tuple* tuple = reinterpret_cast<Tuple*>(tuple_mem); |
| 76 | RETURN_IF_ERROR(MaterializeNextTuple(row_batch->tuple_data_pool(), tuple)); |
| 77 | TupleRow* tuple_row = row_batch->GetRow(row_batch->AddRow()); |
| 78 | tuple_row->SetTuple(0, tuple); |
| 79 | |
| 80 | if (ExecNode::EvalConjuncts( |
| 81 | conjunct_evals_.data(), conjunct_evals_.size(), tuple_row)) { |
| 82 | row_batch->CommitLastRow(); |
| 83 | tuple_mem += tuple_desc_->byte_size(); |
| 84 | IncrementNumRowsReturned(1); |
| 85 | } |
| 86 | } |
| 87 | COUNTER_SET(rows_returned_counter_, rows_returned()); |
| 88 | *eos = ReachedLimit() || scanner_->eos(); |
| 89 | return Status::OK(); |
| 90 | } |
| 91 | |
| 92 | Status SystemTableScanNode::Reset(RuntimeState* state, RowBatch* row_batch) { |
| 93 | DCHECK(false) << "NYI"; |
nothing calls this directly
no test coverage detected