davidm-db commented on code in PR #52173: URL: https://github.com/apache/spark/pull/52173#discussion_r2313334779
########## sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/ColumnResolutionHelper.scala: ########## @@ -233,6 +235,71 @@ trait ColumnResolutionHelper extends Logging with DataTypeErrorsBase { } } + /** + * Look up variable by nameParts. + * If in SQL Script, first check local variables, unless in EXECUTE IMMEDIATE + * (EXECUTE IMMEDIATE generated query cannot access local variables). + * if not found fall back to session variables. + * @param nameParts NameParts of the variable. + * @return Reference to the variable. + */ + def lookupVariable(nameParts: Seq[String]): Option[VariableReference] = { Review Comment: This was purposefully removed from here to `VariableResolution.scala`: https://github.com/apache/spark/pull/52125. Any reason to add it here again (instead of changing the already existing implementation)? At a first glance it looks like we'll have inconsistent referencing of `lookupVariable` going forward... -- 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