chenhao-db opened a new pull request, #49293: URL: https://github.com/apache/spark/pull/49293
### 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 `Variant.cast`, so we should do the same thing in the `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. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org