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


##########
sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/CliSuite.scala:
##########
@@ -863,4 +863,18 @@ class CliSuite extends SparkFunSuite {
       extraArgs = "--conf" :: 
s"spark.plugins=${classOf[RedirectConsolePlugin].getName}" :: Nil)(
       "SELECT 1;" -> "1")
   }
+
+  test("unbound parameter markers in CLI are detected and reported") {
+    // Test that parameter markers without parameters are properly detected in 
spark-sql CLI
+    // and throw UNBOUND_SQL_PARAMETER error instead of internal errors.
+    // This guards against regression where SparkSQLDriver wasn't using 
pre-parser.
+    runCliWithin(
+      2.minute,
+      errorResponses = Seq("UNBOUND_SQL_PARAMETER"))(
+      "SELECT :param;" -> "param",
+      "SELECT 'hello' :parm;" -> "parm",
+      "SELECT ?;" -> ""
+    )
+  }
 }
+

Review Comment:
   ```suggestion
   ```



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