You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "Jefffrey (via GitHub)" <gi...@apache.org> on 2026/08/03 06:25:31 UTC

[I] Replace decimal power calls with lookup table [arrow-rs]

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: github-unsubscribe@arrow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Replace decimal power calls with lookup table [arrow-rs]

Posted by "jaideeppyne (via GitHub)" <gi...@apache.org>.
jaideeppyne commented on issue #10523:
URL: https://github.com/apache/arrow-rs/issues/10523#issuecomment-5202445701

   take


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Replace decimal power calls with lookup table [arrow-rs]

Posted by "Abhisheklearn12 (via GitHub)" <gi...@apache.org>.
Abhisheklearn12 commented on issue #10523:
URL: https://github.com/apache/arrow-rs/issues/10523#issuecomment-5191087869

   If anyone wants to work on this issue, feel free to pick it up. i got a bit busy, so i won't be able to work on it. it's a good first issue and a nice way to get familiar with Arrow. enjoy :)


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Replace decimal power calls with lookup table [arrow-rs]

Posted by "Abhisheklearn12 (via GitHub)" <gi...@apache.org>.
Abhisheklearn12 commented on issue #10523:
URL: https://github.com/apache/arrow-rs/issues/10523#issuecomment-5163443741

   take


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Replace decimal power calls with lookup table [arrow-rs]

Posted by "Jefffrey (via GitHub)" <gi...@apache.org>.
Jefffrey closed issue #10523: Replace decimal power calls with lookup table
URL: https://github.com/apache/arrow-rs/issues/10523


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org