allisonwang-db commented on code in PR #41864:
URL: https://github.com/apache/spark/pull/41864#discussion_r1262805881


##########
sql/core/src/test/resources/sql-tests/results/table-valued-functions.sql.out:
##########
@@ -327,13 +327,14 @@ struct<>
 -- !query output
 org.apache.spark.sql.AnalysisException
 {
-  "errorClass" : "WRONG_NUM_ARGS.WITHOUT_SUGGESTION",
-  "sqlState" : "42605",
+  "errorClass" : "DATATYPE_MISMATCH.UNEXPECTED_INPUT_TYPE",
+  "sqlState" : "42K09",
   "messageParameters" : {
-    "actualNum" : "2",
-    "docroot" : "https://spark.apache.org/docs/latest";,
-    "expectedNum" : "1",
-    "functionName" : "`explode`"
+    "inputSql" : "\"1\"",
+    "inputType" : "\"INT\"",
+    "paramIndex" : "1",
+    "requiredType" : "(\"ARRAY\" or \"MAP\")",
+    "sqlExpr" : "\"explode(1)\""
   },
   "queryContext" : [ {
     "objectType" : "",

Review Comment:
   Can we add more named argument tests in this file 
(table-valued-functions.sql) when the function invocation throws exceptions? 
For example use named arguments for these tests:
   
https://github.com/apache/spark/blob/efed39516c0c4e9654aec447ce91676026368384/sql/core/src/test/resources/sql-tests/results/table-valued-functions.sql.out#L349-L355
   
   I'd like to make sure the exceptions stay the same.



##########
sql/core/src/test/resources/sql-tests/results/table-valued-functions.sql.out:
##########
@@ -327,13 +327,14 @@ struct<>
 -- !query output
 org.apache.spark.sql.AnalysisException
 {
-  "errorClass" : "WRONG_NUM_ARGS.WITHOUT_SUGGESTION",
-  "sqlState" : "42605",
+  "errorClass" : "DATATYPE_MISMATCH.UNEXPECTED_INPUT_TYPE",
+  "sqlState" : "42K09",
   "messageParameters" : {
-    "actualNum" : "2",
-    "docroot" : "https://spark.apache.org/docs/latest";,
-    "expectedNum" : "1",
-    "functionName" : "`explode`"
+    "inputSql" : "\"1\"",
+    "inputType" : "\"INT\"",
+    "paramIndex" : "1",
+    "requiredType" : "(\"ARRAY\" or \"MAP\")",
+    "sqlExpr" : "\"explode(1)\""

Review Comment:
   shouldn't this be explode (1,2)?



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