cloud-fan commented on code in PR #47501:
URL: https://github.com/apache/spark/pull/47501#discussion_r1709543142


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/CTESubstitution.scala:
##########
@@ -288,13 +288,7 @@ object CTESubstitution extends Rule[LogicalPlan] {
           }
         }.getOrElse(u)
 
-      case p: PlanWithUnresolvedIdentifier =>
-        // We must look up CTE relations first when resolving 
`UnresolvedRelation`s,
-        // but we can't do it here as `PlanWithUnresolvedIdentifier` is a leaf 
node
-        // and may produce `UnresolvedRelation` later.
-        // Here we wrap it with `UnresolvedWithCTERelations` so that we can
-        // delay the CTE relations lookup after `PlanWithUnresolvedIdentifier` 
is resolved.
-        UnresolvedWithCTERelations(p, cteRelations)
+      case p: PlanWithUnresolvedIdentifier => p // Just delay until bindings 
are done

Review Comment:
   do we really need to delay it? It seems no harm to do the CTE relation 
resolution right now.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to