-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-49877][SQL] Change classifyException function signature: add isRuntime argument #48351
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-49877][SQL] Change classifyException function signature: add isRuntime argument #48351
Conversation
…o syntaxErrorsJdbc
…o syntaxErrorsJdbc
sql/core/src/main/scala/org/apache/spark/sql/jdbc/JdbcDialects.scala
Outdated
Show resolved
Hide resolved
| messageParameters: Map[String, String], | ||
| description: String): AnalysisException = { | ||
| new AnalysisException( | ||
| errorClass = "...", |
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.
You should assign proper error condition (class) here.
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.
but we're removing it?
sql/core/src/main/scala/org/apache/spark/sql/jdbc/JdbcDialects.scala
Outdated
Show resolved
Hide resolved
| messageParameters: Map[String, String], | ||
| description: String): AnalysisException = { | ||
| description: String, | ||
| isRuntime: Boolean): Throwable with SparkThrowable = { |
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.
Sorry for back and forth, but do we need this flag now?
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.
We will need it for this pr: #48182(after this is merged I will do some modifications).
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.
sgtm
|
The tests are now passing. Could you make a review @MaxGekk? Thanks. |
sql/core/src/main/scala/org/apache/spark/sql/jdbc/DB2Dialect.scala
Outdated
Show resolved
Hide resolved
| * @param isRuntime Whether the exception is a runtime exception or not. | ||
| * @return `SparkThrowable + Throwable` or its sub-class. | ||
| */ | ||
| def classifyException( |
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 method has not been released yet, so, we can modify it.
|
+1, LGTM. Merging to master. |
What changes were proposed in this pull request?
The proposal is to update the classifyException function so that it can return either
AnalysisExceptionorSparkRuntimeException. This is achieved by adding a new parameter,isRuntime, and modifying the return type to beThrowable with SparkThrowablefor compatibility with both types.Why are the changes needed?
The changes are needed to allow the classifyException function to be used in execution part of the code.
Does this PR introduce any user-facing change?
No.
How was this patch tested?
Not needed.
Was this patch authored or co-authored using generative AI tooling?
No.