cloud-fan commented on code in PR #47501:
URL: https://github.com/apache/spark/pull/47501#discussion_r1703732585
##########
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")),
Review Comment:
This is a duplicated test as
https://github.com/apache/spark/pull/47501/files#diff-509971ca229888a8895c9402f41a4ed82989e2678fff4036e9b6b03dfa253fdaR636
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]