cloud-fan commented on code in PR #52468:
URL: https://github.com/apache/spark/pull/52468#discussion_r2382544056


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/ApplyLimitAll.scala:
##########
@@ -20,6 +20,15 @@ package org.apache.spark.sql.catalyst.analysis
 import org.apache.spark.sql.catalyst.plans.logical.{Aggregate, BaseEvalPython, 
CTERelationRef, Filter, Join, LimitAll, LogicalPlan, Offset, Project, 
SubqueryAlias, Union, Window}
 import org.apache.spark.sql.catalyst.rules.Rule
 
+/**
+ * Limit All is usually a no-op operation in spark, used for compatibility 
with other database
+ * systems. However, in the case of recursive CTEs there is a default value 
(controlled by a flag)
+ * of the maximum number of rows that a recursive CTE may return, which can be 
overridden by a Limit
+ * operator above the UnionLoop node. Since this is a case where a Limit 
operator actually increases
+ * the number of rows a node should return, Limit All stops being a no-op node 
semantically, and
+ * should be used to enable unlimited looping in recursive CTEs.
+ */
+

Review Comment:
   ```suggestion
   ```



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