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