Skip to content

Conversation

@MaxGekk
Copy link
Member

@MaxGekk MaxGekk commented May 17, 2022

What changes were proposed in this pull request?

Wrap values of SQL configs and datasource options in error messages by double quotes. Added the toDSOption() method to QueryErrorsBase to quote DS options.

Why are the changes needed?

  1. To highlight SQL config/DS option values and make them more visible for users.
  2. To be able to easily parse values 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, it changes user-facing error messages.

How was this patch tested?

By running the modified test suites:

$ build/sbt "testOnly *QueryCompilationErrorsSuite"
$ build/sbt "testOnly *QueryExecutionAnsiErrorsSuite"
$ build/sbt "testOnly *QueryExecutionErrorsSuite"

@MaxGekk MaxGekk changed the title [WIP][SQL] Use double quotes for values of SQL configs/DS options in error messages [SPARK-39212][SQL] Use double quotes for values of SQL configs/DS options in error messages May 17, 2022
@MaxGekk MaxGekk marked this pull request as ready for review May 17, 2022 17:38
@MaxGekk
Copy link
Member Author

MaxGekk commented May 17, 2022

@srielau @panbingkun Could you take a look at the PR, please.

@MaxGekk
Copy link
Member Author

MaxGekk commented May 18, 2022

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

@MaxGekk MaxGekk closed this in 96f4b7d May 18, 2022
MaxGekk added a commit to MaxGekk/spark that referenced this pull request May 18, 2022
…ions in error messages

Wrap values of SQL configs and datasource options in error messages by double quotes. Added the `toDSOption()` method to `QueryErrorsBase` to quote DS options.

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

Yes, it changes user-facing error messages.

By running the modified test suites:
```
$ build/sbt "testOnly *QueryCompilationErrorsSuite"
$ build/sbt "testOnly *QueryExecutionAnsiErrorsSuite"
$ build/sbt "testOnly *QueryExecutionErrorsSuite"
```

Closes apache#36579 from MaxGekk/move-ise-from-query-errors.

Authored-by: Max Gekk <max.gekk@gmail.com>
Signed-off-by: Max Gekk <max.gekk@gmail.com>
(cherry picked from commit 96f4b7d)
Signed-off-by: Max Gekk <max.gekk@gmail.com>
@MaxGekk
Copy link
Member Author

MaxGekk commented May 18, 2022

Here is the backport to 3.3: #36600

gengliangwang pushed a commit that referenced this pull request May 19, 2022
…S options in error messages

### What changes were proposed in this pull request?
Wrap values of SQL configs and datasource options in error messages by double quotes. Added the `toDSOption()` method to `QueryErrorsBase` to quote DS options.

This is a backport of #36579.

### Why are the changes needed?
1. To highlight SQL config/DS option values and make them more visible for users.
2. To be able to easily parse values 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, it changes user-facing error messages.

### How was this patch tested?
By running the modified test suites:
```
$ build/sbt "testOnly *QueryCompilationErrorsSuite"
$ build/sbt "testOnly *QueryExecutionAnsiErrorsSuite"
$ build/sbt "testOnly *QueryExecutionErrorsSuite"
```

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

Closes #36600 from MaxGekk/move-ise-from-query-errors-3.3-2.

Authored-by: Max Gekk <max.gekk@gmail.com>
Signed-off-by: Gengliang Wang <gengliang@apache.org>
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants