Skip to content

Apache DataFusion SQL Query Engine

public API for GlobalLimitExec and LocalLimitExec (#2722)

Andy Groveed0fe8cb19a1
diff --git a/datafusion/core/src/physical_plan/limit.rs b/datafusion/core/src/physical_plan/limit.rs
index 73566b8233..e9ff61409c 100644
--- a/datafusion/core/src/physical_plan/limit.rs
+++ b/datafusion/core/src/physical_plan/limit.rs
@@ -70,6 +70,21 @@ impl GlobalLimitExec {
metrics: ExecutionPlanMetricsSet::new(),
}
}
+
+ /// Input execution plan
+ pub fn input(&self) -> &Arc<dyn ExecutionPlan> {
+ &self.input
+ }
+
+ /// Number of rows to skip before fetch
+ pub fn skip(&self) -> Option<&usize> {
+ self.skip.as_ref()
+ }
+
+ /// Maximum number of rows to fetch
+ pub fn fetch(&self) -> Option<&usize> {
+ self.fetch.as_ref()
+ }
}
impl ExecutionPlan for GlobalLimitExec {
@@ -231,6 +246,16 @@ impl LocalLimitExec {
metrics: ExecutionPlanMetricsSet::new(),
}
}
+
+ /// Input execution plan
+ pub fn input(&self) -> &Arc<dyn ExecutionPlan> {
+ &self.input
+ }
+
+ /// Maximum number of rows to fetch
+ pub fn fetch(&self) -> usize {
+ self.fetch
+ }
}
impl ExecutionPlan for LocalLimitExec {