fix: avoid materializing constant scalar into null slots in constant page decoder - #12
Merged
devin-ai-integration[bot] merged 1 commit intoAug 20, 2026
Conversation
…page decoder Null-padded constant pages (one repeated non-null value plus many nulls) previously repeated the scalar for every visible slot, including nulls, before validity was applied. With large utf8/binary scalars this overflowed i32 offsets (Offset overflow error) even though the decoded data fits comfortably once nulls contribute zero bytes. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
devin-ai-integration
Bot
merged commit Aug 20, 2026
5254993
into
exa/v9.0.1-txn-perf
3 checks passed
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.
Summary
Fixes the SEV-1271
Offset overflow errorwhen reading Lance 2.2 files with null-padded constant pages (the poisoned Silk Nodecrawl_outputfragments in the DLQ).Root cause: 2.2's constant encoding stores a repeated value once, and on decode
ConstantDecodeTask::materialize_valuesrepeated the scalar for every visible slot — including null slots — viatake(scalar, [0,0,...]), applying validity only afterwards. Real DLQ fragments hold one large (2–63 MB) utf8/binary value plus ~1000 nulls in the same column chunk; repeating the scalar for the null slots overflows Arrow's i32 utf8/binary offsets (>2 GiB) even though the actual data is tiny.Fix (in
constant.rs): when definition levels are present, build a 2-slot source[scalar, null]andtakewith per-row indices from the def levels, so null slots contribute zero bytes:The all-non-null path is unchanged (a genuinely constant 2 GiB+ column still errors, same as before).
Validation
test_constant_layout_null_padded_large_value_v2_2(utf8) andtest_constant_layout_null_padded_binary_v2_2mirror the DLQ shape (32 MiB value + ~1000 nulls); both fail withOffset overflow error: 2147483648on the old code and pass with the fix.cargo test -p lance-encoding: 461 passed.cargo fmt --all --checkandcargo clippy --all --tests --benches -- -D warningsclean.Offset overflow erroratconstant.rs:473), patched build decodes 41/41 (full scans at batch_size=8192 plustake_rows).Link to Devin session: https://app.devin.ai/sessions/ef2caed0e6614c15974a46d1e764e730
Requested by: @tanish-exa