Blizzara opened a new issue, #7069:
URL: https://github.com/apache/arrow-rs/issues/7069

   **Describe the bug**
   
   See practical examples in https://github.com/apache/datafusion/issues/14450.
   Somehow a regression caused by 
https://github.com/apache/arrow-rs/issues/6833.
   
   <!--
   A clear and concise description of what the bug is.
   -->
   
   **To Reproduce**
   <!--
   Steps to reproduce the behavior:
   -->
   
   Adding this into `arrow-cast/src/cast/mod.rs`:
   ```
       #[test]
       fn test_decimal_to_decimal() {
           let array = vec![Some(520)];
           let array = create_decimal_array(array, 4, 2).unwrap();
           let input_type = DataType::Decimal128(4, 2);
           let output_type = DataType::Decimal128(3, 2);
           assert!(can_cast_types(&input_type, &output_type));
   
           let options = CastOptions {
               safe: false,
               ..Default::default()
           };
           let result = cast_with_options(&array, &output_type, &options);
           
assert_eq!(result.unwrap().as_primitive::<Decimal128Type>().value(0), 520);
       }
   ```
   
   passes on 84dba34e6754b34baf19bd694506278cdc176a2e, but fails on 
https://github.com/apache/arrow-rs/commit/eb7ab83aab6b54897b00da1eb739c863d61445a2
 with 
   ```
   assertion `left == right` failed
     left: 521
    right: 520
   ```
   
   Somehow something in the code adds an extra `1` to the value?
   
   **Expected behavior**
   <!--
   A clear and concise description of what you expected to happen.
   -->
   
   Test passes
   
   **Additional context**
   
   Fyi @himadripal @andygrove @findepi @viirya @tustvold as you were involved 
in that earlier change. I tried to look at it but don't understand how it'd go 
wrong myself, maybe you know?


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

Reply via email to