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

feat: Support dyn_compare_scalar for Decimal256 #4084

Merged
merged 2 commits into from
Apr 14, 2023
Merged

feat: Support dyn_compare_scalar for Decimal256 #4084

merged 2 commits into from
Apr 14, 2023

Conversation

izveigor
Copy link
Contributor

Which issue does this PR close?

Closes #4083

Rationale for this change

What changes are included in this PR?

Are there any user-facing changes?

Yes

@github-actions github-actions bot added the arrow Changes to the arrow crate label Apr 13, 2023
@tustvold
Copy link
Contributor

tustvold commented Apr 13, 2023

Could we add some tests showing what happens with values like i256::MAX, I think this will return an error which is fine. Longer term I have plans to fix this #2837 and #3999, but we should make sure that we don't silently truncate scalars

@izveigor
Copy link
Contributor Author

Hi @tustvold! I understand the problem regarding i256 arithmetic. My decision works with the numbers below i128::MAX, so I think if that problem would be solved we be able to make the complete solution. I added the corresponding test with expected behavior.


#[test]
fn test_decimal256_scalar_i256() {
let a = Decimal256Array::from_iter_values(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let a = Decimal256Array::from_iter_values(
// TODO: Support i256 scalars (#2837)
let a = Decimal256Array::from_iter_values(

@tustvold tustvold merged commit 3582c55 into apache:master Apr 14, 2023
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support dyn_compare_scalar for Decimal256
2 participants