| 203 | } |
| 204 | |
| 205 | Status 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 | |
| 227 | Status ScalarAggregateNode::InputReceived(ExecNode* input, ExecBatch batch) { |
| 228 | auto scope = TraceInputReceived(batch); |
nothing calls this directly
no test coverage detected