Skip to content

Conversation

@itholic
Copy link
Contributor

@itholic itholic commented Oct 5, 2022

What changes were proposed in this pull request?

This PR proposes to migrate 26 execution errors onto temporary error classes with the prefix _LEGACY_ERROR_TEMP_2000 to _LEGACY_ERROR_TEMP_2024.

The error classes are prefixed with _LEGACY_ERROR_TEMP_ indicates the dev-facing error messages, and won't be exposed to end users.

Why are the changes needed?

To speed-up the error class migration.

The migration on temporary error classes allow us to analyze the errors, so we can detect the most popular error classes.

Does this PR introduce any user-facing change?

No

How was this patch tested?

$ build/sbt "sql/testOnly org.apache.spark.sql.SQLQueryTestSuite"
$ build/sbt "test:testOnly *SQLQuerySuite"
$ build/sbt -Phadoop-3 -Phive-thriftserver catalyst/test hive-thriftserver/test

@itholic itholic changed the title [WIP][SPARK-40540][SQL] Migrate execution errors onto error classes: _LEGACY_ERROR_TEMP_2000-2025 [WIP][SPARK-40663][SQL] Migrate execution errors onto error classes: _LEGACY_ERROR_TEMP_2000-2025 Oct 5, 2022
@itholic itholic changed the title [WIP][SPARK-40663][SQL] Migrate execution errors onto error classes: _LEGACY_ERROR_TEMP_2000-2025 [SPARK-40663][SQL] Migrate execution errors onto error classes: _LEGACY_ERROR_TEMP_2000-2025 Oct 5, 2022
@itholic itholic marked this pull request as ready for review October 5, 2022 07:37
@itholic
Copy link
Contributor Author

itholic commented Oct 5, 2022

cc @MaxGekk could you take a look when you find some time.
This is the first part of migrating the QueryExecutionErrors onto error classes.

},
"_LEGACY_ERROR_TEMP_2001" : {
"message" : [
"<message> If necessary set <ansiConfig> to false to bypass this error"
Copy link
Member

Choose a reason for hiding this comment

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

Missed a point after <message>?

Just in case, _LEGACY_ERROR_TEMP_2001 and _LEGACY_ERROR_TEMP_2000 are the same. Can you merge them, and reuse existing one?

Copy link
Member

Choose a reason for hiding this comment

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

I am going to merge this PR since the tests passed. Please, address this minor comment in your next PR #38108.

Copy link
Contributor Author

@itholic itholic Oct 5, 2022

Choose a reason for hiding this comment

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

Got it!
Let me address them in my follow-ups. Thanks! :-)

@MaxGekk
Copy link
Member

MaxGekk commented Oct 5, 2022

+1, LGTM. Merging to master.
Thank you, @itholic.

def ansiIllegalArgumentError(e: Exception): SparkIllegalArgumentException = {
new SparkIllegalArgumentException(
errorClass = "_LEGACY_ERROR_TEMP_2002",
messageParameters = Map("message" -> e.getMessage))
Copy link
Contributor

Choose a reason for hiding this comment

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

found a regression here. The previous error message has If necessary set ${SQLConf.ANSI_ENABLED.key} to false ... but it's gone now.

@itholic can you create a followup PR to fix it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

FYI: follow-up here #38450

struct<>
-- !query output
java.lang.IllegalArgumentException
Illegal input for day of week: xx. If necessary set spark.sql.ansi.enabled to false to bypass this error.
Copy link
Contributor

Choose a reason for hiding this comment

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

This test shows the regression I mentioned above.

def invalidUrlError(url: UTF8String, e: URISyntaxException): Throwable = {
new IllegalArgumentException(s"Find an invalid url string ${url.toString}. " +
s"If necessary set ${SQLConf.ANSI_ENABLED.key} to false to bypass this error.", e)
def invalidUrlError(url: UTF8String, e: URISyntaxException): SparkIllegalArgumentException = {
Copy link
Member

Choose a reason for hiding this comment

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

@itholic Could you open a follow up and add a constructor to SparkIllegalArgumentException which accepts cause too, please.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, let me create a follow-up soon.

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