amogh-jahagirdar commented on code in PR #4071:
URL: https://github.com/apache/iceberg/pull/4071#discussion_r846865052


##########
core/src/main/java/org/apache/iceberg/TableMetadata.java:
##########
@@ -1305,15 +1329,23 @@ private void setBranchSnapshotInternal(Snapshot 
snapshot, String branch) {
         snapshotLog.add(new SnapshotLogEntry(lastUpdatedMillis, 
replacementSnapshotId));
       }
 
-      SnapshotRef newRef;
+      SnapshotRef.Builder newRefBuilder;
       if (ref != null) {
-        newRef = SnapshotRef.builderFrom(ref, replacementSnapshotId).build();
+        newRefBuilder = SnapshotRef.builderFrom(ref, replacementSnapshotId);
       } else {
-        newRef = SnapshotRef.branchBuilder(replacementSnapshotId).build();
+        newRefBuilder = SnapshotRef.branchBuilder(replacementSnapshotId);
       }
 
+      SnapshotRef newRef = newRefBuilder.minSnapshotsToKeep(minSnapshotsToKeep)
+          .maxSnapshotAgeMs(maxSnapshotAgeMs)
+          .maxRefAgeMs(maxRefAgeMs)
+          .build();
+
+      MetadataUpdate.SetSnapshotRef refUpdate =
+          new MetadataUpdate.SetSnapshotRef(branch, newRef.snapshotId(), 
newRef.type(),
+              newRef.minSnapshotsToKeep(), newRef.maxSnapshotAgeMs(), 
newRef.maxRefAgeMs());

Review Comment:
   Updated! 



-- 
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