Skip to content

Conversation

@MaxGekk
Copy link
Member

@MaxGekk MaxGekk commented Apr 22, 2022

What changes were proposed in this pull request?

In the PR, I propose to modify the method QueryErrorsBase.toSQLType() to use double quotes for types in error messages.

Why are the changes needed?

  1. To highlight types and make them more visible for users.
  2. To be able to easily parse types from error text.
  3. To be consistent to other outputs of identifiers, sql statement and etc. where Spark uses quotes or ticks.

Does this PR introduce any user-facing change?

Yes, the PR changes user-facing errors.

How was this patch tested?

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"

@MaxGekk
Copy link
Member Author

MaxGekk commented Apr 22, 2022

@MaxGekk
Copy link
Member Author

MaxGekk commented Apr 22, 2022

FYI, we discussed the changes with @cloud-fan and @srielau offline.

@MaxGekk
Copy link
Member Author

MaxGekk commented Apr 22, 2022

GA passed. Merging to master.
Thank you, @cloud-fan for review.

@MaxGekk MaxGekk closed this in 5e494d3 Apr 22, 2022
MaxGekk added a commit to MaxGekk/spark that referenced this pull request Apr 23, 2022
In the PR, I propose to modify the method `QueryErrorsBase.toSQLType()` to use double quotes for types in error messages.

1. To highlight types and make them more visible for users.
2. To be able to easily parse types from error text.
3. To be consistent to other outputs of identifiers, sql statement and etc. where Spark uses quotes or ticks.

Yes, the PR changes user-facing errors.

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#36324 from MaxGekk/wrap-types-in-error-classes.

Authored-by: Max Gekk <[email protected]>
Signed-off-by: Max Gekk <[email protected]>
(cherry picked from commit 5e494d3)
Signed-off-by: Max Gekk <[email protected]>
HyukjinKwon pushed a commit that referenced this pull request Apr 25, 2022
### What changes were proposed in this pull request?

This PR is a backport of #36324

In the PR, I propose to modify the method `QueryErrorsBase.toSQLType()` to use double quotes for types in error messages.

### Why are the changes needed?
1. To highlight types and make them more visible for users.
2. To be able to easily parse types from error text.
3. To be consistent to other outputs of identifiers, sql statement and etc. where Spark uses quotes or ticks.

### Does this PR introduce _any_ user-facing change?
Yes, the PR changes user-facing errors.

### How was this patch tested?
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"
```

Authored-by: Max Gekk <max.gekkgmail.com>
Signed-off-by: Max Gekk <max.gekkgmail.com>
(cherry picked from commit 5e494d3)
Signed-off-by: Max Gekk <max.gekkgmail.com>

Closes #36329 from MaxGekk/wrap-types-in-error-classes-3.3.

Authored-by: Max Gekk <[email protected]>
Signed-off-by: Hyukjin Kwon <[email protected]>
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 <[email protected]>
Signed-off-by: Max Gekk <[email protected]>
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 <[email protected]>
Signed-off-by: Max Gekk <[email protected]>
(cherry picked from commit 2a4d8a4)
Signed-off-by: Max Gekk <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants