milanisvet commented on code in PR #49518: URL: https://github.com/apache/spark/pull/49518#discussion_r1927184001
########## sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/CTESubstitution.scala: ########## @@ -87,6 +87,11 @@ object CTESubstitution extends Rule[LogicalPlan] { case LegacyBehaviorPolicy.CORRECTED => traverseAndSubstituteCTE(plan, forceInline, Seq.empty, cteDefs) } + // Recursive CTEs allow only one self-reference per CTE. Here, we perform this check and + // throw an error if it is not fulfilled + cteDefs.foreach { cteDef => + checkNumberOfSelfReferences(cteDef) Review Comment: Done -- 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