Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuqi-lucas committed Jan 28, 2025
1 parent dbb20ee commit 87dba0b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions datafusion/physical-optimizer/src/limit_pushdown.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,10 +248,11 @@ pub fn pushdown_limit_helper(
// Add fetch or a `LimitExec`:
// If the plan's children have limit, we shouldn't change the global state to true,
// because the children limit will be overridden if the global state is changed.
if pushdown_plan.children().iter().any(|child| {
child.as_any().is::<GlobalLimitExec>()
|| child.as_any().is::<LocalLimitExec>()
}) {
if pushdown_plan
.children()
.iter()
.any(|&child| extract_limit(child).is_some())
{
global_state.satisfied = false;
}
pushdown_plan = if let Some(plan_with_fetch) = maybe_fetchable {
Expand Down

0 comments on commit 87dba0b

Please sign in to comment.