cloud-fan commented on code in PR #49571: URL: https://github.com/apache/spark/pull/49571#discussion_r1922482014
########## sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/InlineCTE.scala: ########## @@ -61,7 +61,8 @@ case class InlineCTE( // 1) It is fine to inline a CTE if it references another CTE that is non-deterministic; // 2) Any `CTERelationRef` that contains `OuterReference` would have been inlined first. refCount == 1 || - cteDef.deterministic || + // Don't inline recursive CTEs if not necessary as recursion is very costly. Review Comment: is it really for perf? Semantically we can't inline recursive CTE as we must run it, right? -- 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