-
Notifications
You must be signed in to change notification settings - Fork 28.3k
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
[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
*/ | ||
def classifyException( | ||
e: Throwable, | ||
errorClass: String, | ||
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
@@ -741,13 +741,15 @@ abstract class JdbcDialect extends Serializable with Logging { | |||
* @param errorClass The error class assigned in the case of an unclassified `e` | |||
* @param messageParameters The message parameters of `errorClass` | |||
* @param description The error description | |||
* @return `AnalysisException` or its sub-class. | |||
* @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. |
…sRuntime argument ### What changes were proposed in this pull request? The proposal is to update the classifyException function so that it can return either ```AnalysisException``` or ```SparkRuntimeException```. This is achieved by adding a new parameter, ```isRuntime```, and modifying the return type to be ```Throwable with SparkThrowable``` for 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. Closes apache#48351 from ivanjevtic-db/Change-classify-exception-function-signature. Lead-authored-by: ivanjevtic-db <[email protected]> Co-authored-by: Ivan Jevtic <[email protected]> Co-authored-by: milastdbx <[email protected]> Co-authored-by: Maxim Gekk <[email protected]> Signed-off-by: Max Gekk <[email protected]>
What changes were proposed in this pull request?
The proposal is to update the classifyException function so that it can return either
AnalysisException
orSparkRuntimeException
. This is achieved by adding a new parameter,isRuntime
, and modifying the return type to beThrowable with SparkThrowable
for 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.