You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2022/02/14 19:15:00 UTC

[GitHub] [iceberg] jackye1995 edited a comment on pull request #4071: API: Add UpdateSnapshotRefs to API

jackye1995 edited a comment on pull request #4071:
URL: https://github.com/apache/iceberg/pull/4071#issuecomment-1038765579


   Sorry @rdblue was a bit late to reply, I agree with the proposal about:
   
   ```
       Add createBranch, replaceBranch, removeBranch, and renameBranch
       Add createTag, replaceTag and removeTag (not renameTag because it doesn't make much sense, right?)
       Add rollbackTo(String branchName, long snapshotId)
       Add cherrypick(String branchName, long snapshotId)
       Add cherrypick(String branchName, String tagName)
       Add cherrypickAll(String branchName, String branchName)
   ```
   
   I was thinking to have all the fancy operations like rollback that mixes branch, tag and snapshot ID to a higher level API (and we can use `ManageSnapshots` API if fit) and have one lower level API (this one) that handles the basic ref-only operations, but having them at the same place also works. But I would say we should be careful about mixing snapshot updates and metadata updates. More is elaborated later.
   
   For the issue that the original `branch` and `tag` creation APIs does not have verbs, that's probably my bad English, I thought branch could be used as a verb. Having `create`, `replace`, `remove` for each ref type and `rename` for branch makes sense. What do you think about the API methods setting tag and branch parameters? I think they are still needed.
   
   Going back to the cherry-picking related operations, the fundamental difference of it from the other ones is that it produces a new snapshot with a new manifest list based on the cherry-picked snapshot information. What exactly is our semantics for cherry-picking? If I map it to Git, it is to reapply the same file changes to a different commit. So in Iceberg, suppose I have 2 snapshots produced by `AppendFiles(f1, f2), DeletFiles(f3)` at branch `dev`, then I do `cherryPickAll("main", "dev")`, then I would do `AppendFiles(f1, f2), DeletFiles(f3)` to `main`? Then would `cherryPickAll` be just a fancy wrapper of
   
   ```
   table.newTransaction()
     .appendFiles(f1, f2)
     .deleteFiles(f3)
     .commit("main")
   ```
   
   If the semantics of cheery-picking is different from the experience above, how would that experience be?
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org