Skip to content

feat: Add refresh to get get updated TableMetadata #1154

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 5 commits into
base: main
Choose a base branch
from

Conversation

jonathanc-n
Copy link
Contributor

Which issue does this PR close?

What changes are included in this PR?

Added basic conflict detection. The current idea is that before commit we can use catalog to refresh the table state before commit to compare with the base metadata.

@jonathanc-n jonathanc-n marked this pull request as draft April 2, 2025 02:38
@jonathanc-n
Copy link
Contributor Author

Is this on track with what we want? cc @liurenjie1024 @Fokko @ZENOTME

@Fokko
Copy link
Contributor

Fokko commented Apr 2, 2025

@jonathanc-n This is the very first step, and we indeed want this.

I don't think this is the actual conflict detection. When between the fast_append() and commit() something changes, it will still trigger a conflict. A next step will be to do basic conflict detection, and check if the operations are compatible. For example, such as: apache/iceberg-python#1772, see apache/iceberg-python#1678.

Copy link
Contributor

@ZENOTME ZENOTME left a comment

Choose a reason for hiding this comment

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

Thanks @jonathanc-n! I think this PR can be more about add refresh op for table. And as I describe below, it may more appropriate to delay the transaction part after #949.

@@ -127,12 +127,14 @@ impl<'a> Transaction<'a> {
}

/// Creates a fast append action.
pub fn fast_append(
pub async fn fast_append(
Copy link
Contributor

Choose a reason for hiding this comment

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

According to iceberg-java, looks like we don't need to refresh here. The lifecycle of a transaction looks like this:

I think can delay this part after #949. cc @Fokko @liurenjie1024

@jonathanc-n
Copy link
Contributor Author

@Fokko @ZENOTME Yeah will change title, I just wanted to open this to discuss what our plan was for the conflict detection.

@jonathanc-n jonathanc-n changed the title feat: Add basic conflict detection feat: Add refresh to get get update TableMetadata Apr 2, 2025
@jonathanc-n jonathanc-n changed the title feat: Add refresh to get get update TableMetadata feat: Add refresh to get get updated TableMetadata Apr 2, 2025
@jonathanc-n jonathanc-n marked this pull request as ready for review April 8, 2025 20:46
@jonathanc-n
Copy link
Contributor Author

Is there an easy way to be able to create dummy catalog instances and pass them into new table instances for testing?

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