-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-38926][SQL] Output types in error messages in SQL style #36233
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
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Member
Author
Member
Author
|
@ivoson @yutoacts @leesf @cloud-fan @HyukjinKwon @gengliangwang @panbingkun Could you review this PR, please. |
HyukjinKwon
approved these changes
Apr 17, 2022
leesf
approved these changes
Apr 18, 2022
zhengruifeng
approved these changes
Apr 18, 2022
Member
Author
|
Merging to master. Thank you, @zhengruifeng @leesf and @HyukjinKwon for review. |
MaxGekk
added a commit
to MaxGekk/spark
that referenced
this pull request
Apr 18, 2022
In the PR, I propose to upper case SQL types in error messages similar to the SQL standard. I added new util functions `toSQLType()` to the trait `QueryErrorsBase`, and applied it in `Query.*Errors` (also modified tests in `Query.*ErrorsSuite`). For example: Before: ```sql Cannot up cast b.`b` from decimal(38,18) to bigint. ``` After: ```sql Cannot up cast b.`b` from DECIMAL(38,18) to BIGINT. ``` To improve user experience with Spark SQL. The changes highlight SQL types in error massages and make them more visible for users. No since error classes haven't been released yet. By running the modified test suites: ``` $ build/sbt "test:testOnly *QueryParsingErrorsSuite" $ build/sbt "test:testOnly *QueryCompilationErrorsSuite" $ build/sbt "test:testOnly *QueryExecutionErrorsSuite" $ build/sbt "testOnly *CastSuite" $ build/sbt "testOnly *AnsiCastSuiteWithAnsiModeOn" $ build/sbt "testOnly *EncoderResolutionSuite" $ build/sbt "test:testOnly *DatasetSuite" $ build/sbt "test:testOnly *InsertSuite" ``` Closes apache#36233 from MaxGekk/error-class-toSQLType. Authored-by: Max Gekk <max.gekk@gmail.com> Signed-off-by: Max Gekk <max.gekk@gmail.com> (cherry picked from commit 0d16159) Signed-off-by: Max Gekk <max.gekk@gmail.com>
3 tasks
MaxGekk
added a commit
that referenced
this pull request
May 22, 2022
### What changes were proposed in this pull request? In the PR, I propose to describe the rules of quoting elements in error messages introduced by the PRs: - #36210 - #36233 - #36259 - #36324 - #36335 - #36359 - #36579 ### Why are the changes needed? To improve code maintenance, and the process of code review. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? By existing GAs. Closes #36621 from MaxGekk/update-error-class-guide. Authored-by: Max Gekk <max.gekk@gmail.com> Signed-off-by: Max Gekk <max.gekk@gmail.com>
MaxGekk
added a commit
that referenced
this pull request
May 22, 2022
### What changes were proposed in this pull request? In the PR, I propose to describe the rules of quoting elements in error messages introduced by the PRs: - #36210 - #36233 - #36259 - #36324 - #36335 - #36359 - #36579 ### Why are the changes needed? To improve code maintenance, and the process of code review. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? By existing GAs. Closes #36621 from MaxGekk/update-error-class-guide. Authored-by: Max Gekk <max.gekk@gmail.com> Signed-off-by: Max Gekk <max.gekk@gmail.com> (cherry picked from commit 2a4d8a4) Signed-off-by: Max Gekk <max.gekk@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
In the PR, I propose to upper case SQL types in error messages similar to the SQL standard. I added new util functions
toSQLType()to the traitQueryErrorsBase, and applied it inQuery.*Errors(also modified tests inQuery.*ErrorsSuite). For example:Before:
After:
Why are the changes needed?
To improve user experience with Spark SQL. The changes highlight SQL types in error massages and make them more visible for users.
Does this PR introduce any user-facing change?
No since error classes haven't been released yet.
How was this patch tested?
By running the modified test suites: