fix(dataset): stream sub-batches through merge_columns without 2GiB concat - #14
Merged
jan-exa merged 2 commits intoAug 21, 2026
Conversation
…oncat Co-Authored-By: Jan van der Vegt <jan@exa.ai>
Co-Authored-By: Jan van der Vegt <jan@exa.ai>
🤖 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:
|
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
merge_columns/add_columnsfails withOffset overflow errorwhen one updater read batch carries >2GiB of variable-width data (32-bitbinary/stringoffsets):add_columns_from_streamconcatenated all stream batches covering a read batch into a single ArrowRecordBatchbefore handing it to the updater. Observed in production on a ~200k-row fragment whosedocument_protocolumn totals ~2.74GiB.Fix: never concatenate on the v2+ path.
Updater::update_batches(Vec<RecordBatch>)alongside the unchangedupdate:sum(rows) == source batch rows;DeletionRestorer::restoreper sub-batch (restore is incremental over row addresses, so blanks land at identical global positions as the single-concat path);GenericWriter::write— no concat anywhere;updatevia concat, sinceDeletionRestorervalidates whole row-groups there and v1 row groups can't reach 2GiB.add_columns_from_streamnow callsupdater.update_batches(batches)instead ofconcat_batches+update.add_blankson an empty batch (fully-deleted read batch) now synthesizes null placeholder rows when all fields are nullable (previously alwaysNotSupported); non-nullable schemas keep the original "run compaction" error.Purely a write-path change: committed schema, storage version, and reader-visible bytes are unchanged.
Testing
update_batcheserror cases (empty list, row-count mismatch) and legacy-path delegation test.add_blanksnon-nullable empty-batch regression test.#[ignore]>2GiB regression test (test_add_columns_binary_column_over_2gib, ~5GiB RAM): 1,100 x 2MiB binary values streamed in 10-row batches into a single fragment;merge_columnssucceeds,dataset.validate()passes, and a full scan verifies every value. Run manually: passed (1 passed; 0 failed, 14.7s). Reproduces the exact production failure shape (previously:Offset overflow error: 2737806570at schema_evolution.rs:672).cargo fmt --all,cargo clippy --all --tests --benches -- -D warnings, targetedcargo test -p lanceall pass.Link to Devin session: https://app.devin.ai/sessions/7cd5f358690a4d7cb4fbe13d6b5e4ad5
Requested by: @jan-exa