nebojsa-db commented on code in PR #47180:
URL: https://github.com/apache/spark/pull/47180#discussion_r1667068174


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

Review Comment:
   So I should return here something like SubqueryAlias(table, 
UnresolvedRelation(...)) ? 



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

Reply via email to