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
[C++][Dataset][Parquet] Row group of +0.0 values is skipped: statistics (-0.0, +0.0) become the guarantee x == -0.0 #55948
Describe the bug, including details regarding any error messages, version, and platform.
For a float column whose row group contains only 0.0, the Parquet writer stores min = -0.0 and max = +0.0 (as the Parquet spec asks). The dataset reader turns this into the guarantee x == -0.0 and folds the filter with x = -0.0. Filters that distinguish the sign of zero are then evaluated for the wrong value, and the row group is skipped.
Cause, from reading the code: ParquetFileFragment::EvaluateStatisticsAsExpression (cpp/src/arrow/dataset/file_parquet.cc) checks min->Equals(*max), which treats -0.0 and +0.0 as equal, and then returns equal(field, literal(min)), i.e. x == -0.0. SimplifyWithGuarantee replaces x with the known value -0.0, so 1/x > 0 folds to -inf > 0 = false and cast(x, string) == "0" folds to "-0" == "0" = false.
A possible fix: emit the single-value guarantee only when min and max are bitwise identical, and use the range guarantee x >= min and x <= max otherwise (comparisons are unaffected because -0.0 == +0.0).
Related but different: GH-46183 / GH-54915 (is_in and index_in hashing -0.0 and +0.0 differently). Here the problem is the known-value substitution from statistics, and it also affects arithmetic and casts.
Reproduces on pyarrow 10.0.1, 16.1.0, 20.0.0 and 26.0.1 (Linux x86_64, Python 3.11). The code is unchanged on main.
Component(s)
C++, Parquet, Python
Drafted with Claude Code; reproduced and reviewed by me.
Activity