cloud-fan commented on a change in pull request #31691:
URL: https://github.com/apache/spark/pull/31691#discussion_r586164221



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala
##########
@@ -613,6 +613,18 @@ object LimitPushDown extends Rule[LogicalPlan] {
         case _ => join
       }
       LocalLimit(exp, newJoin)
+
+    // Adding an extra Limit below WINDOW when there is only one 
RankLike/RowNumber
+    // window function and partitionSpec is empty.
+    case LocalLimit(limitExpr @ IntegerLiteral(limitVal),

Review comment:
       shall we respect `TOP_K_SORT_FALLBACK_THRESHOLD` here?




----------------------------------------------------------------
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]

Reply via email to