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-42348][SQL] Add new SQLSTATE #39886

Closed
wants to merge 1 commit into from

Conversation

itholic
Copy link
Contributor

@itholic itholic commented Feb 5, 2023

What changes were proposed in this pull request?

This PR proposes to add new SQLSTATE defined from Databricks to core/src/main/resources/error/README.md.

Why are the changes needed?

We should use proper SQLSTATE for every SQL error classes.

Otherwise, it fails on SparkThrowableSuite.SQLSTATE invariants test.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

The existing CI should pass.

Comment on lines +860 to +870
|42KD0 |42 |Syntax error or Access Rule violation |KD0 |Ambiguous name reference. |Databricks |N |Databricks |
|42KD1 |42 |Syntax error or Access Rule violation |KD1 |Operation not supported in READ ONLY session mode. |Databricks |N |Databricks |
|42KD2 |42 |Syntax error or Access Rule violation |KD2 |The source and target table names of a SYNC operaton must be the same.|Databricks |N |Databricks |
|42KD3 |42 |Syntax error or Access Rule violation |KD3 |A column can not be added as specified. |Databricks |N |Databricks |
|42KD4 |42 |Syntax error or Access Rule violation |KD4 |Operation not supported because table schema has changed. |Databricks |N |Databricks |
|42KD5 |42 |Syntax error or Access Rule violation |KD5 |Cannot create file or path. |Databricks |N |Databricks |
|42KD6 |42 |Syntax error or Access Rule violation |KD6 |No partition information found. |Databricks |N |Databricks |
|42KD7 |42 |Syntax error or Access Rule violation |KD7 |Table signature mismatch. |Databricks |N |Databricks |
|42KD8 |42 |Syntax error or Access Rule violation |KD8 |Column position out of range. |Databricks |N |Databricks |
|42KD9 |42 |Syntax error or Access Rule violation |KD9 |Cannot infer table schema. |Databricks |N |Databricks |
|42KDA |42 |Syntax error or Access Rule violation |KDA |Failed to merge file into table schema. |Databricks |N |Databricks |
Copy link
Contributor Author

Choose a reason for hiding this comment

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

cc @srielau do we want to add those SQLSTATE to core/src/main/resources/error/README.md ?

Otherwise, we can't use them in error class because we only allow the SQLSTATE specified in core/src/main/resources/error/README.md.

For example, we cannot apply #39871 (comment).

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@cloud-fan
Copy link
Contributor

thanks, merging to master/3.4!

@cloud-fan cloud-fan closed this in 188e608 Feb 6, 2023
cloud-fan pushed a commit that referenced this pull request Feb 6, 2023
### What changes were proposed in this pull request?

This PR proposes to add new SQLSTATE defined from Databricks to `core/src/main/resources/error/README.md`.

### Why are the changes needed?

We should use proper SQLSTATE for every SQL error classes.

Otherwise, it fails on `SparkThrowableSuite.SQLSTATE invariants` test.

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

No.

### How was this patch tested?

The existing CI should pass.

Closes #39886 from itholic/MISSING_SQLSTATE.

Authored-by: itholic <haejoon.lee@databricks.com>
Signed-off-by: Wenchen Fan <wenchen@databricks.com>
(cherry picked from commit 188e608)
Signed-off-by: Wenchen Fan <wenchen@databricks.com>
@itholic itholic deleted the MISSING_SQLSTATE branch April 22, 2023 05:48
snmvaughan pushed a commit to snmvaughan/spark that referenced this pull request Jun 20, 2023
### What changes were proposed in this pull request?

This PR proposes to add new SQLSTATE defined from Databricks to `core/src/main/resources/error/README.md`.

### Why are the changes needed?

We should use proper SQLSTATE for every SQL error classes.

Otherwise, it fails on `SparkThrowableSuite.SQLSTATE invariants` test.

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

No.

### How was this patch tested?

The existing CI should pass.

Closes apache#39886 from itholic/MISSING_SQLSTATE.

Authored-by: itholic <haejoon.lee@databricks.com>
Signed-off-by: Wenchen Fan <wenchen@databricks.com>
(cherry picked from commit 188e608)
Signed-off-by: Wenchen Fan <wenchen@databricks.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants