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

   **Describe the bug**
   
   Overflow happened on Decimal256Array division
   
   **To Reproduce**
   
   add test in 
https://github.com/apache/arrow-rs/blob/main/arrow-arith/src/numeric.rs
   
   ```
       #[test]
       fn test_decimal256_div() {
           let a = i256::from_i128(60096743305738933273387748827369321010i128);
           let b = i256::from_i128(60096763826458053191384497987259478584i128);
           let a = Decimal256Array::from_iter_values(vec![a])
               .with_precision_and_scale(38, 37)
               .unwrap();
           let b = Decimal256Array::from_iter_values(vec![b])
               .with_precision_and_scale(38, 37)
               .unwrap();
           let result = div(&a, &b).unwrap();
       }
   ```
   
   got error:
   
   ```
   called `Result::unwrap()` on an `Err` value: ArithmeticOverflow("Overflow 
happened on: 60096743305738933273387748827369321010 * 
100000000000000000000000000000000000000000")
   thread 'numeric::tests::test_decimal256_div' panicked at 
arrow-arith/src/numeric.rs:1167:34:
   ```
   
   **Expected behavior**
   <!--
   A clear and concise description of what you expected to happen.
   -->
   
   **Additional context**
   <!--
   Add any other context about the problem here.
   -->


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