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

Handle overflow precision when casting from integer to decimal #3995

Closed
viirya opened this issue Apr 1, 2023 · 1 comment · Fixed by #3996
Closed

Handle overflow precision when casting from integer to decimal #3995

viirya opened this issue Apr 1, 2023 · 1 comment · Fixed by #3996
Labels
arrow Changes to the arrow crate bug

Comments

@viirya
Copy link
Member

viirya commented Apr 1, 2023

Describe the bug

Although cast kernel uses CastOptions when casting from integer to decimal, its behavior on overflow-checking is incomplete.

For now, it'd check division or multiplication if overflowing on underlying decimal native types (i.e., i128 and i256). But it doesn't check if input integer is overflowing on decimal precision. This causes weird behavior when downstream project (e.g., DataFusion) uses cast kernel to cast integer to decimal.

To Reproduce

Expected behavior

Additional context

@tustvold
Copy link
Contributor

tustvold commented Apr 7, 2023

label_issue.py automatically added labels {'arrow'} from #3996

@tustvold tustvold added the arrow Changes to the arrow crate label Apr 7, 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 bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants