wangyum commented on code in PR #37565:
URL: https://github.com/apache/spark/pull/37565#discussion_r952105713


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala:
##########
@@ -1994,6 +1994,13 @@ object EliminateLimits extends Rule[LogicalPlan] {
       LocalLimit(Literal(Least(Seq(ne, le)).eval().asInstanceOf[Int]), 
grandChild)
     case Limit(le, Limit(ne, grandChild)) =>
       Limit(Literal(Least(Seq(ne, le)).eval().asInstanceOf[Int]), grandChild)
+
+    case GlobalLimit(l, Project(projectList, child)) =>
+      Project(projectList, GlobalLimit(l, child))
+    case LocalLimit(l, Project(projectList, child)) =>
+      Project(projectList, LocalLimit(l, child))
+    case Limit(l, Project(projectList, child)) =>
+      Project(projectList, Limit(l, child))

Review Comment:
   Could you move these changes to `LimitPushDown`?



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