Skip to content

Commit

Permalink
public API for GlobalLimitExec and LocalLimitExec (#2722)
Browse files Browse the repository at this point in the history
  • Loading branch information
andygrove authored Jun 12, 2022
1 parent f37dd7c commit ed0fe8c
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions datafusion/core/src/physical_plan/limit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit ed0fe8c

Please sign in to comment.