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

   **Is your feature request related to a problem or challenge? Please describe 
what you are trying to do.**
   
   When arrow construct a decimal array, we need to verify the data of decimal 
with the precision.
   
   From current implemention 
https://github.com/apache/arrow-rs/blob/d87f6a456330f0eff00541b38017e8a982bf8033/arrow/src/datatypes/datatype.rs#L456
 and 
https://github.com/apache/arrow-rs/blob/d87f6a456330f0eff00541b38017e8a982bf8033/arrow/src/datatypes/datatype.rs#L485
   
   We compare the decimal using i128 or string, it may be inefficient.
   
   optimize the validation using the byte array instead of i128 or string.
   
   
   **Describe the solution you'd like**
   <!--
   A clear and concise description of what you want to happen.
   -->
   
   For exmaple, precision 3, The max value is i128.to_le_byte(999), and the min 
value if i128.to_le_byte(-999).
   Comparing the decimal128(value,precision,scale) just need to compare the 
value ([u8;16]) with the min and max.
   
   **Describe alternatives you've considered**
   <!--
   A clear and concise description of any alternative solutions or features 
you've considered.
   -->
   
   **Additional context**
   <!--
   Add any other context or screenshots about the feature request 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