milanisvet commented on code in PR #49571: URL: https://github.com/apache/spark/pull/49571#discussion_r1922509471
########## 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: Yes, I had same opinion, you can not inline them as inlining something with a self-reference would require infinite inlining if I understand it correctly. For some reason kept Peter's comment, but I will rewrite it. -- 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