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/10/11 23:53:47 UTC

[GitHub] [arrow-datafusion] HaoYang670 commented on issue #3615: ` col / col` returns `1` when `col = 0`

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

   Thank you, @retikulum, for taking this. 
   There are 2 issues here.
   1. If the divisor is a literal zero, we should return the `DivideByZeroError` directly, just like what we have done for the modulo operator: https://github.com/apache/arrow-datafusion/blob/master/datafusion/optimizer/src/simplify_expressions.rs#L822-L829
   2. For the `A / A` case, my suggestion is to remove the rule `A / A -> lit(1)`, because we can't know whether `A` contains zeros when `A` is not a literal. An example in the postgresql is here: https://onecompiler.com/postgresql/3yjp52zuz
    


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