wangyum commented on a change in pull request #32475:
URL: https://github.com/apache/spark/pull/32475#discussion_r633270247
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/LimitPushDownThroughWindow.scala
##########
@@ -42,17 +42,19 @@ object LimitPushDownThroughWindow extends Rule[LogicalPlan]
{
_.containsAllPatterns(WINDOW, LIMIT), ruleId) {
// Adding an extra Limit below WINDOW when the partitionSpec of all window
functions is empty.
case LocalLimit(limitExpr @ IntegerLiteral(limit),
- window @ Window(windowExpressions, Nil, orderSpec, child))
+ window @ Window(windowExpressions, partitionSpec, orderSpec, child))
Review comment:
Nit: indentation.
##########
File path:
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/LimitPushdownThroughWindowSuite.scala
##########
@@ -155,36 +155,164 @@ class LimitPushdownThroughWindowSuite extends PlanTest {
WithoutOptimize.execute(correctAnswer.analyze))
}
- test("Should not push down if partitionSpec is not empty") {
+ test("Should not push down when child's maxRows smaller than limit value") {
Review comment:
Can we do not move the order? To reduce the change.
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]