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
expr: don't read unordered stats bounds as an empty range (PER-53)
`ResultSpec::value_between` collapsed `min > max` to `nothing()`, i.e. "no
value can be here". That only holds for bounds a caller derived coherently.
Persist part statistics are not such a caller: arrow orders floats totally,
putting `-NaN` below `-Infinity`, while `OrderedFloat`, the `Datum` order
`value_between` compares in, ranks every NaN above every finite value. A part
holding `-NaN` therefore reports `lower = -NaN` against a finite `upper`, the
range read back as empty, and filter pushdown discarded the part, losing every
other row in it. `'-NaN'` is ordinary user input, so no corrupt storage is
needed to reach this.
Widening unordered bounds is not sufficient on its own. A part holding NaNs
of both signs records the total-order bounds `(-NaN, +NaN)`, which decode to
`NaN == NaN`: a seemingly valid, non-inverted range claiming the part holds
nothing but NaN, so a filter matching a finite row still discarded the part.
Only the stats decode still sees the NaN signs, so `col_values` additionally
refuses to produce float bounds from a negative-NaN lower, unless the upper
shows the whole column is NaN.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q5GiWioZM6CWrwWgfBADDR
0 commit comments