You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/12/13 07:58:20 UTC

[GitHub] [spark] MaxGekk commented on a diff in pull request #38940: [SPARK-41409][CORE][SQL] Rename `_LEGACY_ERROR_TEMP_1043` to `WRONG_NUM_ARGS.WITHOUT_SUGGESTION`

MaxGekk commented on code in PR #38940:
URL: https://github.com/apache/spark/pull/38940#discussion_r1046766089


##########
core/src/main/resources/error/error-classes.json:
##########
@@ -1526,8 +1526,20 @@
   },
   "WRONG_NUM_ARGS" : {
     "message" : [
-      "The <functionName> requires <expectedNum> parameters but the actual number is <actualNum>."
-    ]
+      "Invalid number of arguments for the function <functionName>."
+    ],
+    "subClass" : {
+      "WITHOUT_SUGGESTION" : {
+        "message" : [
+          "Please ref to 'https://spark.apache.org/docs/latest/sql-ref-functions.html' for fix."
+        ]
+      },
+      "WITH_SUGGESTION" : {
+        "message" : [
+          "The function requires <expectedNum> parameters but the actual number is <actualNum>."

Review Comment:
   The sentence still looks like a description of an issue but not a suggestion.
   ```suggestion
             "Consider to change the number of arguments because the function requires <expectedNum> parameters but the actual number is <actualNum>."
   ```



##########
core/src/main/resources/error/error-classes.json:
##########
@@ -1526,8 +1526,20 @@
   },
   "WRONG_NUM_ARGS" : {
     "message" : [
-      "The <functionName> requires <expectedNum> parameters but the actual number is <actualNum>."
-    ]
+      "Invalid number of arguments for the function <functionName>."
+    ],
+    "subClass" : {
+      "WITHOUT_SUGGESTION" : {
+        "message" : [
+          "Please ref to 'https://spark.apache.org/docs/latest/sql-ref-functions.html' for fix."

Review Comment:
   ```suggestion
             "Please, refer to 'https://spark.apache.org/docs/latest/sql-ref-functions.html' for a fix."
   ```



##########
sql/core/src/test/resources/sql-tests/results/table-valued-functions.sql.out:
##########
@@ -83,7 +83,7 @@ org.apache.spark.sql.AnalysisException
   "errorClass" : "_LEGACY_ERROR_TEMP_1179",
   "messageParameters" : {
     "arguments" : "integer, integer, integer, integer, integer",
-    "details" : "[WRONG_NUM_ARGS] The `range` requires [1, 2, 3, 4] parameters but the actual number is 5.",
+    "details" : "[WRONG_NUM_ARGS.WITH_SUGGESTION] Invalid number of arguments for the function `range`. The function requires [1, 2, 3, 4] parameters but the actual number is 5.",

Review Comment:
   I think we should bypass the error. Could you open an separate PR and check if the exception is `SparkThrowable` then re-throw it, please.



-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org