Skip to content

feat(transaction): Support snapshot validation #1353

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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

CTTY
Copy link
Contributor

@CTTY CTTY commented May 19, 2025

Which issue does this PR close?

What changes are included in this PR?

  • Added snapshot validation logic of validating history between snapshot X and the parent snapshot
  • Added SnapshotValidator to hold these logic

Are these changes tested?

  • Added unit tests

@CTTY CTTY force-pushed the ctty/ss-validation branch from d98f807 to 1e82327 Compare May 19, 2025 22:28
@CTTY CTTY marked this pull request as ready for review May 19, 2025 22:46
@jonathanc-n
Copy link
Contributor

I'll tkae a look later today!

Comment on lines +31 to +33
base: &Table,
to_snapshot: &SnapshotRef,
from_snapshot: Option<&SnapshotRef>,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think should swap to and from here, @sungwy cleaned up my original implementation via https://github.com/apache/iceberg-python/pull/1959/files

main

Comment on lines +85 to +87
fn ancestors_between(
to_snapshot: &SnapshotRef,
from_snapshot: Option<&SnapshotRef>,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this live somewhere else? idrk but it does in the python impl

Also the to and from are swapped

Also might be more readable to refactor out the ancestors_of logic like we have in python

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I believe the validation should be a part of snapshot producing that happens when committing certain transaction actions.

This work has been paused and we are trying to make iceberg-rust able to write data first: #1382
I'll certain check out pyiceberg when resuming this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants