-
Notifications
You must be signed in to change notification settings - Fork 796
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
Add creator from Iterator of i128
to get the decimalarray
#1009
Comments
Please assign this to me. |
Hi @liukun4515 -- thanks for the ticket; I added some more description to this ticket and some ideas which hopefully would help. |
Thank you. |
BTW the more I tried playing around with this, the nicer I think it would be to be able to do something like let array : DecimalArray = vec![1,2,3].into()
.with_precision(10)
.with_scale(5); |
Yes, we can follow the usage of other primitive arrays to implement the necessary function first. |
i128
to get the decimalarrayi128
to get the decimalarray
i took a crack at this in #1223 |
Is your feature request related to a problem or challenge? Please describe what you are trying to do.
From this comments in the datafusion.
apache/datafusion#1394 (comment)
apache/datafusion#1394
Creating an
DecimalArray
from an array ofOption<i128>
usingDecimalBuilder
is quite painful (see apache/datafusion#1394)Ideally it would be possible to do something similar to the PrimitiveArrays, such as https://docs.rs/arrow/6.3.0/arrow/array/type.UInt32Array.html#example-using-collect
Describe the solution you'd like
However, since
DecimalArray
hasprecision
andscale
in itsDataType
, we need some way to specify that.One thought, would be a function such as (for
precision
20 andscale
5):An alternate might be something more like:
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered: