Skip to content

Conversation

@itholic
Copy link
Contributor

@itholic itholic commented Oct 9, 2022

What changes were proposed in this pull request?

This the final PR that proposes to migrate the execution errors onto temporary error classes with the prefix _LEGACY_ERROR_TEMP

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 -Phive-thriftserver "hive-thriftserver/testOnly org.apache.spark.sql.hive.thriftserver.ThriftServerQueryTestSuite"

@itholic itholic marked this pull request as ready for review October 18, 2022 13:47
@itholic
Copy link
Contributor Author

itholic commented Oct 18, 2022

This is ready for review, @MaxGekk FYI

},
"_LEGACY_ERROR_TEMP_2277" : {
"message" : [
"Number of dynamic partitions created is <numWrittenParts>\", which is more than <maxDynamicPartitions>\". To solve this try to set <maxDynamicPartitionsKey> to at least <numWrittenParts>."
Copy link
Member

Choose a reason for hiding this comment

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

Could you remove " around \", which is more than <maxDynamicPartitions>\"

},
"_LEGACY_ERROR_TEMP_2278" : {
"message" : [
"The input $valueType '<input>' does not match the given number format: '<format>'"
Copy link
Member

Choose a reason for hiding this comment

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

$valueType -> <valueType>

@itholic
Copy link
Contributor Author

itholic commented Oct 19, 2022

Thanks for the review, @MaxGekk !

Just adjusted the comments

@MaxGekk
Copy link
Member

MaxGekk commented Oct 20, 2022

@itholic Could you re-trigger GAs and remove [WIP] if this PR is ready.

@itholic itholic changed the title [WIP][SPARK-40663][SQL](Final) Migrate execution errors onto error classes [SPARK-40663][SQL](Final) Migrate execution errors onto error classes Oct 20, 2022
@itholic
Copy link
Contributor Author

itholic commented Oct 20, 2022

Thanks! Just re-triggered the GA and fix the title!

Copy link
Member

@MaxGekk MaxGekk left a comment

Choose a reason for hiding this comment

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

Waiting for CI.

@MaxGekk
Copy link
Member

MaxGekk commented Oct 21, 2022

@itholic Please, fix the test failure:

[info] - postgreSQL/numeric.sql *** FAILED *** (49 seconds, 862 milliseconds)
[info]   postgreSQL/numeric.sql
[info]   Expected "...g.apache.spark.Spark[IllegalArgumentException
[info]   {
[info]     "errorClass" : "_LEGACY_ERROR_TEMP_2278",
[info]     "messageParameters" : {
[info]       "format" : "99G999G999",
[info]       "input" : "-34,338,492]"
[info]     }
[info]   }", but got "...g.apache.spark.Spark[Exception
[info]   {
[info]     "errorClass" : "INTERNAL_ERROR",
[info]     "messageParameters" : {
[info]       "message" : "Undefined error message parameter for error class: '_LEGACY_ERROR_TEMP_2278'. Parameters: Map(input -> -34,338,492, format -> 99G999G999)]"

@MaxGekk
Copy link
Member

MaxGekk commented Oct 24, 2022

ping @itholic

Comment on lines 1128 to 1129
checkExceptionInExpression[SparkException](
toNumberExpr, "[INTERNAL_ERROR] Undefined error message parameter")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry for late responding, @MaxGekk .

I've been thinking about if there is better way to test expression with error class here.

Please let me know if there is better way to test this ? 🙏

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Seems like I should also fix the test & generated golden files.

Let me fix soon!

Comment on lines +2621 to +2622
"input" -> input,
"format" -> format))
Copy link
Member

Choose a reason for hiding this comment

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

Missed valueType, see the format of the error class _LEGACY_ERROR_TEMP_2278.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops, I missed it... Thanks for figuring out!

@itholic
Copy link
Contributor Author

itholic commented Oct 25, 2022

Fixed & re-gened the golden files!

@MaxGekk
Copy link
Member

MaxGekk commented Oct 26, 2022

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

@MaxGekk MaxGekk closed this in bef9797 Oct 26, 2022
SandishKumarHN pushed a commit to SandishKumarHN/spark that referenced this pull request Dec 12, 2022
### What changes were proposed in this pull request?

This the final PR that proposes to migrate the execution errors onto temporary error classes with the prefix `_LEGACY_ERROR_TEMP`

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 -Phive-thriftserver "hive-thriftserver/testOnly org.apache.spark.sql.hive.thriftserver.ThriftServerQueryTestSuite"
```

Closes apache#38177 from itholic/SPARK-40540-2276-2300.

Authored-by: itholic <[email protected]>
Signed-off-by: Max Gekk <[email protected]>
@itholic itholic deleted the SPARK-40540-2276-2300 branch April 22, 2023 05:46
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.

2 participants