save-buffer commented on code in PR #15253:
URL: https://github.com/apache/arrow/pull/15253#discussion_r1065140241


##########
cpp/src/arrow/compute/exec/map_node.cc:
##########
@@ -36,22 +36,16 @@ namespace compute {
 MapNode::MapNode(ExecPlan* plan, std::vector<ExecNode*> inputs,

Review Comment:
   Would it make sense to while we're at it remove MapNode? 



##########
cpp/src/arrow/compute/exec/query_context.cc:
##########
@@ -60,26 +60,24 @@ Result<Future<>> QueryContext::BeginExternalTask() {
   return Future<>{};
 }
 
-Status QueryContext::ScheduleTask(std::function<Status()> fn) {
+void QueryContext::ScheduleTask(std::function<Status()> fn) {
   ::arrow::internal::Executor* exec = executor();
   // Adds a task which submits fn to the executor and tracks its progress.  If 
we're
   // already stopping then the task is ignored and fn is not executed.
   async_scheduler_->AddSimpleTask([exec, fn]() { return 
exec->Submit(std::move(fn)); });
-  return Status::OK();
 }
 
-Status QueryContext::ScheduleTask(std::function<Status(size_t)> fn) {
+void QueryContext::ScheduleTask(std::function<Status(size_t)> fn) {
   std::function<Status()> indexed_fn = [this, fn]() {
     size_t thread_index = GetThreadIndex();
     return fn(thread_index);
   };
   return ScheduleTask(std::move(indexed_fn));

Review Comment:
   Can probably remove `return` from here



##########
cpp/src/arrow/compute/exec/exec_plan.h:
##########
@@ -121,18 +119,20 @@ class ARROW_EXPORT ExecNode {
 
   virtual const char* kind_name() const = 0;
 
-  // The number of inputs/outputs expected by this node
+  // The number of inputs expected by this node
   int num_inputs() const { return static_cast<int>(inputs_.size()); }
-  int num_outputs() const { return num_outputs_; }
 
   /// This node's predecessors in the exec plan
   const NodeVector& inputs() const { return inputs_; }
 
+  /// True if the plan has no output schema (is a sink)
+  bool is_sink() const { return !output_schema_; }

Review Comment:
   Why does  a sink not have an output schema? Sinks still output stuff 
batches, I think it would be more correct to define a node to be a sink if its 
`output_` is null. 



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