westonpace commented on a change in pull request #12720:
URL: https://github.com/apache/arrow/pull/12720#discussion_r836868243



##########
File path: cpp/src/arrow/compute/exec/exec_plan.cc
##########
@@ -436,22 +436,11 @@ void 
MapNode::SubmitTask(std::function<Result<ExecBatch>(ExecBatch)> map_fn,
     return Status::OK();
   };
 
-  if (executor_) {
-    status = task_group_.AddTask([this, task]() -> Result<Future<>> {
-      return this->executor_->Submit(this->stop_source_.token(), [this, 
task]() {
-        auto status = task();
-        if (this->input_counter_.Increment()) {
-          this->Finish(status);
-        }
-        return status;
-      });
-    });
-  } else {
-    status = task();
-    if (input_counter_.Increment()) {
-      this->Finish(status);
-    }
+  status = task();
+  if (input_counter_.Increment()) {

Review comment:
       I think it's slightly clearer to readers if this check comes after the 
`if (!status.ok())` check.  Then we can just do...
   
   ```
   if (input_counter_.Increment()) {
     this->Finish();
   }
   ```

##########
File path: cpp/src/arrow/compute/exec/exec_plan.cc
##########
@@ -436,22 +436,11 @@ void 
MapNode::SubmitTask(std::function<Result<ExecBatch>(ExecBatch)> map_fn,
     return Status::OK();
   };
 
-  if (executor_) {
-    status = task_group_.AddTask([this, task]() -> Result<Future<>> {
-      return this->executor_->Submit(this->stop_source_.token(), [this, 
task]() {
-        auto status = task();
-        if (this->input_counter_.Increment()) {
-          this->Finish(status);
-        }
-        return status;
-      });
-    });
-  } else {
-    status = task();
-    if (input_counter_.Increment()) {
-      this->Finish(status);
-    }
+  status = task();
+  if (input_counter_.Increment()) {
+    this->Finish(status);
   }
+
   // If we get a cancelled status from AddTask it means this node was stopped
   // or errored out already so we can just drop the task.
   if (!status.ok() && !status.IsCancelled()) {

Review comment:
       We don't need the comment (or the check for `!status.IsCancelled`) 
anymore.




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