beliefer commented on code in PR #37295:
URL: https://github.com/apache/spark/pull/37295#discussion_r930685370


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala:
##########
@@ -1963,6 +1963,13 @@ object EliminateLimits extends Rule[LogicalPlan] {
     case GlobalLimit(l, child) if canEliminate(l, child) =>
       child
 
+    case Limit(IntegerLiteral(0), child) =>

Review Comment:
   Because `transformDownWithPruning` will match here first, then we can 
replace it with empty `LocalRelation` directly.



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