Repository navigation
[Data] DSv2 Reorg [0/6]: Remove FileChunker - #66244
Merged
goutamvenkat-anyscale merged 4 commits intoSep 18, 2026
Merged
goutamvenkat-anyscale merged 4 commits into
goutamvenkat-anyscale merged 4 commits into
Conversation
Co-Authored-By: Claude Fable 5.1 <[email protected]> Signed-off-by: Aarrya <[email protected]>
AarryaSaraf
marked this pull request as ready for review
September 17, 2026 20:02
Contributor
There was a problem hiding this comment.
Code Review
This pull request removes the FileChunker abstraction (including WholeFileChunker, LineDelimitedFileChunker, and LineDelimitedFileChunkMetadata) from the DataSourceV2 listing and indexing pipeline. Instead of using a chunker to split files during listing, the FileIndexer now directly batches files into manifests with None chunk metadata, simplifying the listing path. Format-specific indexers (such as the Parquet footer indexer) are expected to handle their own splitting by overriding list_files. Associated unit tests and integration tests have been updated or removed accordingly. I have no further feedback to provide as there are no review comments.
goutamvenkat-anyscale
approved these changes
Sep 18, 2026
AarryaSaraf
added a commit
to AarryaSaraf/ray
that referenced
this pull request
Sep 18, 2026
Same change rebuilt on top of ray-project#66244 (PR 0); the tree is identical to e631f0e. Signed-off-by: Aarrya <[email protected]>
AarryaSaraf
added a commit
to AarryaSaraf/ray
that referenced
this pull request
Sep 18, 2026
Signed-off-by: Aarrya <[email protected]>
goutamvenkat-anyscale
pushed a commit
that referenced
this pull request
Sep 19, 2026
…arquet datasources (#66066) ## Description Second PR of the DSv2 Reorg series (`[0/6]` … `[6/6]`), stacked on #66244 (`[0/6]`); the diff shows both until that one merges. `_read_datasource_v2` in `read_api.py` reads four attributes and calls one method that `DataSourceV2` never declared. Parquet defines them all, so it worked; any other datasource that implemented only the abstract methods failed with `AttributeError` inside the read code. After this PR, implementing the abstract members of `DataSourceV2` is enough for a new datasource to work end to end, and a missing one is reported at construction. No behavior change for Parquet. ```mermaid flowchart LR R[read_api._read_datasource_v2] -->|reads paths, filesystem, file_extensions, shuffle; calls _get_file_indexer| D[DataSourceV2 base class] D -->|abstract: paths, filesystem, _get_file_indexer| S[new datasource subclass] D -->|default None: file_extensions, shuffle| S ``` ### Changes 1. Declare everything the read code uses on `DataSourceV2`: `paths`, `filesystem`, `_get_file_indexer` abstract; `file_extensions`, `shuffle` default `None`. 2. `filesystem` may be `None`, for sources that read through their own library (PyIceberg, Lance, hudi-rs). 3. `FileScanner.prune_manifest` → `Scanner.prune_input_split`, so partition pruning runs for every scanner, not only `FileScanner` subclasses. 4. `FileIndexer` docstring updated for the per-file listing contract left after #66244. ## Additional information Not a duplicate: no open PR changes the `DataSourceV2` base class. #65887 and #65888 also touch `file_indexer.py` / `listing_utils.py`, so expect small merge conflicts there. Tests run locally from this branch (macOS, `~/ray/.venv`), from `python/ray/data`: ``` pytest -q tests/unit/datasource_v2 # 119 passed pytest -q tests/datasource/test_read_parquet_v2.py # 37 passed pytest -q tests/datasource/test_parquet.py # 246 passed, 13 skipped, 34 errors ``` The 34 errors are moto `s3_fs` fixture setup errors (`moto_server` not on PATH), identical on master. `ruff`, `black` and `pydoclint` at the pre-commit pins are clean; `pyrefly` reports the same pre-existing errors as the base commit. Written with Claude Code; I reviewed every changed line and ran the tests above. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Signed-off-by: Aarrya <[email protected]> Co-authored-by: Claude Fable 5.1 <[email protected]>
3 tasks done
nadongjun
pushed a commit
to nadongjun/ray
that referenced
this pull request
Oct 6, 2026
## Why `FileChunker` let a `FileIndexer` split one listed file into several manifest rows. Nothing uses that seam any more: Parquet splits by row group inside `FooterFileIndexer`'s footer read, every other indexer emits one row per file, and `FilePartitioner` groups files into read tasks. What remained was an abstract property every indexer had to implement, a `WholeFileChunker` that returned its input unchanged, and a `LineDelimitedFileChunker` with no callers outside its own tests. First PR of the DSv2 reorg series; ray-project#66066 and the follow-ups will be rebased onto it. ## What changes - Delete `FileChunker`, `WholeFileChunker`, `LineDelimitedFileChunker` and `LineDelimitedFileChunkMetadata`. The module keeps the manifest metadata types (`ChunkMetadata`, `create_chunk_metadata`, `ParquetRowGroupChunkMetadata`) that `OnlineBinPacker`, `FooterFileIndexer` and `FileManifest` still use. Files: `datasource_v2/chunkers/file_chunker.py` - `FileIndexer` drops the abstract `file_chunker` property. `NonSamplingFileIndexer` drops the constructor argument and property, and emits one manifest row per file with `None` chunk metadata. Files: `datasource_v2/listing/file_indexer.py` - Remove two stale comments naming a `StreamingFileChunker` that never existed. Files: `datasource_v2/readers/parquet_file_reader.py`, `logical/operators/read_operator.py` - Tests: `test_file_chunker.py` becomes `test_chunk_metadata.py` (metadata types only); chunker cases dropped from `test_file_indexer.py` and `test_read_parquet_v2.py`. ## Example Before, an indexer that lists whole files still had to answer the chunker question: ```python class MyIndexer(FileIndexer): @Property def file_chunker(self) -> FileChunker: # required; always WholeFileChunker() return WholeFileChunker() def list_files(self, ctx): ... ``` After: ```python class MyIndexer(FileIndexer): def list_files(self, ctx): ... ``` `read_parquet` behaviour is unchanged: `FooterFileIndexer` never used the chunker it inherited. Net diff is +37 / −287 lines. ## Checks Lint: ruff, ruff `--select I`, black, pydoclint with the CI flags, `git diff --check`. Type check: pyrefly on `python/ray/data`, no errors in the touched files. Tests run locally: ``` pytest python/ray/data/tests/unit/datasource_v2 # 217 passed pytest python/ray/data/tests/datasource/test_read_parquet_v2.py # 37 passed pytest python/ray/data/tests/test_parquet.py # 246 passed, 13 skipped (34 pre-existing moto fixture errors) pytest python/ray/data/tests/test_execution_optimizer_limit_pushdown.py # 28 passed pytest python/ray/data/tests/test_predicate_pushdown.py # 51 passed, 2 skipped ``` Not a duplicate: the only open PR mentioning `FileChunker` is ray-project#66066, my own follow-up in this series. ray-project#64540 (ORC) adds an `OrcFileChunker` and will need to drop it when it rebases. Written with AI assistance (Claude Code). Every changed line was reviewed by me and the tests above were run locally. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Signed-off-by: Aarrya <[email protected]> Co-authored-by: Claude Fable 5.1 <[email protected]>
nadongjun
pushed a commit
to nadongjun/ray
that referenced
this pull request
Oct 6, 2026
…arquet datasources (ray-project#66066) ## Description Second PR of the DSv2 Reorg series (`[0/6]` … `[6/6]`), stacked on ray-project#66244 (`[0/6]`); the diff shows both until that one merges. `_read_datasource_v2` in `read_api.py` reads four attributes and calls one method that `DataSourceV2` never declared. Parquet defines them all, so it worked; any other datasource that implemented only the abstract methods failed with `AttributeError` inside the read code. After this PR, implementing the abstract members of `DataSourceV2` is enough for a new datasource to work end to end, and a missing one is reported at construction. No behavior change for Parquet. ```mermaid flowchart LR R[read_api._read_datasource_v2] -->|reads paths, filesystem, file_extensions, shuffle; calls _get_file_indexer| D[DataSourceV2 base class] D -->|abstract: paths, filesystem, _get_file_indexer| S[new datasource subclass] D -->|default None: file_extensions, shuffle| S ``` ### Changes 1. Declare everything the read code uses on `DataSourceV2`: `paths`, `filesystem`, `_get_file_indexer` abstract; `file_extensions`, `shuffle` default `None`. 2. `filesystem` may be `None`, for sources that read through their own library (PyIceberg, Lance, hudi-rs). 3. `FileScanner.prune_manifest` → `Scanner.prune_input_split`, so partition pruning runs for every scanner, not only `FileScanner` subclasses. 4. `FileIndexer` docstring updated for the per-file listing contract left after ray-project#66244. ## Additional information Not a duplicate: no open PR changes the `DataSourceV2` base class. ray-project#65887 and ray-project#65888 also touch `file_indexer.py` / `listing_utils.py`, so expect small merge conflicts there. Tests run locally from this branch (macOS, `~/ray/.venv`), from `python/ray/data`: ``` pytest -q tests/unit/datasource_v2 # 119 passed pytest -q tests/datasource/test_read_parquet_v2.py # 37 passed pytest -q tests/datasource/test_parquet.py # 246 passed, 13 skipped, 34 errors ``` The 34 errors are moto `s3_fs` fixture setup errors (`moto_server` not on PATH), identical on master. `ruff`, `black` and `pydoclint` at the pre-commit pins are clean; `pyrefly` reports the same pre-existing errors as the base commit. Written with Claude Code; I reviewed every changed line and ran the tests above. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Signed-off-by: Aarrya <[email protected]> Co-authored-by: Claude Fable 5.1 <[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.
Why
FileChunkerlet aFileIndexersplit one listed file into several manifest rows. Nothing uses that seam any more: Parquet splits by row group insideFooterFileIndexer's footer read, every other indexer emits one row per file, andFilePartitionergroups files into read tasks. What remained was an abstract property every indexer had to implement, aWholeFileChunkerthat returned its input unchanged, and aLineDelimitedFileChunkerwith no callers outside its own tests.First PR of the DSv2 reorg series; #66066 and the follow-ups will be rebased onto it.
What changes
FileChunker,WholeFileChunker,LineDelimitedFileChunkerandLineDelimitedFileChunkMetadata. The module keeps the manifest metadata types (ChunkMetadata,create_chunk_metadata,ParquetRowGroupChunkMetadata) thatOnlineBinPacker,FooterFileIndexerandFileManifeststill use.Files:
datasource_v2/chunkers/file_chunker.pyFileIndexerdrops the abstractfile_chunkerproperty.NonSamplingFileIndexerdrops the constructor argument and property, and emits one manifest row per file withNonechunk metadata.Files:
datasource_v2/listing/file_indexer.pyStreamingFileChunkerthat never existed.Files:
datasource_v2/readers/parquet_file_reader.py,logical/operators/read_operator.pytest_file_chunker.pybecomestest_chunk_metadata.py(metadata types only); chunker cases dropped fromtest_file_indexer.pyandtest_read_parquet_v2.py.Example
Before, an indexer that lists whole files still had to answer the chunker question:
After:
read_parquetbehaviour is unchanged:FooterFileIndexernever used the chunker it inherited. Net diff is +37 / −287 lines.Checks
Lint: ruff, ruff
--select I, black, pydoclint with the CI flags,git diff --check. Type check: pyrefly onpython/ray/data, no errors in the touched files.Tests run locally:
Not a duplicate: the only open PR mentioning
FileChunkeris #66066, my own follow-up in this series. #64540 (ORC) adds anOrcFileChunkerand will need to drop it when it rebases.Written with AI assistance (Claude Code). Every changed line was reviewed by me and the tests above were run locally.
🤖 Generated with Claude Code