-
Notifications
You must be signed in to change notification settings - Fork 919
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
[FEA] Mixed precision Decimal math support in cudf Python #7680
Comments
…pe (#7732) Closes #7680 Authors: - https://github.com/brandon-b-miller - Michael Wang (https://github.com/isVoid) Approvers: - Keith Kraus (https://github.com/kkraus14) URL: #7732
Reopening this as there's a piece of the ask here that isn't implemented yet: |
@randerzander PR #7859 should close the second part of this - however I think we decided we can't do decimal<->float as we'd need to do some implicit rounding for the user there. That said since integers are exact numbers I went ahead and added that. |
@brandon-b-miller I understand the concern about users not realizing rounding happens in an implicit cast, but it would be nice to allow configurable implicit cast behavior. For what it's worth, Spark automatically converts (somewhat surprisingly) to a Double:
|
@randerzander thank you for that example. As long as there's some authoritative source for what the rules should be, I'd be comfortable adopting that standard and allowing the behavior. Let me dig into spark a bit and figure out where it derives its casting rules and then follow up here. |
So ideally here we'd like to follow spark's rules because they seem fairly robust and also, because we try and avoid inventing casting rules. Here are those rules (github link)
This basically means that when performing a binary op between a decimal column and an integer column, the integer column is cast to decimal with precision The problem is we only support precision 18, and this number is This leaves us at a bit of an impasse because if we try and cast an There seem to be 3 options:
None of these seem like great options for me, but I am open to opinions. |
This issue has been labeled |
This issue has been labeled |
Using recent cudf nightly conda package (0.19.0a+250.g8632ca0da3):
Int & Decimal Addition:
Result:
Workaround:
Decimal & Float Multiplication:
Workaround:
The text was updated successfully, but these errors were encountered: