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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
