-
Notifications
You must be signed in to change notification settings - Fork 44
feat: Add stream_timestamp support and timestamp-based delta listing #595
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
Closed
IvanPartsunev
wants to merge
9
commits into
ray-project:2.0
from
IvanPartsunev:feature/add-stream-timestam-to-delta
Closed
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
c5e419d
Add `stream_timestamp` property and validation to Delta and DeltaLocator
IvanPartsunev 8ab8f7b
Add `list_partition_deltas_by_timestamp` method to support delta list…
IvanPartsunev f689490
Add tests for `list_partition_deltas_by_timestamp` method in various …
IvanPartsunev 16a15c5
Add `get_latest_delta_by_timestamp` method to fetch latest delta by c…
IvanPartsunev 235e4d0
Add tests for `get_latest_delta_by_timestamp` covering various scenarios
IvanPartsunev 970ce69
fix: Remove unused variables in tests to pass flake8
IvanPartsunev 857cbe0
test: Add unit tests for Delta and DeltaLocator stream_timestamp prop…
IvanPartsunev 809541b
test: Reformat `pytest.raises` statements in DeltaLocator stream_time…
IvanPartsunev 1a77eef
fix: Exclude streamTimestamp from Metafile equivalence check
IvanPartsunev 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
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
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.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking back on it, this comment has been incorrect since ADD deltas were introduced:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it’s a good idea to introduce CHRONO-type deltas with the corresponding write mode. Since CHRONO deltas will follow the same behavior as ADD deltas, this shouldn’t add implementation complexity or interfere with the existing delta types.
The key difference should be that CHRONO deltas must have their previous stream position set, unlike ADD deltas. This shouldn’t interfere with writing, and it should still allow delta writes without concurrency issues. Eventually, this delta type could behave like ordered deltas and be used for upsert and delete operations.
What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm... I'm not sure how we set a consistent/correct previous delta stream position without also requiring serialized writes of CHRONO deltas. APPEND deltas currently get it from the parent partition's latest stream position (https://github.com/ray-project/deltacat/blob/2.0/deltacat/storage/main/impl.py#L2787), which then requires synchronous updates to the partition on each append to keep accurate (https://github.com/ray-project/deltacat/blob/2.0/deltacat/storage/main/impl.py#L2799-L2801). I think this would make the CHRONO delta behave more like an APPEND, and result in either (1) serial/ordered writes of each CHRONO delta or (2) an eventually consistent reconciliation mechanism to "backfill" previous stream positions after CHRONO deltas have been appended. Maybe there's another way of doing this that I'm missing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I were thinking for setting it just like the append, but probably I'm missing a key point there. I will investigate deeper.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that I’ve revisited the conversation, I realize I misunderstood — I was probably in some kind of tunnel vision. Nevertheless, I now understand the full picture.
I will be able to implement the CHRONO type delta, for which list_partition_delta should work and return an ordered result. From there, it will be easy if someone wants the latest delta of a stream — it will be accessible through the list manually. Sadly, get_latest_delta won’t work for CHRONO.
In the future, it might be possible to create some kind of backfill job to populate previousStreamPosition for CHRONO. I have some ideas, but I need to distill them a bit more.
I will close this pull request since it is no longer relevant.