Repository navigation
feat(parquet): bound input prefetch with a row-group window - #604
SteNicholas wants to merge 1 commit into
Conversation
Arrow could pre-buffer all selected row groups before returning the first batch. With wide projections, compressed input memory grew with the number of selected row groups even when output batches were small. - Prefetch projected column chunks and selected pages in a sliding row-group window, addressing apache#602. - Count coalesced gaps and in-flight reads against the per-reader byte budget, which defaults to 64 MiB. Read oversized groups on demand. - Reuse buffered input on seeks within the window. Retire groups after their final batch and drain submitted reads before releasing buffers from consumed or discarded groups. - Preserve row-group and page pruning, file row IDs, batch order and the lifetime of returned Arrow batches.
a347b35 to
170ae3e
Compare
|
Could we make the number of subsequent row groups to prefetch configurable, instead of hardcoding a limit of 64? This would align with Velox’s |
|
Could we also add before-and-after performance benchmarks on slower storage, such as an HDD-backed distributed file system, to verify that the reduced prefetch window does not cause a significant performance regression? It would be useful to compare scan throughput and first-batch latency across different row-group sizes. |
|
Could we consider increasing the default prefetch budget to 128 MiB? Also, could we allow at least the current row group to be prefetched even if it exceeds the budget, and apply the budget when deciding whether to prefetch subsequent groups? Increasing the default alone would still leave larger row groups falling back to on-demand reads. |
Purpose
Linked issue: close #602
Bound Parquet input pre-buffering in Paimon C++ with a sliding row-group window, following Velox's scheduling approach. Arrow could buffer the projected input for every selected row group before returning the first batch, so compressed input memory grew with wide scans.
One local Release run used a 900 KiB budget, 32 rows per group with 12 KiB of padding per string, and four rows per output batch. At 6 and 30 row groups, peak input was 787,072 bytes in both scans. First-batch latency was 135 and 170 µs, scan throughput was 775.38 and 1,338.14 MiB/s, and physical bytes read were 2,361,006 and 11,805,030, respectively.
Tests
API and Format
parquet.read.cache-option.window-size-limitin bytes. It defaults to 64 MiB per reader, and0disables the window.Documentation
Yes.
docs/source/user_guide/prefetch.rstcovers the window, the byte budget, lazy reads and the shared read-ahead cache.Generative AI tooling
Generated-by: OpenAI Codex (GPT-6)
🤖 Generated with OpenAI Codex