This repository has been archived by the owner on Feb 18, 2024. It is now read-only.
[Requires Arrow spec] Added support for decimal 32 and 64 #896
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is being worked over the arrow mailing list and apache/arrow#8578 . It is marked as draft until it is officially supported / abandoned if abandoned by the official implementation.
Note that this PR is backward incompatible:
DataType::Decimal(usize,usize)
needs a new argument to differentiate between different physical types backing the (logical) decimal type.Before:
After:
where
DecimalType
is an enum with 3 different variants (Int32
,Int64
,Int128
).Because the other variants have an existing physical representation (
i32
andi64
respectively), most of this crate works out of the box (growable
,filter
,take
,comparison
(includingsimd
), etc.). There is still some work for the aggregations (decimal is not yet supported),cast
, and arithmetics (arithmetics for decimals work a bit different due to the precision/scale constraints).We also need to think about how to support reading from and writing to parquet (i.e. we may be able to read a parquet decimal i32 to a decimal i32 instead of i128 as we do it now).