AveryQi115 commented on code in PR #50548: URL: https://github.com/apache/spark/pull/50548#discussion_r2054657286
########## sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/CheckAnalysis.scala: ########## @@ -228,6 +228,67 @@ trait CheckAnalysis extends LookupCatalog with QueryErrorsBase with PlanToString } } + def checkNoNestedOuterReferencesInMainQuery(plan: LogicalPlan): Unit = { Review Comment: This is only for any subquery within the mainQuery. Because there can be some outer references can be resolved in the whole plan but are found not in any inputSet for the operators containing subqueries. In this case, the Analyzer treats these outer references as `outerScopeAttrs` for each subquery, even the subquery within the mainQuery. But for the subquery within the mainQuery, they cannot have `outerScopeAttrs` as there are no outer scope above the mainQuery. `ValidateSubqueryExpression` checks each subquery. They are different. -- 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