You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "srielau (via GitHub)" <gi...@apache.org> on 2024/03/01 02:54:59 UTC

Re: [PR] [WIP][SPARK-47033][SQL] Fix EXECUTE IMMEDIATE USING does not recognize session variable names [spark]

srielau commented on code in PR #45293:
URL: https://github.com/apache/spark/pull/45293#discussion_r1508423151


##########
sql/core/src/test/scala/org/apache/spark/sql/execution/QueryExecutionSuite.scala:
##########
@@ -336,6 +336,18 @@ class QueryExecutionSuite extends SharedSparkSession {
     }
   }
 
+  test("SPARK-47033: EXECUTE IMMEDIATE USING does not recognize session variable names") {
+    spark.sql("DECLARE parm = 'Hello';")
+
+    val originalQuery = spark.sql("EXECUTE IMMEDIATE 'SELECT :parm' USING parm AS parm;")
+    val newQuery = spark.sql("EXECUTE IMMEDIATE 'SELECT :parm' USING parm;")

Review Comment:
   Yes, that's what we want. Any column like reference works that way: column alias, column, function parameter (which can be qualified by function name), variable, function



-- 
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-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org