Repository navigation
[data] DataSourceV2: don't disable pre_buffer in Parquet scanner options - #63466
Merged
bveeramani merged 1 commit intoMay 19, 2026
Conversation
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
V2's ``ParquetFileReader._arrow_scanner_kwargs`` explicitly set
``pds.ParquetFragmentScanOptions(pre_buffer=False, ...)``. With
``pre_buffer=False`` pyarrow opens a per-column buffered stream
and issues range requests lazily. On wide-schema Parquet files
(thousands of small columns), that turns one fragment read into
thousands of S3 GETs — wide_schema_pipeline_primitives regressed
from ~16s to ~154s after V2 became the default reader.
``ds.stats()`` from the regressing run showed the symptom
clearly:
Operator 2 ReadFilesParquetV2: 27 tasks, 40 blocks in 143.19s
Remote wall time: 88.67s mean per task
Remote cpu time: 2.96s mean per task
96% of per-task wall time was blocked, with negligible CPU —
classic many-small-I/O signature. V1 ``ParquetDatasource``
and Anyscale's internal Turbo ``ParquetReader`` both leave
``pre_buffer`` at the pyarrow default (``True``), which plans
one coalesced range request per fragment.
Drop the ``pre_buffer=False`` override. The cross-fragment
memory accumulation that originally motivated disabling it
(apache/arrow#39808) is already addressed by V2's per-fragment
scanners.
Tests: 11/11 V2 parquet pass; 267 passed / 6 skipped on
``tests/datasource/test_parquet.py``.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Signed-off-by: Goutam <[email protected]>
goutamvenkat-anyscale
force-pushed
the
goutam/parquet_v2_wide_schema_fix
branch
from
May 18, 2026 20:57
097b1e5 to
3b5ccad
Compare
bveeramani
approved these changes
May 19, 2026
bveeramani
enabled auto-merge (squash)
May 19, 2026 01:46
TruongQuangPhat
pushed a commit
to cyhapun/ray-fix-issue
that referenced
this pull request
May 27, 2026
…ons (ray-project#63466) ## Summary V2's ``ParquetFileReader._arrow_scanner_kwargs`` was constructing ``pds.ParquetFragmentScanOptions(pre_buffer=False, use_buffered_stream=True, buffer_size=8 MiB)``. With ``pre_buffer=False``, pyarrow opens a per-column buffered stream and issues range requests lazily. On wide-schema Parquet (thousands of small columns) that turns one fragment read into thousands of S3 GETs. The ``wide_schema_pipeline_primitives`` release test regressed from ~16s on V1 to ~154s after V2 became the default reader (ray-project#63326). Other release tests on wide schemas (``wide_schema_pipeline_{tensors,objects,nested_structs}`` and ``write_parquet``, which is read-then-write) are affected by the same mechanism. ## Evidence ``ds.stats()`` from a regressing run on ``s3://ray-benchmark-data-internal-us-west-2/wide_schema/primitives`` (27 files × 22 MB × 5000 columns): ``` Operator 2 ReadFilesParquetV2: 27 tasks executed, 40 blocks produced in 143.19s Remote wall time: 61.73ms min, 141.62s max, 88.67s mean Remote cpu time: 62.07ms min, 4.76s max, 2.96s mean Peak heap memory: 448.82 MiB min, 612.21 MiB max ``` 96% of per-task wall time is blocked, CPU is negligible — the classic many-small-I/O signature, not memory pressure or per-task setup cost. ## Why this only affects V2 - **V1** ``ParquetDatasource`` constructs ``pds.ParquetFragmentScanOptions(use_buffered_stream=True, buffer_size=8 MiB)`` without setting ``pre_buffer`` → pyarrow default ``True`` → one coalesced range request per fragment. Fast. - **Anyscale internal Turbo** ``ParquetReader`` does the same — ``pre_buffer`` left at default. No regression. - **V2 (this PR fixes)** explicitly set ``pre_buffer=False``. On narrow schemas the difference is invisible (few large columns either way). On wide schemas it's catastrophic. The cross-fragment memory accumulation that originally motivated disabling ``pre_buffer`` (apache/arrow#39808) is already addressed by V2's per-fragment scanner construction — so disabling ``pre_buffer`` was load-bearing on a problem that no longer needs that fix. ## Change Drop the ``pre_buffer=False`` argument. Update the comment to record why we rely on the default. No other behavioral change. ## Test plan - [x] pre-commit clean on the modified file - [x] ``python/ray/data/_internal/datasource_v2/tests/test_parquet_datasource_v2.py`` — 11/11 pass - [x] ``python/ray/data/tests/datasource/test_parquet.py`` — 267 passed / 6 skipped Release tests: https://buildkite.com/ray-project/release/builds/93384#_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) Signed-off-by: Goutam <[email protected]> Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]> Signed-off-by: phattruong <[email protected]>
alexandrplashchinsky
pushed a commit
to alexandrplashchinsky/ray-alex
that referenced
this pull request
May 29, 2026
…ons (ray-project#63466) ## Summary V2's ``ParquetFileReader._arrow_scanner_kwargs`` was constructing ``pds.ParquetFragmentScanOptions(pre_buffer=False, use_buffered_stream=True, buffer_size=8 MiB)``. With ``pre_buffer=False``, pyarrow opens a per-column buffered stream and issues range requests lazily. On wide-schema Parquet (thousands of small columns) that turns one fragment read into thousands of S3 GETs. The ``wide_schema_pipeline_primitives`` release test regressed from ~16s on V1 to ~154s after V2 became the default reader (ray-project#63326). Other release tests on wide schemas (``wide_schema_pipeline_{tensors,objects,nested_structs}`` and ``write_parquet``, which is read-then-write) are affected by the same mechanism. ## Evidence ``ds.stats()`` from a regressing run on ``s3://ray-benchmark-data-internal-us-west-2/wide_schema/primitives`` (27 files × 22 MB × 5000 columns): ``` Operator 2 ReadFilesParquetV2: 27 tasks executed, 40 blocks produced in 143.19s Remote wall time: 61.73ms min, 141.62s max, 88.67s mean Remote cpu time: 62.07ms min, 4.76s max, 2.96s mean Peak heap memory: 448.82 MiB min, 612.21 MiB max ``` 96% of per-task wall time is blocked, CPU is negligible — the classic many-small-I/O signature, not memory pressure or per-task setup cost. ## Why this only affects V2 - **V1** ``ParquetDatasource`` constructs ``pds.ParquetFragmentScanOptions(use_buffered_stream=True, buffer_size=8 MiB)`` without setting ``pre_buffer`` → pyarrow default ``True`` → one coalesced range request per fragment. Fast. - **Anyscale internal Turbo** ``ParquetReader`` does the same — ``pre_buffer`` left at default. No regression. - **V2 (this PR fixes)** explicitly set ``pre_buffer=False``. On narrow schemas the difference is invisible (few large columns either way). On wide schemas it's catastrophic. The cross-fragment memory accumulation that originally motivated disabling ``pre_buffer`` (apache/arrow#39808) is already addressed by V2's per-fragment scanner construction — so disabling ``pre_buffer`` was load-bearing on a problem that no longer needs that fix. ## Change Drop the ``pre_buffer=False`` argument. Update the comment to record why we rely on the default. No other behavioral change. ## Test plan - [x] pre-commit clean on the modified file - [x] ``python/ray/data/_internal/datasource_v2/tests/test_parquet_datasource_v2.py`` — 11/11 pass - [x] ``python/ray/data/tests/datasource/test_parquet.py`` — 267 passed / 6 skipped Release tests: https://buildkite.com/ray-project/release/builds/93384#_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) Signed-off-by: Goutam <[email protected]> Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]> Signed-off-by: Alexandr Plashchinsky <[email protected]>
400Ping
pushed a commit
to 400Ping/ray
that referenced
this pull request
Aug 18, 2026
…ons (ray-project#63466) ## Summary V2's ``ParquetFileReader._arrow_scanner_kwargs`` was constructing ``pds.ParquetFragmentScanOptions(pre_buffer=False, use_buffered_stream=True, buffer_size=8 MiB)``. With ``pre_buffer=False``, pyarrow opens a per-column buffered stream and issues range requests lazily. On wide-schema Parquet (thousands of small columns) that turns one fragment read into thousands of S3 GETs. The ``wide_schema_pipeline_primitives`` release test regressed from ~16s on V1 to ~154s after V2 became the default reader (ray-project#63326). Other release tests on wide schemas (``wide_schema_pipeline_{tensors,objects,nested_structs}`` and ``write_parquet``, which is read-then-write) are affected by the same mechanism. ## Evidence ``ds.stats()`` from a regressing run on ``s3://ray-benchmark-data-internal-us-west-2/wide_schema/primitives`` (27 files × 22 MB × 5000 columns): ``` Operator 2 ReadFilesParquetV2: 27 tasks executed, 40 blocks produced in 143.19s Remote wall time: 61.73ms min, 141.62s max, 88.67s mean Remote cpu time: 62.07ms min, 4.76s max, 2.96s mean Peak heap memory: 448.82 MiB min, 612.21 MiB max ``` 96% of per-task wall time is blocked, CPU is negligible — the classic many-small-I/O signature, not memory pressure or per-task setup cost. ## Why this only affects V2 - **V1** ``ParquetDatasource`` constructs ``pds.ParquetFragmentScanOptions(use_buffered_stream=True, buffer_size=8 MiB)`` without setting ``pre_buffer`` → pyarrow default ``True`` → one coalesced range request per fragment. Fast. - **Anyscale internal Turbo** ``ParquetReader`` does the same — ``pre_buffer`` left at default. No regression. - **V2 (this PR fixes)** explicitly set ``pre_buffer=False``. On narrow schemas the difference is invisible (few large columns either way). On wide schemas it's catastrophic. The cross-fragment memory accumulation that originally motivated disabling ``pre_buffer`` (apache/arrow#39808) is already addressed by V2's per-fragment scanner construction — so disabling ``pre_buffer`` was load-bearing on a problem that no longer needs that fix. ## Change Drop the ``pre_buffer=False`` argument. Update the comment to record why we rely on the default. No other behavioral change. ## Test plan - [x] pre-commit clean on the modified file - [x] ``python/ray/data/_internal/datasource_v2/tests/test_parquet_datasource_v2.py`` — 11/11 pass - [x] ``python/ray/data/tests/datasource/test_parquet.py`` — 267 passed / 6 skipped Release tests: https://buildkite.com/ray-project/release/builds/93384#_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) Signed-off-by: Goutam <[email protected]> Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]> Signed-off-by: 400Ping <[email protected]>
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
V2's
ParquetFileReader._arrow_scanner_kwargswas constructingpds.ParquetFragmentScanOptions(pre_buffer=False, use_buffered_stream=True, buffer_size=8 MiB). Withpre_buffer=False, pyarrow opens a per-column buffered stream and issues range requests lazily. On wide-schema Parquet (thousands of small columns) that turns one fragment read into thousands of S3 GETs.The
wide_schema_pipeline_primitivesrelease test regressed from ~16s on V1 to ~154s after V2 became the default reader (#63326). Other release tests on wide schemas (wide_schema_pipeline_{tensors,objects,nested_structs}andwrite_parquet, which is read-then-write) are affected by the same mechanism.Evidence
ds.stats()from a regressing run ons3://ray-benchmark-data-internal-us-west-2/wide_schema/primitives(27 files × 22 MB × 5000 columns):96% of per-task wall time is blocked, CPU is negligible — the classic many-small-I/O signature, not memory pressure or per-task setup cost.
Why this only affects V2
ParquetDatasourceconstructspds.ParquetFragmentScanOptions(use_buffered_stream=True, buffer_size=8 MiB)without settingpre_buffer→ pyarrow defaultTrue→ one coalesced range request per fragment. Fast.ParquetReaderdoes the same —pre_bufferleft at default. No regression.pre_buffer=False. On narrow schemas the difference is invisible (few large columns either way). On wide schemas it's catastrophic.The cross-fragment memory accumulation that originally motivated disabling
pre_buffer(apache/arrow#39808) is already addressed by V2's per-fragment scanner construction — so disablingpre_bufferwas load-bearing on a problem that no longer needs that fix.Change
Drop the
pre_buffer=Falseargument. Update the comment to record why we rely on the default. No other behavioral change.Test plan
python/ray/data/_internal/datasource_v2/tests/test_parquet_datasource_v2.py— 11/11 passpython/ray/data/tests/datasource/test_parquet.py— 267 passed / 6 skippedRelease tests: https://buildkite.com/ray-project/release/builds/93384#_
🤖 Generated with Claude Code