-
Notifications
You must be signed in to change notification settings - Fork 183
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
Add apply interface in transaction #596
Comments
We can implement the update_table_metadata based on #587. cc @liurenjie1024 @Xuanwo @Fokko @c-thiel |
Hi, @ZENOTME Could you elaborate on this? I'm kind of confusing about the proposal. |
For now, transaction can't reflect the update in time so we can stack them together.
But In pyiceberg, above behaviour will only send one UpgradeFormatVersion and the second one will see that the metadata of table has been updated. The update will be apply into local medata and reflect the change first. |
We have check to avoid such duplicated case. For metastore tables, it's supposed to apply transaction actions in local, and update metastore pointer. For rest catalog, it should be sent to rest catalog server. |
Why for rest catalog, it should be sent to rest catalog server.🤔 |
Sorry, I don't quite get the point, if updates are sent to rest catalog server, why we need to update it in local first? |
E.g. the user wants to batch multiple updates and commit them once. For the following, after
|
This still don't answer in what case we need to apply the updates in local before sending to rest catalog server, the rest catalog spec allows for sending multi updates as one transaction: https://github.com/apache/iceberg/blob/6319712b612b724fedbc5bed41942ac3426ffe48/open-api/rest-catalog-open-api.yaml#L705 |
Let's use the following pyiceberg example to illustrate that there may be an error in multiple updates if we do not apply the update locally before sending it to rest catalog server.
If we comment out on the https://github.com/apache/iceberg-python/blob/e891bcddb1584c6b7a35b61537ab5802b514ec6d/pyiceberg/table/__init__.py#L276 to cancel update locally, we can see the unexpected result happened.
This is my understanding for originally posted by @Fokko in #349 (comment). Please correct me if there are something wrong here. |
Thanks @ZENOTME 's explaination. I think I've got your point, we need sth like |
Originally posted by @Fokko in #349 (comment)
Transaction should be able reflect the update in time. According to pyiceberg, we can provide a apply interface to update the table metedata.
The text was updated successfully, but these errors were encountered: