badalprasadsingh commented on code in PR #1601:
URL: https://github.com/apache/iceberg-go/pull/1601#discussion_r3685350077


##########
table/metadata.go:
##########
@@ -908,6 +908,23 @@ func (b *MetadataBuilder) SetSnapshotRef(
                        return fmt.Errorf("%w: invalid snapshot ref option: 
%w", iceberg.ErrInvalidArgument, err)
                }
        }
+
+       // preserve retention properties from an existing ref when not 
explicitly overridden by caller
+       if existingRef, ok := b.refs[name]; ok && existingRef.SnapshotRefType 
== refType {

Review Comment:
   Done.
   
   You are right. Now, `NewRetainingSnapshotRefUpdate` is called both from 
`commitManifests` and `RollbackToSnapshot`, which reads the current ref's 
retention and passes it explicitly into `NewSetSnapshotRefUpdate`.
   
   So the emitted update is fully specified, `Apply` stays a pure replace 
(absent retention = clear, matching Java's `setRef`), and clearing is 
representable again.
   
   There was no reason to keep it in `SetSnapshotRef` other than fewer 
call-site touch-points.



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