Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Update sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/opti…
…mizer/Optimizer.scala

Co-authored-by: Wenchen Fan <[email protected]>
  • Loading branch information
wangyum and cloud-fan authored Jul 20, 2021
commit 1d60d648aea63000366aa1a51bb5d62dc29e27dd
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ object LimitPushDown extends Rule[LogicalPlan] {
// There is a Project between LocalLimit and Join if they do not have the same output.
case LocalLimit(exp, project @ Project(_, join: Join)) =>
LocalLimit(exp, project.copy(child = pushLocalLimitThroughJoin(exp, join)))
// Push down limit 1 and turn Aggregate into Project through Aggregate if it is group only.
// Push down limit 1 through Aggregate and turn Aggregate into Project if it is group only.
case Limit(le @ IntegerLiteral(1), a: Aggregate) if a.groupOnly =>
Limit(le, Project(a.output, LocalLimit(le, a.child)))
case Limit(le @ IntegerLiteral(1), p @ Project(_, a: Aggregate)) if a.groupOnly =>
Expand Down