You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "mingmwang (via GitHub)" <gi...@apache.org> on 2023/04/02 16:46:08 UTC

[GitHub] [arrow-datafusion] mingmwang commented on a diff in pull request #5661: Top down `EnforceSorting`, Extended testbench for `EnforceSorting` rule to prepare for refactors, additional functionality such as pushdowns over unions

mingmwang commented on code in PR #5661:
URL: https://github.com/apache/arrow-datafusion/pull/5661#discussion_r1155342558


##########
datafusion/core/src/physical_optimizer/utils.rs:
##########
@@ -68,3 +74,40 @@ pub fn add_sort_above(
     }
     Ok(())
 }
+
+/// Checks whether the given executor is a limit;
+/// i.e. either a [`LocalLimitExec`] or a [`GlobalLimitExec`].
+pub fn is_limit(plan: &Arc<dyn ExecutionPlan>) -> bool {
+    plan.as_any().is::<GlobalLimitExec>() || plan.as_any().is::<LocalLimitExec>()
+}
+

Review Comment:
   I would suggest avoid using the word  `executor`, maybe you can use input `plan` or input `operator` instead. 
   Executor usually refers to different things, for example in Flink it is the TaskManager, in Spark or Ballista it is the Worker who runs the tasks(physical plan fragments).
   



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