cloud-fan commented on code in PR #36417:
URL: https://github.com/apache/spark/pull/36417#discussion_r866548301
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala:
##########
@@ -1871,14 +1871,12 @@ object EliminateLimits extends Rule[LogicalPlan] {
}
/**
- * Rewrite [[Offset]] as [[GlobalLimitAndOffset]] or [[LocalLimit]],
- * merging the expressions into one single expression. See [[Limit]] for more
information
- * about the difference between [[LocalLimit]] and [[GlobalLimit]].
+ * Rewrite [[Offset]] by eliminate [[Offset]] or merge offset value and limit
value into
+ * [[LocalLimit]]. See [[Limit]] for more information about the difference
between
+ * [[LocalLimit]] and [[GlobalLimit]].
*/
object RewriteOffsets extends Rule[LogicalPlan] {
def apply(plan: LogicalPlan): LogicalPlan = plan transform {
- case GlobalLimit(le, Offset(oe, grandChild)) =>
- GlobalLimitAndOffset(le, oe, grandChild)
case localLimit @ LocalLimit(le, Offset(oe, grandChild)) =>
Review Comment:
can we move this logic to `LimitPushDown`? then we don't need this rule.
--
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]