feat: batch chopping fallback for filtered read#6482
Open
westonpace wants to merge 3 commits intolance-format:mainfrom
Open
feat: batch chopping fallback for filtered read#6482westonpace wants to merge 3 commits intolance-format:mainfrom
westonpace wants to merge 3 commits intolance-format:mainfrom
Conversation
…ytes When batch_size_bytes is configured, wrap the filtered read stream in a ChopBatchesStream that splits oversized batches (>1.5x target) into smaller sub-batches. This provides a safety net when the underlying file reader doesn't estimate batch sizes accurately enough. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
909ebad to
3d60bdc
Compare
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
…tream Replace the custom ChopBatchesStream with the existing rechunk_stream_by_size utility from lance-arrow, passing min_bytes=0 to disable coalescing and only perform the batch splitting behavior. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The accumulation loop condition `acc_bytes < min_bytes` was never entered when both started at 0, causing the stream to immediately return None. Fix by always pulling at least one batch per iteration. Add Rust unit tests for the min_bytes=0 case and a Python integration test that verifies batch chopping works for large-string rows with batch_size_bytes. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Member
Author
|
Windows CI failure seems unrelated |
LuQQiu
approved these changes
Apr 13, 2026
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
ChopBatchesStream, a stream wrapper that splits oversized batches (>1.5x targetbatch_size_bytes) into smaller sub-batches using zero-copyRecordBatch::sliceChopBatchesStreamwhenbatch_size_bytesis configured viaFileReaderOptionsStacked on feat/byte-sized-batches-file-reader — wait for that to merge first, then rebase this PR.
Test plan
ChopBatchesStream: splits large batches, passes small batches through,wrap_if_needed(None)is a no-opcargo clippycleancargo fmtclean🤖 Generated with Claude Code