Repository navigation
feat(io): apply byte-sized batch budget to blob materialization - #8927
Merged
Merged
Conversation
zhangyue19921010
pushed a commit
that referenced
this pull request
Sep 2, 2026
…ns (#8933) Serialize the scanner's `batch_size_bytes` budget into `FilteredReadOptionsProto` so remote execution no longer drops the byte cap when `file_reader_options` is reconstructed from the wire. ## Summary Fixes #8857 (follow-up to #8927): carry `batch_size_bytes` through distributed FilteredReadOptions This is a follow-up to #8927 ("feat(io): apply byte-sized batch budget to blob materialization"), which applies the scanner's `batch_size_bytes` budget a second time after blob v2 payloads are materialized. The gatekeeper review on #8927 flagged that the budget is silently dropped under distributed execution, because `FilteredReadOptionsProto` does not serialize `file_reader_options`. This PR lands that missing wire field. ## Problem #8927 forwards the byte budget into the row-stream `FilteredReadExec`, but its distributed codec does not serialize `file_reader_options`; `FilteredReadOptionsProto` has no corresponding field and decode reconstructs `None`. Remote execution therefore silently drops the byte cap. ## Fix Add an optional `batch_size_bytes` field to `FilteredReadOptionsProto` and round-trip it through the proto codec. ### Changes - `protos/filtered_read.proto` - Add `optional uint64 batch_size_bytes = 14` to `FilteredReadOptionsProto`, documented as the scanner-level byte budget corresponding to `FileReaderOptions.batch_size_bytes`. - `rust/lance/src/io/exec/filtered_read_proto.rs` - `fr_options_to_proto`: serialize `options.file_reader_options.batch_size_bytes` into the new field. - `fr_options_from_proto`: reconstruct `file_reader_options` with `batch_size_bytes` when present. - Extend `test_options_roundtrip_basic` to set `batch_size_bytes: Some(4096)` and assert it survives the round-trip. ### Tests - `cargo test -p lance --features substrait --lib filtered_read_proto::tests::test_options_roundtrip_basic` — verifies `batch_size_bytes` round-trips through the proto codec (sender `Some(4096)` → decoded `Some(4096)`). - `cargo check -p lance --features substrait` — compiles cleanly. ## Relationship to #8927 #8927 implements the core blob byte-budget feature and is still open. This PR is a focused follow-up that addresses one of its three gatekeeper findings (distributed execution dropping the budget). The other two findings — skewed-row chunk sizing in `split_batch_by_bytes` and chunk boundaries being re-merged by `RowStreamRead::read_batch` — are tracked separately and not addressed here.
…e-format#8857) Apply the scanner's `batch_size_bytes` budget a second time after blob v2 payloads are materialized, recursively splitting the merged batch by bytes (2x oversubscription) and preserving chunk boundaries through late materialization so blob reads stay within the envelope.
…e-format#8857) Apply the scanner's `batch_size_bytes` budget a second time after blob v2 payloads are materialized, recursively splitting the merged batch by bytes (2x oversubscription) and preserving chunk boundaries through late materialization so blob reads stay within the envelope.
The merged stable-format contract rejects the legacy lance-encoding:blob metadata marker for file version >= 2.2, so Dataset::write failed before the batch_size_bytes assertions could run in these two coverage tests. Build both fixtures with blob_field / BlobArrayBuilder, a genuine lance.blob.v2 logical array, and keep the writes and byte-envelope assertions on the stable v2.2 format.
lichuang
force-pushed
the
issue-8857
branch
from
September 16, 2026 02:02
154da9e to
ab31f6e
Compare
Contributor
There was a problem hiding this comment.
✅ Gate recommendation: approve.
The beta.3 base merge leaves the effective PR patch unchanged and preserves the verified contracts: stable blob-v2 fixtures satisfy the late-materialization and vector-search byte envelopes, while splitting, ordering, reservation lifetime, memory admission, and distributed budget propagation remain intact.
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.
close #8857
Apply the scanner's
batch_size_bytesbudget a second time after blob v2 payloads are materialized, splitting the merged batch by bytes so blob reads are capped at 2x oversubscription relative to the inline/descriptor budget.