MCPcopy Create free account
hub / github.com/apache/impala / GetNext

Method GetNext

be/src/exec/aggregation-node.cc:121–144  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

119}
120
121Status AggregationNode::GetNext(RuntimeState* state, RowBatch* row_batch, bool* eos) {
122 SCOPED_TIMER(runtime_profile_->total_time_counter());
123 ScopedGetNextEventAdder ea(this, eos);
124 RETURN_IF_ERROR(ExecDebugAction(TExecNodePhase::GETNEXT, state));
125 RETURN_IF_CANCELLED(state);
126
127 if (curr_output_agg_idx_ >= aggs_.size() || ReachedLimit()) {
128 *eos = true;
129 return Status::OK();
130 }
131
132 // With multiple Aggregators, each will only set a single tuple per row. We rely on the
133 // other tuples to be null to detect which Aggregator set which row.
134 if (aggs_.size() > 1) row_batch->ClearTuplePointers();
135
136 bool pagg_eos = false;
137 RETURN_IF_ERROR(aggs_[curr_output_agg_idx_]->GetNext(state, row_batch, &pagg_eos));
138 if (pagg_eos) ++curr_output_agg_idx_;
139
140 *eos = ReachedLimit() || (pagg_eos && curr_output_agg_idx_ >= aggs_.size());
141 IncrementNumRowsReturned(row_batch->num_rows());
142 COUNTER_SET(rows_returned_counter_, rows_returned());
143 return Status::OK();
144}
145
146void AggregationNode::Close(RuntimeState* state) {
147 if (is_closed()) return;

Callers 1

OpenMethod · 0.45

Calls 5

OKFunction · 0.85
total_time_counterMethod · 0.80
ClearTuplePointersMethod · 0.80
sizeMethod · 0.45
num_rowsMethod · 0.45

Tested by

no test coverage detected