-
Notifications
You must be signed in to change notification settings - Fork 28.6k
[SPARK-46608][SQL] Restore backward compatibility of JdbcDialect.classifyException
#44449
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
JdbcDialect.classifyException
JdbcDialect.classifyException
JdbcDialect.classifyException
JdbcDialect.classifyException
new AnalysisException(errorClass, messageParameters, cause = Some(e)) | ||
messageParameters: Map[String, String], | ||
description: String): AnalysisException = { | ||
classifyException(description, e) |
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.
Instead of passing description
around, shall we generate the description here using the error class name and the tableName
in the parameters?
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.
This might be not fully compatible with existing JDBC dialects because values in messageParameters
has been preprocessed already like quoting, and a JDBC dialect could use regexp for parsing parameters from message
/description
. Theoretically, it can break the regexps.
And if we pass the quoting values to an JDBC dialect, it can throw some Spark exception which performs quoting inside like PostgresDialect
throws NonEmptyNamespaceException
. The last one does quoting inside its constructor. Apparently, we will get double quoting values which is a bug already.
Merging to master. Thank you, @cloud-fan for review. |
What changes were proposed in this pull request?
In the PR, I propose to restore
classifyException()
ofJdbcDialect
before the commit 14a933b, and extendsclassifyException()
with the error class parameter bydescription
:The
description
parameter has the same meaning asmessage
in the old version ofclassifyException()
which is deprecated.Also old implementation of
classifyException()
has been restored in JDBC dialects: MySQL, PostgreSQL and so on.Why are the changes needed?
To restore compatibility with existing JDBC dialects.
Does this PR introduce any user-facing change?
No, this PR restores the behaviour prior #44358.
How was this patch tested?
By running the affected test suite:
and modified test suite:
Was this patch authored or co-authored using generative AI tooling?
No.