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

   ### Is your feature request related to a problem or challenge?
   
   In some of our kernels we need to compute the scale for a decimal scale, via 
a call to `pow()`. We can replace such usages with calls to a precomputed 
lookup table of the powers per scale, to avoid a call to `pow()` at only the 
cost of some extra code.
   
   ### Describe the solution you'd like
   
   See example usage here:
   
   
https://github.com/apache/arrow-rs/blob/ed92960c8a85eda657fce3525c905616ccc5a983/arrow-cast/src/cast/mod.rs#L86-L92
   
   We could replace here with a lookup table access, so long as we protect 
against extreme scales (and also consider negative scales). If we are confident 
that we protect against extreme scales beforehand then we could even avoid this 
check.
   
   Some files that may benefit from this:
   
   - 
[arrow-cast/src/cast/mod.rs](https://github.com/apache/arrow-rs/blob/ed92960c8a85eda657fce3525c905616ccc5a983/arrow-cast/src/cast/mod.rs)
   - 
[arrow-arith/src/numeric.rs](https://github.com/apache/arrow-rs/blob/ed92960c8a85eda657fce3525c905616ccc5a983/arrow-arith/src/numeric.rs)
   - 
[arrow-cast/src/parse.rs](https://github.com/apache/arrow-rs/blob/ed92960c8a85eda657fce3525c905616ccc5a983/arrow-cast/src/parse.rs)
   - 
[arrow-cast/src/cast/decimal.rs](https://github.com/apache/arrow-rs/blob/ed92960c8a85eda657fce3525c905616ccc5a983/arrow-cast/src/cast/decimal.rs)
   
   See an example of the lookup table from DataFusion:
   
   - https://github.com/apache/datafusion/pull/23631
   
   ### Describe alternatives you've considered
   
   _No response_
   
   ### Additional context
   
   _No response_


-- 
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