You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/05/17 07:15:23 UTC
[GitHub] [spark] AngersZhuuuu commented on a change in pull request #32475: [SPARK-34775][SQL] Push down limit through window when partitionSpec is not empty
AngersZhuuuu commented on a change in pull request #32475:
URL: https://github.com/apache/spark/pull/32475#discussion_r633277356
##########
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.
Done
##########
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.
Done
--
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org