Skip to content

Conversation

@ivanjevtic-db
Copy link
Contributor

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.

@github-actions github-actions bot added the SQL label Oct 4, 2024
messageParameters: Map[String, String],
description: String): AnalysisException = {
new AnalysisException(
errorClass = "...",
Copy link
Member

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.

Copy link
Contributor Author

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?

messageParameters: Map[String, String],
description: String): AnalysisException = {
description: String,
isRuntime: Boolean): Throwable with SparkThrowable = {
Copy link
Member

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?

Copy link
Contributor Author

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).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sgtm

@ivanjevtic-db
Copy link
Contributor Author

The tests are now passing. Could you make a review @MaxGekk? Thanks.

* @param isRuntime Whether the exception is a runtime exception or not.
* @return `SparkThrowable + Throwable` or its sub-class.
*/
def classifyException(
Copy link
Member

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.

@MaxGekk
Copy link
Member

MaxGekk commented Oct 7, 2024

+1, LGTM. Merging to master.
Thank you, @ivanjevtic-db.

@MaxGekk MaxGekk closed this in 5132ab1 Oct 7, 2024
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