kevinjqliu commented on code in PR #575:
URL: https://github.com/apache/iceberg-go/pull/575#discussion_r2379636309


##########
table/metadata.go:
##########
@@ -1313,6 +1366,14 @@ func (c *commonMetadata) validate() error {
 
        c.constructRefs()
 
+       if err := c.checkMainRefMatchesCurrentSnapshot(); err != nil {
+               return err
+       }

Review Comment:
   Reading the spec and from the info above (thx btw), im interpreting the 
`ref` to be a weak reference of the `current-snapshot-id`. The 
`current-snapshot-id` is the source of truth and the `main` branch just refers 
to whatever its set to
   
   See this SetSnapshotOperation op:
   
https://github.com/apache/iceberg/blob/fbb7136fa9c0605ed2553053606276857c306f99/core/src/main/java/org/apache/iceberg/SetSnapshotOperation.java#L123
   
   and the doc from `refs`
   <img width="681" height="236" alt="Screenshot 2025-09-25 at 8 51 06 AM" 
src="https://github.com/user-attachments/assets/d518d03f-5a81-497e-b768-67e6438f8833";
 />
   



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