ilicmarkodb commented on code in PR #53735:
URL: https://github.com/apache/spark/pull/53735#discussion_r2673258804


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/QueryExecution.scala:
##########
@@ -86,7 +86,10 @@ class QueryExecution(
 
   lazy val isLazyAnalysis: Boolean = {
     // Only check the main query as subquery expression can be resolved now 
with the main query.
-    
logical.exists(_.expressions.exists(_.exists(_.isInstanceOf[LazyExpression])))
+    // Also defer analysis for `UnresolvedTableValuedFunction` as it may 
contain outer references
+    // that can only be resolved when used in a lateral join context.
+    
logical.exists(_.expressions.exists(_.exists(_.isInstanceOf[LazyExpression]))) 
||
+      logical.exists(_.isInstanceOf[UnresolvedTableValuedFunction])

Review Comment:
   Should we add a trait similar to `LazyExpression`, but not for expressions, 
so that we don’t have to hard-code each exception case in the future? Or should 
we leave it as is for now, since there is only one exception case?



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