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

   **Is your feature request related to a problem or challenge? Please describe 
what you are trying to do.**
   Why I prefer using `const_generic` on Decimal?
   - Decimal128 and Decimal256 are different datatype. However all of their 
fields have same data type except the length of the value buffer `[u8; 16] or 
[u8; 32]`.  This is the situation which `const_generic` is very suitable. 
   - In the Rust standard library, there is a similar type using 
`const_generic`: the Array type: 
https://doc.rust-lang.org/std/primitive.array.html
   - Remove some repeated code.
   - More constant evaluation
   -  Easy to extend: We might add more Decimal type in the future. For example 
in arrow2, there is a PR to add Decimal 32 and 64: 
https://github.com/jorgecarleitao/arrow2/pull/896
   
   Will the rewriting leads to many API changes?
   Yes, But for users, the answer is no. Because this is just an internal 
refactor.
   
   **Describe alternatives you've considered**
   We could not do this.
   
   **Additional context**
   Related to #2362 and #2274.
   


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