[Data] Generate sortable, collision-resistant Dataset IDs - #65075
Open
yuhuan130 wants to merge 1 commit into
Open
[Data] Generate sortable, collision-resistant Dataset IDs#65075yuhuan130 wants to merge 1 commit into
yuhuan130 wants to merge 1 commit into
Conversation
Signed-off-by: Alex Chien <alexchien130@gmail.com>
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces time-sortable, practically unique Dataset ULIDs encoded in Base62, replacing the legacy counter-based Dataset IDs by default, while providing a configuration option to fall back to the legacy behavior. The review feedback focuses on improving robustness and compatibility, specifically by replacing parenthesized context managers in tests to maintain Python 3.8 compatibility, optimizing the Base62 encoding function to avoid string concatenation in a loop, and using getattr when accessing use_legacy_dataset_ids to prevent potential AttributeErrors during initialization and deserialization.
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.
Description
This PR replaces counter-based Dataset IDs with 22-character, Base62-encoded ULIDs.
Each ULID contains a timestamp and random data, making it sortable by creation time and practically collision-free.
The full ID format remains:
{dataset_name}_{dataset_ulid}_{run_index}This PR also:
RAY_DATA_USE_LEGACY_DATASET_IDSas a temporary compatibility option.Tests
Focused Dataset ID tests:
5 passedAlso updates
test_dataset_id_train_ingesttest inpython/ray/data/tests/test_stats.pyto verify that the same generated Dataset ID is used across epochs while the run index increases.Closes #65073