wangyum opened a new pull request, #43812:
URL: https://github.com/apache/spark/pull/43812

   ### What changes were proposed in this pull request?
   
   The common type of decimal(x, 0) and string is double. But the common type 
of int/bigint and string are int/bigint.
   
   This PR updates `PromoteStrings` make the common type of decimal(x, 0) and 
string is decimal(x, 0).
   
   ### Why are the changes needed?
   
   1. Make decimal(x, 0) behave the same as int/bigint in `PromoteStrings`.
   2. Reduce one cast in binary comparison so we may use bucket read. For 
example: `cast(stringCol as double) = cast(decimalCol as double)` vs 
`cast(stringCol as decimal(x, 0)) = decimalCol`.
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes. The result type of decimal(x, 0) and string is decimal(x, 0) in binary 
comparison.
   
   
   ### How was this patch tested?
   
   Unit test.
   
   
   ### 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to