Repository navigation
Conversation
…stripes Expose streaming batches from complete ORC files or selected stripes. Reuse native decoding through a stateless stripe reader factory and preserve row counts for zero-column projections. Add validation, lifecycle, range-reading and memory regression coverage. Generated-by: OpenAI Codex Signed-off-by: jiangxt2 <jiangxt2@vip.qq.com>
jiangxt2
requested review from
AlenkaF,
raulcd,
rok and
wgtmac
as code owners
October 22, 2026 09:36
|
|
Generate shared fixture data with Python integers and isolate NumPy integer arguments in a marked test. Cover whole-file and selected-stripe iterator lifetimes across all five codecs. Generated-by: OpenAI Codex Signed-off-by: jiangxt2 <jiangxt2@vip.qq.com>
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.
Rationale for this change
ORCFile.read_stripe()materializes an entire stripe as one record batch. Dataset already scans ORC in batches; this adds native batching with explicit stripe selection toORCFile, supporting incremental consumption and early termination.Closes #54921.
What changes are included in this PR?
ORCFile.iter_batches(batch_size=65536, stripes=None, columns=None)with column projection.GetStripeReaderoverloads that decode directly into batches without changing the reader's Seek position.Are these changes tested?
Validated on macOS arm64 with matching Release C++/Python builds, Python 3.13.7 and ORC 2.2.1.
44 passed; one existing timezone-database test restricted to ORC < 2.0 was skipped.
From
python/:238 passed with NumPy 2.5.4. In an isolated environment without NumPy, the
iter_batchestests andtest_without_numpy.pyhad 220 passes; only the marked NumPy integer-input test was skipped. Coverage includes five codecs, stripe order and duplicates, batch limits, nested/zero-column projections, invalid arguments, interleaved iterators and read failures. Both environments cover owner lifetime, early close and resource release for whole-file and selected-stripe iteration.The C++ memory regression uses four int64 columns and batches of 256 rows. For single stripes of 262144 and 1048576 rows, whole-stripe Arrow allocation peaks were 16.125 and 64.5 MiB; streaming peaked at 16.25 KiB for both sizes. NONE/ZLIB range tests verify that consuming the first batch and closing early does not read unselected stripe data.
Changed-file format/lint checks and
git diff --checkpassed.Are there any user-facing changes?
Yes. The new API yields
RecordBatchobjects.stripes=Nonereads all stripes; explicit sequences preserve order and duplicates, and empty sequences yield no batches.columns=[]preserves row counts. Closing the iterator releases its reader without closing the input; returned batches remain valid.batch_sizelimits output rows, not total process memory. ORC buffers and dictionaries require additional memory, and small batches can reduce throughput. Reading the same stripes does not inherently reduce I/O.Was AI used for this PR?
PR code and description written by:
Reviewed before submission by:
The human contributor directed the design and reviewed the proposal and PR text. OpenAI Codex assisted with code, tests, documentation and static review.