rtpsw commented on code in PR #34311: URL: https://github.com/apache/arrow/pull/34311#discussion_r1124223628
########## 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: This factoring of the code separates the handling of a single segment from the iteration over segments. I find it clear but don't mind changing if it would help. However, if the code is to be combined, I wouldn't do it into `HandleSegments` but just inline everything here. -- 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