ming535 commented on code in PR #2694:
URL: https://github.com/apache/arrow-datafusion/pull/2694#discussion_r892270304
##########
datafusion/core/src/physical_plan/limit.rs:
##########
@@ -176,17 +184,18 @@ impl ExecutionPlan for GlobalLimitExec {
fn statistics(&self) -> Statistics {
let input_stats = self.input.statistics();
+ let skip = self.skip.unwrap_or(0);
match input_stats {
// if the input does not reach the limit globally, return input
stats
Statistics {
num_rows: Some(nr), ..
- } if nr <= self.limit => input_stats,
+ } if nr - skip <= self.fetch.unwrap_or(usize::MAX) => input_stats,
Review Comment:
refactored the logic.
--
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]