-
Notifications
You must be signed in to change notification settings - Fork 29.2k
[SPARK-46036][SQL] Removing error-class from raise_error function #44004
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
Changes from all commits
3ddc2f5
c1f83cf
0ecc9c4
de16905
90a00db
d2f4b2c
cfe2f00
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3269,14 +3269,6 @@ object functions { | |
| */ | ||
| def raise_error(c: Column): Column = Column.fn("raise_error", c) | ||
|
|
||
| /** | ||
| * Throws an exception with the provided error class and parameter map. | ||
| * | ||
| * @group misc_funcs | ||
| * @since 4.0.0 | ||
| */ | ||
| def raise_error(c: Column, e: Column): Column = Column.fn("raise_error", c, e) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems this API added no long.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure that I understand the comment. Can you please elaborate?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. cc @srielau
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should remove this API from
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @cloud-fan This PR will forbid to expose the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done. @beliefer Yes, idea is to forbid errorParams exposure, given that we will always throw USER_RAISED_EXCEPTION with single arg (string representing the message). @cloud-fan, please confirm if I got things right.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @dbatomic Thank you for the explanation. Please wait the confirm. |
||
|
|
||
| /** | ||
| * Returns the estimated number of unique values given the binary representation | ||
| * of a Datasketches HllSketch. | ||
|
|
||
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.
RaiseErrorworks good, why you create the builder?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.
In my offline discussion with @cloud-fan we tried to come with a way to achieve following:
My understanding is that
expression[RaiseError]("raise_error")ends up doing reflection that would expose a function for every constructor signature in RaiseError, meaning that we will expose bothdef this(str: Expression)anddef this(errorClass: Expression, errorParms: Expression)fromRaiseError.Instead of doing this, we take ExpressionBuilder path that will expose only single argument version.
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.
Got it. It hears good to me. We can use this builder to wrap the visibility.