learningchess2003 commented on code in PR #41429:
URL: https://github.com/apache/spark/pull/41429#discussion_r1236010450


##########
sql/core/src/test/scala/org/apache/spark/sql/errors/QueryParsingErrorsSuite.scala:
##########
@@ -20,16 +20,33 @@ package org.apache.spark.sql.errors
 import org.apache.spark.SparkThrowable
 import org.apache.spark.sql.QueryTest
 import org.apache.spark.sql.catalyst.parser.ParseException
+import org.apache.spark.sql.catalyst.plans.SQLHelper
+import org.apache.spark.sql.catalyst.util.TypeUtils.toSQLId
 import org.apache.spark.sql.test.SharedSparkSession
 
 // Turn of the length check because most of the tests check entire error 
messages
 // scalastyle:off line.size.limit
-class QueryParsingErrorsSuite extends QueryTest with SharedSparkSession {
+class QueryParsingErrorsSuite extends QueryTest with SharedSparkSession with 
SQLHelper {
 
   private def parseException(sqlText: String): SparkThrowable = {
     intercept[ParseException](sql(sqlText).collect())
   }
 
+  test("NAMED_ARGUMENTS_SUPPORT_DISABLED: named arguments not turned on") {
+    withSQLConf("spark.sql.allowNamedFunctionArguments" -> "false") {
+      checkError(
+        exception = parseException("SELECT * FROM encode(value => 'abc', 
charset => 'utf-8')"),
+        errorClass = "NAMED_ARGUMENTS_SUPPORT_DISABLED",
+        parameters = Map("functionName" -> toSQLId("encode"), "argument" -> 
toSQLId("value"))

Review Comment:
   Yeah, tried it without them and it would fail. The parameters are expected 
to have the extra quotation marks around them. 



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