rtpsw commented on code in PR #34311:
URL: https://github.com/apache/arrow/pull/34311#discussion_r1117567499
##########
cpp/src/arrow/compute/exec/aggregate_node.cc:
##########
@@ -282,12 +396,19 @@ class ScalarAggregateNode : public ExecNode, public
TracedNode {
auto scope = TraceInputReceived(batch);
DCHECK_EQ(input, inputs_[0]);
- auto thread_index = plan_->query_context()->GetThreadIndex();
-
- ARROW_RETURN_NOT_OK(DoConsume(ExecSpan(batch), thread_index));
+ auto handler = [this](const ExecBatch& full_batch, const GroupingSegment&
segment) {
+ if (!segment.extends && segment.offset == 0)
RETURN_NOT_OK(OutputResult());
+ auto exec_batch = full_batch.Slice(segment.offset, segment.length);
+ auto batch = ExecSpan(exec_batch);
+ RETURN_NOT_OK(DoConsume(batch,
plan_->query_context()->GetThreadIndex()));
Review Comment:
Before, `thread_index` was not within a lambda. I'll fix this to be similar
to the original code.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]