You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/12/14 14:03:13 UTC

[GitHub] [arrow] aucahuasi commented on a change in pull request #11923: ARROW-14970: [C++] Make ExecNodes can generate/consume tasks

aucahuasi commented on a change in pull request #11923:
URL: https://github.com/apache/arrow/pull/11923#discussion_r768695291



##########
File path: cpp/src/arrow/compute/exec/aggregate_node.cc
##########
@@ -175,18 +175,21 @@ class ScalarAggregateNode : public ExecNode {
     return Status::OK();
   }
 
-  void InputReceived(ExecNode* input, ExecBatch batch) override {
+  void InputReceived(ExecNode* input, std::function<Result<ExecBatch>()> task) override {
     DCHECK_EQ(input, inputs_[0]);
 
     auto thread_index = get_thread_index_();
-
-    if (ErrorIfNotOk(DoConsume(std::move(batch), thread_index))) return;
+    auto prev = task();
+    if (!prev.ok()) {
+      ErrorIfNotOk(prev.status());
+      return;
+    }
+    if (ErrorIfNotOk(DoConsume(prev.MoveValueUnsafe(), thread_index))) return;

Review comment:
       > plan_->scheduler()->SubmitTask(std::move(func));
   
   Yes that is the idea, but this PR is to enable that construction later, this PR is not going to define any scheduler or submitting logic.




-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org