-
Notifications
You must be signed in to change notification settings - Fork 28.7k
[SPARK-52184][SQL] Wrap external engine JDBC syntax errors with a unified exception #50918
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
Conversation
@alekjarmov Could you fix formatting, please:
just re-generate the json file:
|
6898200
to
8b143e5
Compare
8b143e5
to
2aacaf9
Compare
@cloud-fan Could you merge it please if everything is ok? |
@@ -3876,6 +3876,24 @@ | |||
}, | |||
"sqlState" : "42000" | |||
}, | |||
"JDBC_EXTERNAL_ENGINE_SYNTAX_ERROR" : { | |||
"message" : [ | |||
"JDBC external engine syntax error." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it possible to always provide the compiled JDBC SQL text?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I modified the error message to include the query.
sql/core/src/main/scala/org/apache/spark/sql/jdbc/JdbcDialects.scala
Outdated
Show resolved
Hide resolved
The last commit just modified the version number in |
…fied exception ### What changes were proposed in this pull request? This PR introduces a unified mechanism for handling SQL syntax errors thrown by external JDBC engines. It does so by: * Adding a new error condition: `JDBC_EXTERNAL_ENGINE_SYNTAX_ERROR`. * Extending multiple JdbcDialect implementations to provide best-effort syntax error detection via `isSyntaxErrorBestEffort`. * Updating integration test suites to include a new shared test that verifies the wrapping behavior. ### Why are the changes needed? Current behavior rethrows the error if it's a syntax error on the external engine. Having it wrapped in a Spark exception enables for easier data scince. ### Does this PR introduce _any_ user-facing change? The users would get a better error message. ### How was this patch tested? Adding new integration tests. ### Was this patch authored or co-authored using generative AI tooling? Coauthored with GitHub Copilot. Closes apache#50918 from alekjarmov/wrap-external-engine-errors. Lead-authored-by: alekjarmov <[email protected]> Co-authored-by: Wenchen Fan <[email protected]> Signed-off-by: Wenchen Fan <[email protected]>
What changes were proposed in this pull request?
This PR introduces a unified mechanism for handling SQL syntax errors thrown by external JDBC engines. It does so by:
JDBC_EXTERNAL_ENGINE_SYNTAX_ERROR
.isSyntaxErrorBestEffort
.Why are the changes needed?
Current behavior rethrows the error if it's a syntax error on the external engine. Having it wrapped in a Spark exception enables for easier data scince.
Does this PR introduce any user-facing change?
The users would get a better error message.
How was this patch tested?
Adding new integration tests.
Was this patch authored or co-authored using generative AI tooling?
Coauthored with GitHub Copilot.