icexelloss commented on code in PR #34311:
URL: https://github.com/apache/arrow/pull/34311#discussion_r1117335444
##########
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:
This seems unnecessary changes, before the code was
```
auto thread_index = plan_->query_context()->GetThreadIndex();
ARROW_RETURN_NOT_OK(DoConsume(ExecSpan(batch), thread_index));
```
```
auto batch = ExecSpan(exec_batch);
RETURN_NOT_OK(DoConsume(batch,
plan_->query_context()->GetThreadIndex()));
```
Seems exactly the same thing?
--
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]