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 2022/11/15 03:01:53 UTC

[GitHub] [arrow-datafusion] HaoYang670 commented on issue #4191: scalar function `round` ignores second parameter

HaoYang670 commented on issue #4191:
URL: https://github.com/apache/arrow-datafusion/issues/4191#issuecomment-1314694661

   Not sure, but I wonder could we support this is logical phase? 
   Given the following 2 lemmas:
   ```coq
   1. forall source: FloatArray, round(source) = round(source, 0)
   2. forall source: FloatArray n: IntArray,
           round(source, n) = div(
                                 round(mul(
                                         source, 
                                         pow(10, n))), 
                                 pow(10, n))
   ```
   we can unfold the `round` function in the logical plan stage and don't need to modify the physical stage.
   
   One concern here is that `Decimal` type might be better than `Float` type because we've found some corner cases in floating point multiplication and division:  


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