You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
-0.0 == 0.0 is false, so filters, joins and group-bys split zero in two #7656
Currently, float equality goes through arrow-rs cmp::eq (DataArray::equal in src/daft-core/src/array/ops/comparison.rs), which compares by IEEE 754 totalOrder, where -0.0 and 0.0 are different values. So col("f") == 0.0 misses rows holding -0.0, an equi-join on a float key does not match -0.0 with 0.0, and groupby/distinct return two zero groups. IEEE 754 equality, Python, DuckDB and polars all treat the two as equal, and PyIceberg, polars and DuckDB return the -0.0 row for f = 0.0 on the same Iceberg table that daft.read_iceberg filters it out of.
To Reproduce
importdaftdf=daft.from_pydict({"f": [-0.0, 0.0, 1.0]})
print(df.where(daft.col("f") ==0.0).to_pydict())
# {'f': [0.0]}print(daft.sql("SELECT f FROM df WHERE f = 0.0").to_pydict())
# {'f': [0.0]}print(df.distinct().count_rows())
# 3a=daft.from_pydict({"k": [-0.0]})
b=daft.from_pydict({"k": [0.0], "v": [1]})
print(a.join(b, on="k").to_pydict())
# {'k': [], 'v': []}
Expected behavior
{'f': [-0.0, 0.0]} for both filters, 2 distinct values, and one joined row {'k': [-0.0], 'v': [1]} (or 0.0), as -0.0 == 0.0 in Python and SELECT CAST(-0.0 AS DOUBLE) = 0.0 in DuckDB.
Component(s)
Built-in Functions
Additional context
daft 0.7.26, Python 3.12.13, macOS 26.6.2, arm64 (Darwin 25.6.0). DataArray::equal and compare_to_scalar still call cmp::eq on main.
Activity
hello-peter-tang commentedon Oct 30, 2026
I'd like to take this one. I'll investigate and open a PR with a fix and a regression test.
hello-peter-tang commentedon Oct 30, 2026
Opened #7661 with the fix and a Python regression test covering filters, joins, group-by, and distinct.