glaredb
glaredb copied to clipboard
Implement `DecimalType256` to support 256 bit precision decimals
Summary
We want to use a 256 bit integer to store the decimal. Need to use https://docs.rs/ethnum/latest/ethnum/struct.I256.html
Specifications
Implement the required num_traits for i256 and the rest should be as easy as creating:
impl DecimalType for DecimalType256 {
type MantissaType = i256;
const MAX_SCALE: u8 = 76;
}
/// Compatible with arrow's `Decimal256`.
pub type Decimal256 = Decimal<DecimalType256>;
Rationale
This way we'll be able to support 256 bit numerics (not highly urgent but good to have).
Impact
Tasks
Do we have this?