You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "jonahgao (via GitHub)" <gi...@apache.org> on 2023/09/08 02:34:09 UTC

[GitHub] [arrow-datafusion] jonahgao opened a new issue, #7502: Inconsistent behaviors when dividing floating numbers by zero

jonahgao opened a new issue, #7502:
URL: https://github.com/apache/arrow-datafusion/issues/7502

   ### Describe the bug
   
   To Reproduce:
   ```sh
   DataFusion CLI v30.0.0
   ❯ create table t(c1_nullable float, c2_not_nullable float not null);
   0 rows in set. Query took 0.033 seconds.
   
   ❯ insert into t values(1.0, 1.0);
   +-------+
   | count |
   +-------+
   | 1     |
   +-------+
   1 row in set. Query took 0.046 seconds.
   
   ❯ select c1_nullable / 0. from t;
   +----------------------------+
   | t.c1_nullable / Float64(0) |
   +----------------------------+
   | inf                        |
   +----------------------------+
   1 row in set. Query took 0.024 seconds.
   
   ❯ select c2_not_nullable / 0. from t;
   Optimizer rule 'simplify_expressions' failed
   caused by
   Arrow error: Divide by zero error
   ```
   `c1_nullable / 0.` is processed by the arrow-rs arithmetic kernel, and according to the IEEE 754 rules, the result is `inf`.
   
   `c2_not_nullable / 0.` is processed by the DivideZero simplification rule, resulting in a 'Divide by zero' error.
   https://github.com/apache/arrow-datafusion/blob/4d4451294629940d340160cdd06be273139728b4/datafusion/optimizer/src/simplify_expressions/expr_simplifier.rs#L709-L715
   
   ### To Reproduce
   
   As mentioned above
   
   ### Expected behavior
   
   They should all follow the IEEE 754 rules.
   
   ### Additional context
   
   _No response_


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

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


[GitHub] [arrow-datafusion] alamb closed issue #7502: Inconsistent behaviors when dividing floating numbers by zero

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb closed issue #7502: Inconsistent behaviors when dividing floating numbers by zero
URL: https://github.com/apache/arrow-datafusion/issues/7502


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