ARROW-7011: [C++] Implement casts from float/double to decimal#7612
ARROW-7011: [C++] Implement casts from float/double to decimal#7612pitrou wants to merge 5 commits intoapache:masterfrom
Conversation
Also naturally available in Python using the Array.cast() method.
15432c7 to
e753733
Compare
There was a problem hiding this comment.
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.
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.
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.