zhengruifeng commented on a change in pull request #34504:
URL: https://github.com/apache/spark/pull/34504#discussion_r755895427



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala
##########
@@ -1548,6 +1548,31 @@ object PushPredicateThroughNonJoin extends 
Rule[LogicalPlan] with PredicateHelpe
         filter
       }
 
+    case filter @ Filter(condition, w: Window) if w.partitionSpec.isEmpty =>
+      w.windowExpressions match {
+        case Seq(alias @ Alias(WindowExpression(_: RowNumber, 
WindowSpecDefinition(Nil, orderSpec,
+            SpecifiedWindowFrame(RowFrame, UnboundedPreceding, CurrentRow))), 
_)) =>

Review comment:
       in the case, the inferred limit value should be 11 other than 1.




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

To unsubscribe, e-mail: [email protected]

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