manuzhang opened a new issue, #2914:
URL: https://github.com/apache/datafusion-comet/issues/2914

   ### Describe the bug
   
   When implementing [fix: array to array 
cast](https://github.com/apache/datafusion-comet/pull/2897), the test of 
casting `ArrayType(DecimalType(10,2))` to `ArrayType(ShortType)` failed with 
following error, where comet truncates `-96833550.07` to `-96833550.7`.
   
   ``` 
   "...The value -96833550.[]7BD of the type "DEC..." did not equal "...The 
value -96833550.[0]7BD of the type "DEC..." (CometCastSuite.scala:1328)
   ```
   
   It looks to be related to `cast_decimal_to_int16_down` 
   
   
https://github.com/apache/datafusion-comet/blob/5ec12d4024e78faa97834f88ab606ecd3d0db5fb/native/spark-expr/src/conversion_funcs/cast.rs#L674-L696
   
   It can be proven by printing the original and truncated values.
   
   ```
   casting value: -9683355007, truncated: -96833550, decimal: 7, is_overflow: 
false
   ```
   
   ### Steps to reproduce
   
   _No response_
   
   ### Expected behavior
   
   _No response_
   
   ### Additional context
   
   _No response_


-- 
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