You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by al...@apache.org on 2022/06/12 10:15:11 UTC

[arrow-datafusion] branch master updated: public API for GlobalLimitExec and LocalLimitExec (#2722)

This is an automated email from the ASF dual-hosted git repository.

alamb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow-datafusion.git


The following commit(s) were added to refs/heads/master by this push:
     new ed0fe8cb1 public API for GlobalLimitExec and LocalLimitExec (#2722)
ed0fe8cb1 is described below

commit ed0fe8cb19a1a6477a2821d08bcd520c3c2b9441
Author: Andy Grove <ag...@apache.org>
AuthorDate: Sun Jun 12 04:15:06 2022 -0600

    public API for GlobalLimitExec and LocalLimitExec (#2722)
---
 datafusion/core/src/physical_plan/limit.rs | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/datafusion/core/src/physical_plan/limit.rs b/datafusion/core/src/physical_plan/limit.rs
index 73566b823..e9ff61409 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 {