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-50644][FOLLOWUP][SQL] Fix scalar cast in the shredded reader. #49293

Closed
wants to merge 1 commit into from

Conversation

chenhao-db
Copy link
Contributor

@chenhao-db chenhao-db commented Dec 25, 2024

What changes were proposed in this pull request?

We mostly use the Cast expression to implement the cast, but we need some custom logic for certain type combinations. We already have special handling for long/decimal -> timestamp in VariantGet.cast, so we should do the same thing in ScalarCastHelper to ensure consistency. ScalarCastHelper also needs special handling for decimal -> string to strip any trailing zeros.

Why are the changes needed?

To ensure that cast on shredded variant has the same semantics as cast on unshredded variant.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

Unit tests. They would fail without the change.

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

No.

@github-actions github-actions bot added the SQL label Dec 25, 2024
@chenhao-db
Copy link
Contributor Author

@cloud-fan could you help review? Thanks a lot!

@cloud-fan
Copy link
Contributor

thanks, merging to master!

@cloud-fan cloud-fan closed this in 7a4114c Dec 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants