fix(arrow): preserve predicates across numeric schema promotion - #3123
Open
mattfaltyn wants to merge 2 commits into
Open
fix(arrow): preserve predicates across numeric schema promotion#3123mattfaltyn wants to merge 2 commits into
mattfaltyn wants to merge 2 commits into
Conversation
mattfaltyn
marked this pull request as ready for review
August 31, 2026 17:00
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.
Which issue does this PR close?
What changes are included in this PR?
After numeric schema evolution, Arrow row filters compare an old physical column with a literal bound to the new table schema. Casting the literal down can turn out-of-range integers into nulls or round floating-point values, silently changing which rows match.
This change promotes
Int32columns toInt64,Float32toFloat64, andDecimal128to a wider precision at the same scale before comparison. The six binary comparisons andIN/NOT INshare this path; each membership predicate promotes the column once per batch. Existing scalar casts between equivalent Arrow string/binary representations remain unchanged.Optional page-index pruning now also promotes integer/float min/max values to
long/double, instead of attaching the new type to an old physical literal variant. Otherwise, pruning can discard matching pages before the corrected row filter executes. Other index types keep their existing behavior.No public API, dependency, metadata format, or persisted-data changes.
Scope: this covers Arrow row filtering and integer/float page-bound promotion. General decimal page-index decoding is still unsupported upstream even without evolution; adding
FIXED_LEN_BYTE_ARRAYsupport is outside this fix (see closed, unmerged #1950). Decimal row filtering and row-group pruning are covered.Are these changes tested?
IN/NOT IN, nulls, and double literals just above/below a stored float that round to it when narrowed.x < 2147483648returns no rows instead of[2, 3, 4]. All 472 configurations pass with both fixes.cargo test -p iceberg --lib arrow::reader --locked: 103 passed.cargo test -p iceberg --lib expr::visitors --locked: 201 passed.--all-targets --all-features --workspace --locked -- -D warnings) passed.target/.cargo nextest run --all-targets --all-features --workspace --locked --no-fail-fast --test-threads 1): 2,157 passed, none failed or skipped.cargo test --no-fail-fast --doc --all-features --workspace --locked): 93 passed, 23 ignored.icebergbuild with no default features passed.uv run --no-sync pytest: 17 passed, 2 skipped (credential-gated Hugging Face tests).All 21 upstream checks pass on
c598504a3, including the integration suite and Linux/macOS/Windows builds and Python tests. All local results above were rerun on this updated commit.Local Rust validation uses the pinned nightly with
CARGO_PROFILE_DEV_DEBUG=0. On this ARM Mac, integration fixtures run under Colima with native Java 8 for Hive andICEBERG_TEST_HMS_ENDPOINT=127.0.0.1:9083. The full local suite uses one worker to avoid SQLite fixture write-lock contention; no repository configuration or product code is changed for these local environment adaptations.AI Disclosure
Codex assisted with investigation, implementation, regression tests, and this description. The regression was executed before and after the fix, and the changed comparison paths were reviewed. Expanded validation reproduced the integer/float page-pruning gap before it was fixed. The separate decimal page-index feature remains outside this PR's scope.