nebojsa-db commented on code in PR #47180: URL: https://github.com/apache/spark/pull/47180#discussion_r1667436898
########## sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/CollectCTEDefinitions.scala: ########## @@ -282,11 +283,15 @@ object CTESubstitution extends Rule[LogicalPlan] { if (alwaysInline) { d.child } else { - // Add a `SubqueryAlias` for hint-resolving rules to match relation names. - SubqueryAlias(table, CTERelationRef(d.id, d.resolved, d.output, d.isStreaming)) + // Add unresolved with CTE relations to the plan and we + // will do CTE resolution later in analyzer based on this node. + UnresolvedWithCTERelations(u, cteRelations) } }.getOrElse(u) + case p: PlanWithUnresolvedIdentifier => Review Comment: I have made changes suggested in these comments, hopefully I understood correctly what you suggested, please review :) -- 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