aocsa commented on a change in pull request #11210:
URL: https://github.com/apache/arrow/pull/11210#discussion_r723354508
##########
File path: cpp/src/arrow/compute/exec/exec_plan.h
##########
@@ -243,6 +248,110 @@ class ARROW_EXPORT ExecNode {
NodeVector outputs_;
};
+class MapNode : public ExecNode {
+ public:
+ MapNode(ExecPlan* plan, std::vector<ExecNode*> inputs,
+ std::shared_ptr<Schema> output_schema)
+ : ExecNode(plan, std::move(inputs), /*input_labels=*/{"target"},
+ std::move(output_schema),
+ /*num_outputs=*/1) {
+ executor_ = plan_->exec_context()->executor();
+ }
+
+ void SubmitTask(std::function<Status()> task) {
+ if (finished_.is_finished()) {
+ return;
+ }
+ Status status;
+ 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;
Review comment:
Yes this is right.
Not OK status cases are handel at the end of method `SubmitTask`.
--
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]