dusantism-db commented on code in PR #49445:
URL: https://github.com/apache/spark/pull/49445#discussion_r1944727379


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveCatalogs.scala:
##########
@@ -73,28 +94,39 @@ class ResolveCatalogs(val catalogManager: CatalogManager)
     }
   }
 
-  private def resolveVariableName(nameParts: Seq[String]): ResolvedIdentifier 
= {
-    def ident: Identifier = 
Identifier.of(Array(CatalogManager.SESSION_NAMESPACE), nameParts.last)
-    if (nameParts.length == 1) {
+  private def resolveCreateVariableName(nameParts: Seq[String]): 
ResolvedIdentifier = {
+    val ident = SqlScriptingLocalVariableManager.get()
+      .getOrElse(catalogManager.tempVariableManager)
+      .createIdentifier(nameParts.last)

Review Comment:
   Sorry, what do you mean already created? Here we create the identifier, 
which is dependent on scripting context in the case of local variables, and 
then we return it in `ResolvedIdentifier(FakeSystemCatalog, ident) `after 
checking for errors.



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

Reply via email to