Skip to content
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

[SPARK-43259][SQL] Assign a name to the error class _LEGACY_ERROR_TEMP_2024 #45095

Closed
wants to merge 12 commits into from

Conversation

mihailom-db
Copy link
Contributor

@mihailom-db mihailom-db commented Feb 14, 2024

What changes were proposed in this pull request?

In the PR, I propose to assign the proper name INVALID_EXPRESSION_ENCODER to the legacy error class _LEGACY_ERROR_TEMP_2024, and add a test to the suite which uses checkError(). Also this PR improves the error message.

Why are the changes needed?

Proper name improves user experience w/ Spark SQL.

Does this PR introduce any user-facing change?

Yes, the PR changes an user-facing error message.

How was this patch tested?

By running the modified test suite:

./build/mvn -Dtest=none -DwildcardSuites=org.apache.spark.sql.errors.QueryExecutionErrorsSuite test

@github-actions github-actions bot added the SQL label Feb 14, 2024
@mihailom-db mihailom-db changed the title [SPARK-43259][SQL] Assign a name to the error class _LEGACY_ERROR_TEMP_2024 [SPARK-43259][SQL] Assign a name to the error class _LEGACY_ERROR_TEMP_2024 [WIP] Feb 14, 2024
@github-actions github-actions bot added the DOCS label Feb 14, 2024
@mihailom-db mihailom-db changed the title [SPARK-43259][SQL] Assign a name to the error class _LEGACY_ERROR_TEMP_2024 [WIP] [SPARK-43259][SQL] Assign a name to the error class _LEGACY_ERROR_TEMP_2024 Feb 14, 2024
Copy link
Member

@MaxGekk MaxGekk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, assign a proper name for the error class, and add a test using public API.

@MaxGekk
Copy link
Member

MaxGekk commented Feb 20, 2024

In the PR, I propose to assign the proper name UNSUPPORTED_ERROR ...

@mihailom-db Did you really assign this name?

@MaxGekk
Copy link
Member

MaxGekk commented Feb 20, 2024

@mihailom-db BTW, do you have an account at OSS JIRA? If so, could you leave a comment in https://issues.apache.org/jira/browse/SPARK-43259 - telling that you are working on this.

@mihailom-db
Copy link
Contributor Author

Requested the access for the OSS JIRA account, should be able to comment soon.

"description": "Invalid encoder error",
"origin": "SQL/Foundation",
"standard": "Y",
"usedBy": ["SQL/Foundation"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you check is this SQL state used by other DBMS?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I took a look at different DBMS sqlstates and to my knowledge it seems that this one is not used by any. Changed doc accordingly.

@MaxGekk
Copy link
Member

MaxGekk commented Feb 22, 2024

+1, LGTM. Merging to master.
Thank you, @mihailom-db.

@MaxGekk MaxGekk closed this in 6de527e Feb 22, 2024
@MaxGekk
Copy link
Member

MaxGekk commented Feb 22, 2024

@mihailom-db Congratulations with your first contribution to Apache Spark!

Copy link
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, @mihailom-db and @MaxGekk

Does this PR pass the CIs? It seem to break Apache Spark master branch. Could you take a look at the failure?

@dongjoon-hyun
Copy link
Member

dongjoon-hyun commented Feb 23, 2024

[info] SparkThrowableSuite:
[info] - No duplicate error classes (20 milliseconds)
[info] - Error classes are correctly formatted (35 milliseconds)
[info] - SQLSTATE is mandatory (2 milliseconds)
[info] - Error category and error state / SQLSTATE invariants (23 milliseconds)
[info] - Message invariants (7 milliseconds)
[info] - Message format invariants (8 milliseconds)
[info] - Error classes match with document *** FAILED *** (55 milliseconds)
[info]   "...ects an instance of [ExpressionEncoder] but got `<encoderTy..." did not equal "...ects an instance of [`ExpressionEncoder`] but got `<encoderTy..." The error class document is not up to date. Please regenerate it. (SparkThrowableSuite.scala:353)
[info]   Analysis:
[info]   "...ects an instance of [ExpressionEncoder] but got `<encoderTy..." -> "...ects an instance of [`ExpressionEncoder`] but got `<encoderTy..."

@dongjoon-hyun
Copy link
Member

NVM. Let me make a quick followup.

@dongjoon-hyun
Copy link
Member

dongjoon-hyun added a commit that referenced this pull request Feb 23, 2024
…recover `SparkThrowableSuite`

### What changes were proposed in this pull request?

This is a follow-up of #45095

### Why are the changes needed?

To recover the broken `master` branch.
- https://github.com/apache/spark/actions/runs/8008631301/job/21875499011

### Does this PR introduce _any_ user-facing change?

No.

### How was this patch tested?

Pass the CIs.

I manually verified like the following.
```
[info] SparkThrowableSuite:
[info] - No duplicate error classes (23 milliseconds)
[info] - Error classes are correctly formatted (37 milliseconds)
[info] - SQLSTATE is mandatory (1 millisecond)
[info] - Error category and error state / SQLSTATE invariants (21 milliseconds)
[info] - Message invariants (6 milliseconds)
[info] - Message format invariants (9 milliseconds)
[info] - Error classes match with document (54 milliseconds)
[info] - Round trip (23 milliseconds)
[info] - Error class names should contain only capital letters, numbers and underscores (5 milliseconds)
[info] - Check if error class is missing (14 milliseconds)
[info] - Check if message parameters match message format (2 milliseconds)
[info] - Error message is formatted (0 milliseconds)
[info] - Error message does not do substitution on values (0 milliseconds)
[info] - Try catching legacy SparkError (1 millisecond)
[info] - Try catching SparkError with error class (1 millisecond)
[info] - Try catching internal SparkError (1 millisecond)
[info] - Get message in the specified format (3 milliseconds)
[info] - overwrite error classes (47 milliseconds)
[info] - prohibit dots in error class names (15 milliseconds)
[info] Run completed in 1 second, 90 milliseconds.
[info] Total number of tests run: 19
[info] Suites: completed 1, aborted 0
[info] Tests: succeeded 19, failed 0, canceled 0, ignored 0, pending 0
[info] All tests passed.
[success] Total time: 7 s, completed Feb 22, 2024, 5:22:24 PM
```

### Was this patch authored or co-authored using generative AI tooling?

No.

Closes #45226 from dongjoon-hyun/SPARK-43259.

Authored-by: Dongjoon Hyun <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
@mihailom-db mihailom-db deleted the SPARK-43259 branch February 27, 2024 13:46
ericm-db pushed a commit to ericm-db/spark that referenced this pull request Mar 5, 2024
…P_2024

### What changes were proposed in this pull request?
In the PR, I propose to assign the proper name `INVALID_EXPRESSION_ENCODER`  to the legacy error class `_LEGACY_ERROR_TEMP_2024`, and add a test to the suite which uses `checkError()`. Also this PR improves the error message.

### Why are the changes needed?
Proper name improves user experience w/ Spark SQL.

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

### How was this patch tested?
By running the modified test suite:

```
./build/mvn -Dtest=none -DwildcardSuites=org.apache.spark.sql.errors.QueryExecutionErrorsSuite test
```

Closes apache#45095 from mihailom-db/SPARK-43259.

Authored-by: Mihailo Milosevic <[email protected]>
Signed-off-by: Max Gekk <[email protected]>
ericm-db pushed a commit to ericm-db/spark that referenced this pull request Mar 5, 2024
…recover `SparkThrowableSuite`

### What changes were proposed in this pull request?

This is a follow-up of apache#45095

### Why are the changes needed?

To recover the broken `master` branch.
- https://github.com/apache/spark/actions/runs/8008631301/job/21875499011

### Does this PR introduce _any_ user-facing change?

No.

### How was this patch tested?

Pass the CIs.

I manually verified like the following.
```
[info] SparkThrowableSuite:
[info] - No duplicate error classes (23 milliseconds)
[info] - Error classes are correctly formatted (37 milliseconds)
[info] - SQLSTATE is mandatory (1 millisecond)
[info] - Error category and error state / SQLSTATE invariants (21 milliseconds)
[info] - Message invariants (6 milliseconds)
[info] - Message format invariants (9 milliseconds)
[info] - Error classes match with document (54 milliseconds)
[info] - Round trip (23 milliseconds)
[info] - Error class names should contain only capital letters, numbers and underscores (5 milliseconds)
[info] - Check if error class is missing (14 milliseconds)
[info] - Check if message parameters match message format (2 milliseconds)
[info] - Error message is formatted (0 milliseconds)
[info] - Error message does not do substitution on values (0 milliseconds)
[info] - Try catching legacy SparkError (1 millisecond)
[info] - Try catching SparkError with error class (1 millisecond)
[info] - Try catching internal SparkError (1 millisecond)
[info] - Get message in the specified format (3 milliseconds)
[info] - overwrite error classes (47 milliseconds)
[info] - prohibit dots in error class names (15 milliseconds)
[info] Run completed in 1 second, 90 milliseconds.
[info] Total number of tests run: 19
[info] Suites: completed 1, aborted 0
[info] Tests: succeeded 19, failed 0, canceled 0, ignored 0, pending 0
[info] All tests passed.
[success] Total time: 7 s, completed Feb 22, 2024, 5:22:24 PM
```

### Was this patch authored or co-authored using generative AI tooling?

No.

Closes apache#45226 from dongjoon-hyun/SPARK-43259.

Authored-by: Dongjoon Hyun <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
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.

3 participants