Skip to content
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

Use u8 for Decimal Precision and Scale #2496

Closed
tustvold opened this issue Aug 18, 2022 · 4 comments · Fixed by #2532
Closed

Use u8 for Decimal Precision and Scale #2496

tustvold opened this issue Aug 18, 2022 · 4 comments · Fixed by #2532
Assignees
Labels
arrow Changes to the arrow crate enhancement Any new improvement worthy of a entry in the changelog

Comments

@tustvold
Copy link
Contributor

Is your feature request related to a problem or challenge? Please describe what you are trying to do.

The maximum precision and scale for decimal types is 76, and yet we consume an entire usize to store this information. This is most pronounced on BasicDecimal where the precision and scale take up more memory than the actual value data 😱

Describe the solution you'd like

I would like to propose using u8 for these instead of usize

Describe alternatives you've considered

Additional context

Thoughts @liukun4515

@tustvold tustvold added the enhancement Any new improvement worthy of a entry in the changelog label Aug 18, 2022
@liukun4515
Copy link
Contributor

It's reasonable for me.
I think the data type of Decimal128(usize, usize), should be changed too

@psvri
Copy link
Contributor

psvri commented Aug 19, 2022

Hello,

I will pick this up if no one has started working on it.

@liukun4515
Copy link
Contributor

It's reasonable for me. I think the data type of Decimal128(usize, usize), should be changed too

Do you have some comments about the data type of the decimal128?
FYI @psvri @tustvold

@psvri
Copy link
Contributor

psvri commented Aug 20, 2022

I have changed datatype to Decimal128(u8, u8) and Decimal256(u8, u8) .

@alamb alamb added the arrow Changes to the arrow crate label Sep 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrow Changes to the arrow crate enhancement Any new improvement worthy of a entry in the changelog
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants