[SPARK-40756][SQL] Migrate type check failures of string expressions onto error classes#38299
[SPARK-40756][SQL] Migrate type check failures of string expressions onto error classes#38299panbingkun wants to merge 7 commits intoapache:masterfrom
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.
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.
I think we can make WRONG_NUM_PARAMS more general
There was a problem hiding this comment.
Can I change it to:
"WRONG_NUM_PARAMS" : { "message" : [ "The <functionName> requires <expectedNum> arguments (actual number = <actualNum>)" ] }
?
There was a problem hiding this comment.
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>."
]
}| "cannot find a static method <methodName> that matches the argument types in <className>" | ||
| ] | ||
| }, | ||
| "UNEXPECTED_VALUE" : { |
There was a problem hiding this comment.
Can't you re-use VALUE_OUT_OF_RANGE?
|
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 <pbk1982@gmail.com> Signed-off-by: Max Gekk <max.gekk@gmail.com>
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?