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

Method GetSingletonOutput

be/src/exec/non-grouping-aggregator.cc:89–111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

87}
88
89void NonGroupingAggregator::GetSingletonOutput(RowBatch* row_batch) {
90 int row_idx = row_batch->AddRow();
91 TupleRow* row = row_batch->GetRow(row_idx);
92 row_batch->ClearRow(row);
93 // The output row batch may reference memory allocated by Serialize() or Finalize(),
94 // allocating that memory directly from the row batch's pool means we can safely return
95 // the batch.
96 vector<ScopedResultsPool> allocate_from_batch_pool =
97 ScopedResultsPool::Create(agg_fn_evals_, row_batch->tuple_data_pool());
98 Tuple* output_tuple = GetOutputTuple(
99 agg_fn_evals_, singleton_output_tuple_, row_batch->tuple_data_pool());
100 row->SetTuple(agg_idx_, output_tuple);
101 if (ExecNode::EvalConjuncts(conjunct_evals_.data(), conjunct_evals_.size(), row)) {
102 row_batch->CommitLastRow();
103 ++num_rows_returned_;
104 COUNTER_SET(rows_returned_counter_, num_rows_returned_);
105 }
106 // Keep the current chunk to amortize the memory allocation over a series
107 // of Reset()/Open()/GetNext()* calls.
108 row_batch->tuple_data_pool()->AcquireData(singleton_tuple_pool_.get(), true);
109 // This node no longer owns the memory for singleton_output_tuple_.
110 singleton_output_tuple_ = nullptr;
111}
112
113void NonGroupingAggregator::Close(RuntimeState* state) {
114 if (!singleton_output_tuple_returned_) {

Callers

nothing calls this directly

Calls 11

CreateClass · 0.85
ClearRowMethod · 0.80
tuple_data_poolMethod · 0.80
CommitLastRowMethod · 0.80
AcquireDataMethod · 0.80
getMethod · 0.65
AddRowMethod · 0.45
GetRowMethod · 0.45
SetTupleMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected