Pajaraja commented on code in PR #51847: URL: https://github.com/apache/spark/pull/51847#discussion_r2339074830
########## sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala: ########## @@ -4281,6 +4282,29 @@ object RemoveTempResolvedColumn extends Rule[LogicalPlan] { } } +object ApplyLimitAll extends Rule[LogicalPlan] { + def applyLimitAllToPlan(plan: LogicalPlan, isInLimitAll: Boolean = false): LogicalPlan = { + plan match { + case la: LimitAll => + applyLimitAllToPlan(la.child, isInLimitAll = true) + case cteRef: CTERelationRef if isInLimitAll => + cteRef.copy(isUnlimitedRecursion = Some(true)) + // Allow-list for pushing down Limit All. + case _: Project | _: Filter | _: Join | _: Union | _: Offset | + _: BatchEvalPython | _: ArrowEvalPython | _: SubqueryAlias => Review Comment: Replaced BatchEvalPython and ArrowEvalPython with BaseEvalPython. ########## sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicLogicalOperators.scala: ########## @@ -1659,6 +1659,21 @@ case class LocalLimit(limitExpr: Expression, child: LogicalPlan) extends OrderPr copy(child = newChild) } +/** Logical node that represents the LIMIT ALL operation. This operation is usually no-op and exists + * to provide compatability with other databases. However, in case of recursive CTEs, Limit nodes Review Comment: Changed -- 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: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org