-
Notifications
You must be signed in to change notification settings - Fork 847
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement support for Decimal with 256 bits of precision. #131
Comments
It's been over a year ...... |
Thanks for the nudge @alexlee85 -- I left some ideas on how to proceed. Let's see if we can find someone to help! |
I'm looking around at Decimal support in C++. Roughly I think we have some subtasks:
In C++ implementations, there are Decimal128 and Decimal256 classes. They are used in Decimal128Builder and Decimal256Builder APIs. So users can construct 128/256-decimal values during building the arrays. Although Decimal128Array and Decimal256Array don't provide APIs to get Decimal128 and Decimal256 values directly now. Basically in Decimal128 and Decimal256 classes, decimal value is represented in an uint64_t array. I think we can follow this up to have Decimal with 256 bits. In current Rust implementations, we use i128 in DecimalBuilder and DecimalArray APIs. To maintain consistency on Decimal related APIs, we need to change from i128 to Decimal128 in these APIs. I think we may also need some works in IPC and Parquet for the new Decimal256 support. |
I plan to tackle these issues one by one. |
What do you think about using generics (so the APIs are compatible). So for functions that take fn decimal_thing(val: i128) {
...
} Could be something like fn decimal_thing(val: impl Into<i128>) {
} This may be a silly idea that won't make sense as you start implementation 🤔 |
I think you mean to make Decimal128 to be compatible with i128 so it won't break existing user code? It makes sense to me. |
@viirya has completed this work I believe, including enabling integration tests 🎉 with other arrow implementations |
Note: migrated from original JIRA: https://issues.apache.org/jira/browse/ARROW-10602
The specification now supports it and there are basic implementations in C++/Java
The basic idea would be to:
i128
andi256
backingThe text was updated successfully, but these errors were encountered: