mbutrovich opened a new issue, #12171:
URL: https://github.com/apache/arrow-rs/issues/12171

   ### Is your feature request related to a problem or challenge?
   
   Part of #11421.
   
   Decimal `/` and `%` by a scalar run the divide for every value, through 
`decimal_op` closures passed to `try_unary` by 
[`try_op!`](https://github.com/apache/arrow-rs/blob/01b1275aab90c033da3f64f5edbfb4f061606cae/arrow-arith/src/numeric.rs#L303-L317).
 The divisor is the scalar operand after scaling, so it is the same for every 
row.
   
   ### Describe the solution you'd like
   
   Build a divisor from the scaled scalar once per call and divide with `unary` 
as the integer kernel does in #12076, keeping the error and null behavior 
described in #11421. The scaling step of `div` can overflow, and that error 
must still be returned only when there is a valid value to divide.
   
   `Decimal32` and `Decimal64` can use the divisors from #11467 now. 
`Decimal128` and `Decimal256` need {{01}}. The inlining problem of the closures 
in #11529 should be fixed first (PR #12080), because it hides the gain in the 
benchmark.
   
   The PR reports before and after numbers from the `decimal_division` 
benchmark (#11427), including the cases with more than half of the values null, 
and picks its own `unary` versus `try_unary` threshold per type.
   
   ### Describe alternatives you've considered
   
   None beyond the ones in #11421.
   
   ### Additional context
   
   None.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to