cloud-fan commented on code in PR #49993: URL: https://github.com/apache/spark/pull/49993#discussion_r1960999354
########## sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/executeImmediate.scala: ########## @@ -148,13 +149,19 @@ class SubstituteExecuteImmediate(val catalogManager: CatalogManager) // We need to resolve arguments before Resolution batch to make sure // that some rule does not accidentally resolve our parameters. // We do not want this as they can resolve some unsupported parameters. - resolveArguments(aliases)) + aliases) } } + // Fully analyze the generated plan. AnalysisContext.withExecuteImmediateContext makes sure + // that SQL scripting local variables will not be accessed from the plan. + val finalPlan = AnalysisContext.withExecuteImmediateContext { + resolveChild(queryPlan) Review Comment: shall we also call `checkAnalysis` like view resolution does? -- 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