Skip to content

Conversation

@MaxGekk
Copy link
Member

@MaxGekk MaxGekk commented Oct 31, 2022

What changes were proposed in this pull request?

In the PR, I propose to migrate failAnalysis() errors without a context onto temporary error classes with the prefix _LEGACY_ERROR_TEMP_24xx. The error message will not include the error classes, so, in this way we will preserve the existing behaviour.

Why are the changes needed?

The migration on temporary error classes allows to gather statistics about errors and detect most popular error classes. After that we could prioritise the work on migration.

The new error class name prefix _LEGACY_ERROR_TEMP_ proposed here kind of marks the error as developer-facing, not user-facing. Developers can still get the error class programmatically via the SparkThrowable interface, so that they can build error infra with it. End users won't see the error class in the message. This allows us to do the error migration very quickly, and we can refine the error classes and mark them as user-facing later (naming them properly, adding tests, etc.).

Does this PR introduce any user-facing change?

No. The error messages should be almost the same by default.

How was this patch tested?

By running the affected test suites:

$ PYSPARK_PYTHON=python3 build/sbt "sql/testOnly org.apache.spark.sql.SQLQueryTestSuite"

@MaxGekk MaxGekk changed the title [WIP][SPARK-40978][SQL] Migrate failAnalysis() onto error classes [WIP][SPARK-40978][SQL] Migrate failAnalysis() w/o a context onto error classes Oct 31, 2022
@MaxGekk MaxGekk changed the title [WIP][SPARK-40978][SQL] Migrate failAnalysis() w/o a context onto error classes [SPARK-40978][SQL] Migrate failAnalysis() w/o a context onto error classes Nov 1, 2022
@MaxGekk MaxGekk marked this pull request as ready for review November 1, 2022 07:39
@MaxGekk MaxGekk requested a review from cloud-fan November 1, 2022 12:16
@MaxGekk
Copy link
Member Author

MaxGekk commented Nov 1, 2022

@cloud-fan @srielau @itholic @LuciferYang @panbingkun Could you review this PR, please.

Copy link
Contributor

@LuciferYang LuciferYang left a comment

Choose a reason for hiding this comment

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

+1, LGTM if test passed

@MaxGekk
Copy link
Member Author

MaxGekk commented Nov 1, 2022

Merging to master. Thank you, @LuciferYang @cloud-fan for review.

@MaxGekk MaxGekk closed this in 8aaa6aa Nov 1, 2022
SandishKumarHN pushed a commit to SandishKumarHN/spark that referenced this pull request Dec 12, 2022
…classes

### What changes were proposed in this pull request?
In the PR, I propose to migrate `failAnalysis()` errors without a context onto temporary error classes with the prefix `_LEGACY_ERROR_TEMP_24xx`. The error message will not include the error classes, so, in this way we will preserve the existing behaviour.

### Why are the changes needed?
The migration on temporary error classes allows to gather statistics about errors and detect most popular error classes. After that we could prioritise the work on migration.

The new error class name prefix `_LEGACY_ERROR_TEMP_` proposed here kind of marks the error as developer-facing, not user-facing. Developers can still get the error class programmatically via the `SparkThrowable` interface, so that they can build error infra with it. End users won't see the error class in the message. This allows us to do the error migration very quickly, and we can refine the error classes and mark them as user-facing later (naming them properly, adding tests, etc.).

### Does this PR introduce _any_ user-facing change?
No. The error messages should be almost the same by default.

### How was this patch tested?
By running the affected test suites:
```
$ PYSPARK_PYTHON=python3 build/sbt "sql/testOnly org.apache.spark.sql.SQLQueryTestSuite"
```

Closes apache#38454 from MaxGekk/legacy-error-class-failAnalysis-2.

Authored-by: Max Gekk <[email protected]>
Signed-off-by: Max Gekk <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants