-
Notifications
You must be signed in to change notification settings - Fork 4k
ARROW-7011: [C++] Implement casts from float/double to decimal #7612
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
Conversation
Also naturally available in Python using the Array.cast() method.
15432c7 to
e753733
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks very reasonable to me, glad to see the conversion functions added. I had one question about generating multiple applicators based on the allow-truncation flag, absent benchmarks showing that it's makes a meaningful difference I'll quickly switch that to be a member variable and so generate less code
| }; | ||
|
|
||
| using SafeRealToDecimal = RealToDecimal<true>; | ||
| using UnsafeRealToDecimal = RealToDecimal<false>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure the performance benefit of pruning the AllowTruncate branch merits the 2x code size -- what do you think about making this flag just a member of the functor?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hum, yes, sounds fine. I initially thought the code would be more different, but it doesn't really make sense to generate two codepaths now.
|
Ugh there's that pesky flake again https://github.com/apache/arrow/pull/7612/checks?check_run_id=832227898 @kszucs did we determine whether it's feasible to get backtraces on macOS in GitHub Actions? |
|
+1 |
Also naturally available in Python using the Array.cast() method.