rdblue commented on a change in pull request #4071:
URL: https://github.com/apache/iceberg/pull/4071#discussion_r835971671



##########
File path: core/src/main/java/org/apache/iceberg/MetadataUpdate.java
##########
@@ -230,24 +230,28 @@ public void applyTo(TableMetadata.Builder 
metadataBuilder) {
 
   class SetSnapshotRef implements MetadataUpdate {
     private final String name;
-    private final long snapshotId;
+    private final SnapshotRef ref;
 
-    public SetSnapshotRef(String name, long snapshotId) {
+    public SetSnapshotRef(String name, SnapshotRef ref) {
       this.name = name;
-      this.snapshotId = snapshotId;
+      this.ref = ref;
     }
 
     public String name() {
       return name;
     }
 
     public long snapshotId() {
-      return snapshotId;
+      return ref.snapshotId();
     }
 
     @Override
     public void applyTo(TableMetadata.Builder metadataBuilder) {
-      metadataBuilder.setBranchSnapshot(snapshotId, name);
+      if (ref.isTag()) {
+        metadataBuilder.setTag(name, ref);
+      } else {
+        metadataBuilder.setBranchSnapshot(ref.snapshotId(), name);

Review comment:
       This isn't correct. This needs to create a tag or branch based on the 
existing one in `metadataBuilder` and set the fields that are non-null in this 
object.




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to