-
Notifications
You must be signed in to change notification settings - Fork 866
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
[Regression in 54.0.0]. Decimal cast to smaller precision gives invalid (off-by-one) result in some cases #7069
Comments
@Blizzara I'll take a look, as part of the previous PR, I added validation after creation like it was for float, wondering if validation message would add that extra 1? |
Actually @himadripal I think the issue is this line: eb7ab83#diff-07a573af92ff5330f77407c559e89e06b02ef8c466a394ca86a710023f000593R170, the |
@Blizzara it make sense, when input scale = output scale it always goes to |
@Blizzara Please check. |
I double checked and it seems like the issue was introduced by this commit (which was released as part of 54.0.0):
@Blizzara has requested a release with this fix Thus I have updated the schedule and will prepare to make a release later this weel: |
|
Describe the bug
See practical examples in apache/datafusion#14450.
Somehow a regression caused by #6833.
To Reproduce
Adding this into
arrow-cast/src/cast/mod.rs
:passes on 84dba34, but fails on eb7ab83 with
Somehow something in the code adds an extra
1
to the value?Expected behavior
Test passes
Additional context
Fyi @himadripal @andygrove @findepi @viirya @tustvold as you were involved in that earlier change. I tried to look at it but don't understand how it'd go wrong myself, maybe you know?
The text was updated successfully, but these errors were encountered: