vladimirg-db commented on code in PR #49628:
URL: https://github.com/apache/spark/pull/49628#discussion_r1928410561


##########
connector/connect/client/jvm/src/test/scala/org/apache/spark/sql/ClientE2ETestSuite.scala:
##########
@@ -1629,6 +1630,37 @@ class ClientE2ETestSuite
       .create()
     assert(sparkWithLowerMaxMessageSize.range(maxBatchSize).collect().length 
== maxBatchSize)
   }
+
+  test("Multiple positional parameterized nodes in the parsed logical plan") {
+    var df = spark.sql("SELECT ?", Array(0))
+    for (i <- 1 until 10) {
+      val temp = spark.sql("SELECT ?", Array(i))
+      df = df.union(temp)
+    }
+    checkAnswer(df, (0 until 10).map(i => Row(i)))
+  }
+
+  test("Multiple named parameterized nodes in the parsed logical plan") {
+    var df = spark.sql("SELECT :ordinal", args = Map("ordinal" -> 0))

Review Comment:
   `ordinal` is confusing in the context of a key-value parameter... Let's just 
say `key`.



##########
connector/connect/client/jvm/src/test/scala/org/apache/spark/sql/ClientE2ETestSuite.scala:
##########
@@ -1629,6 +1630,37 @@ class ClientE2ETestSuite
       .create()
     assert(sparkWithLowerMaxMessageSize.range(maxBatchSize).collect().length 
== maxBatchSize)
   }
+
+  test("Multiple positional parameterized nodes in the parsed logical plan") {
+    var df = spark.sql("SELECT ?", Array(0))
+    for (i <- 1 until 10) {
+      val temp = spark.sql("SELECT ?", Array(i))
+      df = df.union(temp)
+    }
+    checkAnswer(df, (0 until 10).map(i => Row(i)))
+  }
+
+  test("Multiple named parameterized nodes in the parsed logical plan") {
+    var df = spark.sql("SELECT :ordinal", args = Map("ordinal" -> 0))
+    for (i <- 1 until 10) {
+      val temp = spark.sql("SELECT :ordinal", args = Map("ordinal" -> i))
+      df = df.union(temp)
+    }
+    checkAnswer(df, (0 until 10).map(i => Row(i)))
+  }
+
+  test("Multiple named and positional parameterized nodes in the parsed 
logical plan") {

Review Comment:
   Let's make them interleaving just to make the test a bit more natural.



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

Reply via email to