fix(plan): do not use min/max stats for >= NaN float predicate#27675
Closed
jonathansergio wants to merge 2 commits into
Closed
fix(plan): do not use min/max stats for >= NaN float predicate#27675jonathansergio wants to merge 2 commits into
>= NaN float predicate#27675jonathansergio wants to merge 2 commits into
Conversation
Member
|
This is already fixed in main. Your other PR can rebase on main and that should be fine. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #27675 +/- ##
==========================================
- Coverage 81.48% 81.27% -0.22%
==========================================
Files 1840 1840
Lines 256109 256110 +1
Branches 3181 3180 -1
==========================================
- Hits 208696 208145 -551
- Misses 46588 47139 +551
- Partials 825 826 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #26805
What does this PR do?
Fixes an incorrect skip-batch optimization for floating-point columns: prevent using min/max statistics when the operator is
>=and the literal isNaN.Why?
Min/max stats exclude
NaN. Forcol >= NaN,NaNsatisfies the predicate (TotalOrd:NaN >= NaNis true). Generating a skip predicate likemax(A) < NaNmay evaluate to true (e.g.0.0 < NaN) and incorrectly skip a batch that containsNaN, producing wrong results.Changes
can_use_min_max_statsinskip_batches.rs:GtandGtEqhandling:Some(O::Gt) => lv_is_nan(safe: nothing is greater thanNaN).Some(O::GtEq)=>false(unsafe:>= NaNmay matchNaNrows but stats excludeNaN).test_skip_batch_predicate.py:>= NaN.test_float_geq_nan_skip_batch_predicate()that ensurescol >= NaNdoes not produce a skip predicate and that rows withNaNare not skipped.Backward compatibility
No API or semantic changes for users. This only disables an unsafe optimization in a specific
NaNcase to avoid incorrect filtering.Tests
test_float_geq_nan_skip_batch_predicate.Notes
[NaN, null, 0.0, null]). The root cause was introduced when enabling rowgroup/rowgroup skipping for float columns (feat: Enable rowgroup skipping for float columns #26805).