-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed as not planned
Labels
arrowChanges to the arrow crateChanges to the arrow crate
Description
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 whichconst_genericis very suitable. - In the Rust standard library, there is a famous type using
const_generic: the Array type: https://doc.rust-lang.org/std/primitive.array.htmlDecimalis very similar toArray - 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: [Requires Arrow spec] Added support for decimal 32 and 64 jorgecarleitao/arrow2#896
Will the rewriting leads to many API changes?
Yes, But for users, the answer is no. Because this is just an internal refactor.
Checked List
- BasicDecimal (Rewrite
DecimalandDecimalArrayusingconst_generic#2383 ) - BasicDecimalArray (Rewrite
DecimalandDecimalArrayusingconst_generic#2383 ) - Rewriting Decimal Builders using
const_generic. #2390
Describe alternatives you've considered
We could not do this.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
arrowChanges to the arrow crateChanges to the arrow crate