apache / datafusion

Apache DataFusion SQL Query Engine
https://datafusion.apache.org/
Apache License 2.0
5.5k stars 1.02k forks source link

Make Eq with negative float zero compat with other engines #11108

Open kazuyukitanimura opened 1 week ago

kazuyukitanimura commented 1 week ago

Describe the bug

DF returns false below and is not compliant with major engines:

DataFusion CLI v39.0.0
> select 0.0 == -0.0;
+--------------------------+
| Float64(0) = Float64(-0) |
+--------------------------+
| false                    |
+--------------------------+

Similar issue #11051

To Reproduce

No response

Expected behavior

No response

Additional context

No response

LorrensP-2158466 commented 1 week ago

Isn't this done in Arrow? Because Binary Eq calls arrow::compute::kernels::cmp::eq

Screenshot 2024-06-27 at 00 46 46

So I think we should do exactly what the docs say and normalize zeros?