Skip to content
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-45573][SQL] Assign name to the error _LEGACY_ERROR_TEMP_2153 #43414

Closed
wants to merge 3 commits into from

Conversation

dengziming
Copy link
Member

@dengziming dengziming commented Oct 18, 2023

What changes were proposed in this pull request?

Assign the name UNEXPECTED_SERIALIZER_FOR_CLASS to the legacy error class _LEGACY_ERROR_TEMP_2153.

Why are the changes needed?

To assign proper name as a part of activity in SPARK-37935.

Does this PR introduce any user-facing change?

Yes, the error message will include the error class name

How was this patch tested?

Add a unit test to produce the error from user code.

Was this patch authored or co-authored using generative AI tooling?

No.

@@ -3015,6 +3015,12 @@
],
"sqlState" : "4274K"
},
"UNEXPECTED_SERIALIZER_FOR_CLASS" : {
"message" : [
"Class <clsName> has unexpected serializer: <objSerializer>."
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"Class <clsName> has unexpected serializer: <objSerializer>."
"The class <className> has an unexpected expression serializer. Expects \"STRUCT\" or \"IF\" which returns \"STRUCT\" but found <expr>."

@@ -1362,7 +1362,7 @@ private[sql] object QueryExecutionErrors extends QueryErrorsBase with ExecutionE
def classHasUnexpectedSerializerError(
clsName: String, objSerializer: Expression): SparkRuntimeException = {
new SparkRuntimeException(
errorClass = "_LEGACY_ERROR_TEMP_2153",
errorClass = "UNEXPECTED_SERIALIZER_FOR_CLASS",
messageParameters = Map(
"clsName" -> clsName,
"objSerializer" -> objSerializer.toString()))
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 quote the expression by toSQLExpr

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.

@dengziming
Copy link
Member Author

Thank you @MaxGekk for your review, the CI attempt-2 seems fine and some failures of attempt-1 is unrelated.

@MaxGekk
Copy link
Member

MaxGekk commented Oct 19, 2023

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

@MaxGekk MaxGekk closed this in 7057952 Oct 19, 2023
Copy link
Contributor

@beliefer beliefer left a comment

Choose a reason for hiding this comment

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

LGTM later.

@MaxGekk
Copy link
Member

MaxGekk commented Oct 19, 2023

@dengziming Please, correct the JIRA to vhttps://issues.apache.org/jira/browse/SPARK-45573

@dengziming dengziming changed the title [SPARK-45569][SQL] Assign name to the error _LEGACY_ERROR_TEMP_2153 [SPARK-45573][SQL] Assign name to the error _LEGACY_ERROR_TEMP_2153 Oct 19, 2023
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