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-41582][CORE][SQL] Reuse INVALID_TYPED_LITERAL instead of _LEGACY_ERROR_TEMP_0022 #39122

Closed
wants to merge 4 commits into from

Conversation

LuciferYang
Copy link
Contributor

@LuciferYang LuciferYang commented Dec 19, 2022

What changes were proposed in this pull request?

This pr aims reuse INVALID_TYPED_LITERAL instead of _LEGACY_ERROR_TEMP_0022.

Why are the changes needed?

Proper names of error classes to improve user experience with Spark SQL.

Does this PR introduce any user-facing change?

Yes, the PR changes user-facing error message.

How was this patch tested?

Pass GitHub Actions

Literal(Hex.decodeHex(padding + value))
} catch {
case e: DecoderException =>
val ex = QueryParsingErrors.cannotParseValueTypeError("X", value, ctx)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Pass X?HEX or HEXBINARY?

Copy link
Member

Choose a reason for hiding this comment

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

X is ok

Seq("DATE", "TIMESTAMP_NTZ", "TIMESTAMP_LTZ", "TIMESTAMP", "INTERVAL", "X"),
ctx)
}
} catch {
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 only line 2439 will throw IllegalArgumentException, let's test

Literal(Hex.decodeHex(padding + value))
} catch {
case e: DecoderException =>
val ex = QueryParsingErrors.cannotParseValueTypeError("X", value, ctx)
Copy link
Member

Choose a reason for hiding this comment

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

X is ok

@MaxGekk
Copy link
Member

MaxGekk commented Dec 20, 2022

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

@MaxGekk MaxGekk closed this in 9840a03 Dec 20, 2022
@LuciferYang
Copy link
Contributor Author

Thanks @MaxGekk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants