icexelloss commented on code in PR #34311: URL: https://github.com/apache/arrow/pull/34311#discussion_r1123611908
########## cpp/src/arrow/compute/exec/aggregate_node.cc: ########## @@ -283,28 +386,36 @@ class ScalarAggregateNode : public ExecNode, public TracedNode { DCHECK_EQ(input, inputs_[0]); auto thread_index = plan_->query_context()->GetThreadIndex(); - - ARROW_RETURN_NOT_OK(DoConsume(ExecSpan(batch), thread_index)); + auto handler = [this, thread_index](const ExecBatch& full_batch, Review Comment: Why do we pass the handler here instead of just implementing the logic inside `HandleSegments`. I found the indirection here a bit confusing/unnecessary. Is that a specific reason to do it this way? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org