liukun4515 opened a new issue #927:
URL: https://github.com/apache/arrow-rs/issues/927


   **Describe the bug**
   Use the decimal builder to append decimal value, the code doesn't check the 
value of the `i128` with the precision and scale.
   
   For example, in the Test
   ```
   #[test]
       fn test_decimal_array_value_as_string() {
           let mut decimal_builder = DecimalBuilder::new(7, 5, 3);
           for value in [123450, -123450, 100, -100, 10, -10, 0] {
               decimal_builder.append_value(value).unwrap();
           }
           let arr = decimal_builder.finish();
   
           assert_eq!("123.450", arr.value_as_string(0));
           assert_eq!("-123.450", arr.value_as_string(1));
           assert_eq!("0.100", arr.value_as_string(2));
           assert_eq!("-0.100", arr.value_as_string(3));
           assert_eq!("0.010", arr.value_as_string(4));
           assert_eq!("-0.010", arr.value_as_string(5));
           assert_eq!("0.000", arr.value_as_string(6));
       }
   ```
   The `123450` is not compatible for the decimal(5,3).
   
   **To Reproduce**
   Steps to reproduce the behavior:
   
   **Expected behavior**
   A clear and concise description of what you expected to happen.
   
   We need add the checking logic to verify the appended value with precision 
and scale. 
   
   **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