-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-41174][CORE][SQL] Propagate an error class to users for invalid format of to_binary()
#38737
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
format of to_binary()format of to_binary()
|
cc @MaxGekk |
|
@MaxGekk rebased |
| } | ||
| } else if (!f.foldable) { | ||
| DataTypeMismatch( | ||
| errorSubClass = "NON_FOLDABLE_INPUT", |
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.
Could you write a test for the case, please. I just wonder how it could happen:
if (f.foldable && ...) {
...
} else if (!f.foldable) {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.
For !f.foldable branch?
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.
Yep. Just to be sure we handle the non-foldable case correctly.
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.
36e1bda add two new case
| GenerateUnsafeProjection.generate(StringDecode(b, Literal("\"quote")) :: Nil) | ||
| } | ||
|
|
||
|
|
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 is not needed.
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.
removed
MaxGekk
left a comment
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.
LGTM except of a minor comment.
|
+1, LGTM. Merging to master. |
…d `format` of `to_binary()` ### What changes were proposed in this pull request? This pr overrides the `checkInputDataTypes()` method of `ToBinary` function to propagate error class to users for invalid `format`. ### 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? Pass GitHub Actions Closes apache#38737 from LuciferYang/SPARK-41174. Authored-by: yangjie01 <[email protected]> Signed-off-by: Max Gekk <[email protected]>
…d `format` of `to_binary()` ### What changes were proposed in this pull request? This pr overrides the `checkInputDataTypes()` method of `ToBinary` function to propagate error class to users for invalid `format`. ### 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? Pass GitHub Actions Closes apache#38737 from LuciferYang/SPARK-41174. Authored-by: yangjie01 <[email protected]> Signed-off-by: Max Gekk <[email protected]>
What changes were proposed in this pull request?
This pr overrides the
checkInputDataTypes()method ofToBinaryfunction to propagate error class to users for invalidformat.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?
Pass GitHub Actions