cyb70289 commented 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 
small 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 one `ScalarFunction` struct (and DispatchBest) per 
binary 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:
[email protected]


Reply via email to