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-49730][SQL] classify syntax errors for pgsql, mysql, sqlserver and h2 #48182

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

milastdbx
Copy link
Contributor

What changes were proposed in this pull request?

In this PR I propose that we add classification of JDBC driver exception that represent syntax errors on external databases.
Queries generated from Spark that are sent to connectors should never have syntax error, and always indicate to a bug in code.

Having this classification would greatly help in identifying bugs faster and improving quality.

Documentation about error codes for syntax errors:
https://learn.microsoft.com/en-us/sql/relational-databases/errors-events/database-engine-events-and-errors-0-to-999?view=sql-server-ver16
https://www.postgresql.org/docs/current/errcodes-appendix.html
https://mariadb.com/kb/en/mariadb-error-code-reference/
https://www.h2database.com/javadoc/org/h2/api/ErrorCode.html

Why are the changes needed?

  1. This gives customer more precise error message about issue being hit.
  2. Help identify bugs faster as syntax error thrown from jdbc connectors should never happen.

Does this PR introduce any user-facing change?

Yes, previously customers would get FAILED_JDBC. UNCLASSIFIED or internal error when syntax error occurs in JDBC, whereas they will now get FAILED_JDBC.SYNTAX_ERROR

How was this patch tested?

Integration tests

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

No

@github-actions github-actions bot added the SQL label Sep 20, 2024
@HyukjinKwon HyukjinKwon changed the title [SPARK-49730] classify syntax errors for pgsql, mysql, sqlserver and h2 [SPARK-49730][SQL] classify syntax errors for pgsql, mysql, sqlserver and h2 Sep 20, 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.

@milastdbx Could you have a look at the failed integration tests. Most of the failures are related to your changes, it seems.

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.

3 participants