lidavidm commented on a change in pull request #10919:
URL: https://github.com/apache/arrow/pull/10919#discussion_r687221713



##########
File path: cpp/src/arrow/compute/exec/aggregate_node.cc
##########
@@ -451,7 +452,8 @@ struct GroupByNode : ExecNode {
         // bail if StopProducing was called
         if (finished_.is_finished()) break;
 
-        RETURN_NOT_OK(executor->Spawn([this, i] { OutputNthBatch(i); }));
+        auto self = checked_pointer_cast<GroupByNode>(shared_from_this());
+        RETURN_NOT_OK(executor->Spawn([self, i] { self->OutputNthBatch(i); }));

Review comment:
       It works locally, even better! This should be better because it'll also 
preserve the validity of pointers in outputs_. 




-- 
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]


Reply via email to