-
Notifications
You must be signed in to change notification settings - Fork 7.6k
[data] DataSourceV2: V2 checkpoint filter integration #63172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
goutamvenkat-anyscale
merged 1 commit into
ray-project:master
from
goutamvenkat-anyscale:pr63172
May 11, 2026
+74
−1
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
47 changes: 47 additions & 0 deletions
47
python/ray/data/_internal/planner/checkpoint/plan_read_files_op.py
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| """Checkpoint-aware planner for the V2 ``ReadFiles`` logical operator. | ||
|
|
||
| Mirrors :func:`plan_read_op_with_checkpoint_filter` (the V1 ``Read`` | ||
| variant) so V2 uses the same wrapping ActorPool ``CheckpointFilter`` | ||
| ``MapOperator`` downstream of the read: same | ||
| ``_CheckpointFilterFn`` / ``_get_checkpoint_map_transformer``, same | ||
| memory reservation formula, and ``supports_fusion=False`` so the | ||
| filter stays a distinct op. | ||
|
|
||
| Registered via ``Planner._get_plan_fns_for_checkpointing`` so it only | ||
| runs when ``DataContext.checkpoint_config`` is set *and* the logical | ||
| plan is a ``Write`` or ``StreamingSplit`` with a ``ReadFiles`` at the | ||
| leaf. V2's plain ``plan_read_files_op`` stays checkpoint-unaware; this | ||
| file is the only place V2 reads pick up a checkpoint filter. | ||
| """ | ||
| from typing import List, Optional | ||
|
|
||
| import pyarrow | ||
| import pyarrow.fs | ||
|
|
||
| from ray.data._internal.execution.interfaces import PhysicalOperator | ||
| from ray.data._internal.logical.operators import ReadFiles | ||
| from ray.data._internal.planner.checkpoint.plan_read_op import ( | ||
| create_checkpoint_filter_op, | ||
| ) | ||
| from ray.data._internal.planner.plan_read_files_op import plan_read_files_op | ||
| from ray.data.context import DataContext | ||
|
|
||
|
|
||
| def plan_read_files_op_with_checkpoint_filter( | ||
| data_file_dir: Optional[str], | ||
| data_file_filesystem: Optional["pyarrow.fs.FileSystem"], | ||
| op: ReadFiles, | ||
| physical_children: List[PhysicalOperator], | ||
| data_context: DataContext, | ||
| ) -> PhysicalOperator: | ||
| """Wrap a V2 ``ReadFiles`` physical op with a ``CheckpointFilter``. | ||
|
|
||
| Defers all wrapping behavior to V1's :func:`create_checkpoint_filter_op` | ||
| so the not-found short-circuit, ``IdColumnCheckpointManager.load_checkpoint`` | ||
| invocation, actor-pool sizing, and ``supports_fusion=False`` placement stay | ||
| in one place across the V1 and V2 read paths. | ||
| """ | ||
| physical_read_op = plan_read_files_op(op, physical_children, data_context) | ||
| return create_checkpoint_filter_op( | ||
| physical_read_op, data_context, data_file_dir, data_file_filesystem | ||
| ) |
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.