cloud-fan commented on code in PR #47501:
URL: https://github.com/apache/spark/pull/47501#discussion_r1703732988


##########
sql/core/src/test/scala/org/apache/spark/sql/ParametersSuite.scala:
##########
@@ -624,6 +624,67 @@ class ParametersSuite extends QueryTest with 
SharedSparkSession with PlanTest {
     comparePlans(expected, parameterizedSql)
   }
 
+  test("SPARK-49017: bind named parameters with IDENTIFIER clause") {
+    withTable("testtab") {
+      // Create table
+      spark.sql("create table testtab (id int, name string)")
+
+      // Insert into table using single param - WORKS
+      spark.sql("insert into identifier(:tab) values(1, 'test1')", Map("tab" 
-> "testtab"))
+
+      // Select from table using param - WORKS
+      checkAnswer(spark.sql("select * from identifier(:tab)", Map("tab" -> 
"testtab")),
+        Seq(Row(1, "test1")))
+
+      // Insert into table using multiple params - WORKS
+      spark.sql("insert into identifier(:tab) values(2, :name)",
+        Map("tab" -> "testtab", "name" -> "test2"))
+
+      // Select from table using param - WORKS
+      checkAnswer(spark.sql("select * from identifier(:tab)", Map("tab" -> 
"testtab")),
+        Seq(Row(1, "test1"), Row(2, "test2")))
+
+      // Insert into table using multiple params and idents - WORKS
+      spark.sql("insert into identifier(:tab) values(2, :name)",

Review Comment:
   ditto, duplicated.



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