You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/06/02 04:25:36 UTC

[GitHub] [arrow] cyb70289 edited a comment on pull request #10364: ARROW-12074: [C++][Compute] Add scalar arithmetic kernels for decimal

cyb70289 edited a comment on pull request #10364:
URL: https://github.com/apache/arrow/pull/10364#issuecomment-852709410


   @bkietz , met with one problem, would like to hear your comments. Thanks.
   
   Decimal upscaling is operation dependent. E.g., `+,-` will upscale arg with smaller scale to align digit, `*` needn't scaling, `/` is more complicated.
   
   Implicit args casting happens before kernel is created. `DispatchBest` only knows arg types, no operation type (kernel dependent) is available. So we cannot figure out the "to be casted" arg type (new precision, scale).
   https://github.com/apache/arrow/blob/master/cpp/src/arrow/compute/function.cc#L175
   
   Maybe add another callback `kernel->explicit_cast()` and call it after or inside `DispatchBest`? Or  create different `ScalarFunction` struct (and DispatchBest) for each decimal operation?


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

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