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
Regression: short floating-point IN lists mishandle signed zero #27121
In 56.0.0-dev (1635ed9), floating-point IN lists containing two or three values distinguish -0.0 from +0.0. The same queries return correct results in 55.2.0.
To Reproduce
Create zeros.csv:
id,x
1,-0.02,0.0
Run:
CREATE EXTERNAL TABLE zeros (
id BIGINT, x DOUBLE
)
STORED AS CSV LOCATION 'zeros.csv'
OPTIONS ('has_header''true');
SELECT
id,
x = CAST(0AS DOUBLE) AS eq,
x IN (CAST(0AS DOUBLE), CAST(5AS DOUBLE)) AS in_list,
x NOT IN (CAST(0AS DOUBLE), CAST(5AS DOUBLE)) AS not_in_list
FROM zeros
ORDER BY id;
DF55 rewrites these short lists into equality/inequality chains. DF56 retains membership expressions, exposing signed-zero behavior inconsistent with equality. Both Float32 and Float64 are affected.
Expected behavior
No response
Additional context
Longer lists and constant folding already exhibit this inconsistency in 55.2.0:
SELECT-CAST('0.0'AS DOUBLE) = CAST('0.0'AS DOUBLE) AS eq,
-CAST('0.0'AS DOUBLE) IN (
CAST('0.0'AS DOUBLE),
CAST(5AS DOUBLE),
CAST(6AS DOUBLE),
CAST(7AS DOUBLE)
) AS in_list;
Expected: (true, true)
Actual in both versions: (true, false)
Activity
jonasHanhan commentedon Nov 5, 2026
take
IN LIST: treat signed zeros as equal (apache#25186)
[branch-56] IN LIST: treat signed zeros as equal (backport #25186) (#…
refactor: Improve `float_semantics::normalize`, consolidate ownership (…
docs: Explain `SortKeyWalk` with worked examples (apache#27266)