-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-41221][SQL] Add the error class INVALID_FORMAT
#38755
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
INVALID_FORMATINVALID_FORMAT
|
@srielau @srielau @itholic @panbingkun @LuciferYang Could you have a look at this PR, please. |
| ], | ||
| "sqlState" : "42000" | ||
| }, | ||
| "INVALID_FORMAT" : { |
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.
Do we want this to be generic or specific to numbers.
I'm specifically wondering about DATE FORMAT, INTERVAL FORMAT, .. What have we/will we do with these?
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.
Basically: Should we use INVALID_NUMBER_FORMAT, INVALID_DATETIME_FROMAT, .... or just this and bring them all in?
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.
Do we want this to be generic or specific to numbers.
I want to believe that we can make it as a generic error class. I have already merged LIKE ... errors into it.
I think there is the common part where we declare that the format is invalid and show it.
LuciferYang
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.
+1, LGTM
|
Merging to master. Thank you, @srielau @cloud-fan @LuciferYang for review. |
### What changes were proposed in this pull request? In the PR, I propose to move out the error sub-classes related to number format issues from `DATATYPE_MISMATCH` to their own error class `INVALID_FORMAT`. Also, the PR deletes the error class `INVALID_LIKE_PATTERN`, and moves their sub-classes to `INVALID_FORMAT`. ### Why are the changes needed? To improve usability of Spark SQL and to don't confuse users by error class names related to values but to to its types. ### Does this PR introduce _any_ user-facing change? Yes, the PR changes some user-facing errors. ### How was this patch tested? By running the affected test suites: ``` $ PYSPARK_PYTHON=python3 build/sbt "sql/testOnly org.apache.spark.sql.SQLQueryTestSuite" $ build/sbt "core/testOnly *SparkThrowableSuite" $ build/sbt "test:testOnly *StringExpressionsSuite" ``` Closes apache#38755 from MaxGekk/refactor-datatype-mismatch. Authored-by: Max Gekk <[email protected]> Signed-off-by: Max Gekk <[email protected]>
### What changes were proposed in this pull request? In the PR, I propose to move out the error sub-classes related to number format issues from `DATATYPE_MISMATCH` to their own error class `INVALID_FORMAT`. Also, the PR deletes the error class `INVALID_LIKE_PATTERN`, and moves their sub-classes to `INVALID_FORMAT`. ### Why are the changes needed? To improve usability of Spark SQL and to don't confuse users by error class names related to values but to to its types. ### Does this PR introduce _any_ user-facing change? Yes, the PR changes some user-facing errors. ### How was this patch tested? By running the affected test suites: ``` $ PYSPARK_PYTHON=python3 build/sbt "sql/testOnly org.apache.spark.sql.SQLQueryTestSuite" $ build/sbt "core/testOnly *SparkThrowableSuite" $ build/sbt "test:testOnly *StringExpressionsSuite" ``` Closes apache#38755 from MaxGekk/refactor-datatype-mismatch. Authored-by: Max Gekk <[email protected]> Signed-off-by: Max Gekk <[email protected]>
What changes were proposed in this pull request?
In the PR, I propose to move out the error sub-classes related to number format issues from
DATATYPE_MISMATCHto their own error classINVALID_FORMAT. Also, the PR deletes the error classINVALID_LIKE_PATTERN, and moves their sub-classes toINVALID_FORMAT.Why are the changes needed?
To improve usability of Spark SQL and to don't confuse users by error class names related to values but to to its types.
Does this PR introduce any user-facing change?
Yes, the PR changes some user-facing errors.
How was this patch tested?
By running the affected test suites: