-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-40756][SQL] Migrate type check failures of string expressions onto error classes #38299
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…onto error classes
…onto error classes
|
cc @MaxGekk |
|
Can one of the admins verify this patch? |
|
@panbingkun Could you resolve conflicts, please. |
…onto error classes
…onto error classes
|
| "The <exprName> must not be null" | ||
| ] | ||
| }, | ||
| "UNEXPECTED_NUM_PARAMS" : { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems it is similar to WRONG_NUM_PARAMS. Could you re-use the existing one or improve it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can make WRONG_NUM_PARAMS more general
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can I change it to:
"WRONG_NUM_PARAMS" : { "message" : [ "The <functionName> requires <expectedNum> arguments (actual number = <actualNum>)" ] }
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, open a separate PR and change the error template. I would change it to:
"WRONG_NUM_PARAMS" : {
"message" : [
"The <functionName> requires <expectedNum> parameters but the actual number is <actualNum>."
]
}There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
| "cannot find a static method <methodName> that matches the argument types in <className>" | ||
| ] | ||
| }, | ||
| "UNEXPECTED_VALUE" : { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't you re-use VALUE_OUT_OF_RANGE?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
After #38319, I will continue do it. |
…onto error classes
|
+1, LGTM. Merging to master. |
…onto error classes ### What changes were proposed in this pull request? This pr replace TypeCheckFailure by DataTypeMismatch in type checks in the string expressions, includes: - regexpExpressions.scala (RegExpReplace) - stringExpressions.scala (Etl) ### Why are the changes needed? Migration onto error classes unifies Spark SQL error messages. ### Does this PR introduce _any_ user-facing change? Yes. The PR changes user-facing error messages. ### How was this patch tested? - Add new UT - Update existed UT - Pass GA. Closes apache#38299 from panbingkun/SPARK-40756. Authored-by: panbingkun <[email protected]> Signed-off-by: Max Gekk <[email protected]>
What changes were proposed in this pull request?
This pr replace TypeCheckFailure by DataTypeMismatch in type checks in the string expressions, includes:
Why are the changes needed?
Migration onto error classes unifies Spark SQL error messages.
Does this PR introduce any user-facing change?
Yes. The PR changes user-facing error messages.
How was this patch tested?