MCPcopy Create free account
hub / github.com/apache/arrow / DoConsume

Method DoConsume

cpp/src/arrow/acero/scalar_aggregate_node.cc:205–225  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

203}
204
205Status ScalarAggregateNode::DoConsume(const ExecSpan& batch, size_t thread_index) {
206 for (size_t i = 0; i < kernels_.size(); ++i) {
207 arrow::util::tracing::Span span;
208 START_COMPUTE_SPAN(span, aggs_[i].function,
209 {{"function.name", aggs_[i].function},
210 {"function.options",
211 aggs_[i].options ? aggs_[i].options->ToString() : "<NULLPTR>"},
212 {"function.kind", std::string(kind_name()) + "::Consume"}});
213 KernelContext batch_ctx{plan()->query_context()->exec_context()};
214 DCHECK_LT(thread_index, states_[i].size());
215 batch_ctx.SetState(states_[i][thread_index].get());
216
217 std::vector<ExecValue> column_values;
218 for (const int field : target_fieldsets_[i]) {
219 column_values.push_back(batch.values[field]);
220 }
221 ExecSpan column_batch{std::move(column_values), batch.length};
222 RETURN_NOT_OK(kernels_[i]->consume(&batch_ctx, column_batch));
223 }
224 return Status::OK();
225}
226
227Status ScalarAggregateNode::InputReceived(ExecNode* input, ExecBatch batch) {
228 auto scope = TraceInputReceived(batch);

Callers

nothing calls this directly

Calls 9

planFunction · 0.85
exec_contextMethod · 0.80
query_contextMethod · 0.80
push_backMethod · 0.80
OKFunction · 0.50
sizeMethod · 0.45
ToStringMethod · 0.45
getMethod · 0.45
consumeMethod · 0.45

Tested by

no test coverage detected