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


##########
table/metadata.go:
##########
@@ -354,11 +354,10 @@ func (b *MetadataBuilder) AddSnapshot(snapshot *Snapshot) 
error {
        } else if s, _ := b.SnapshotByID(snapshot.SnapshotID); s != nil {
                return fmt.Errorf("can't add snapshot with id %d, already 
exists", snapshot.SnapshotID)
        } else if b.formatVersion == 2 &&
-               snapshot.SequenceNumber > 0 &&
                snapshot.ParentSnapshotID != nil &&
                snapshot.SequenceNumber <= *b.lastSequenceNumber {
                return fmt.Errorf("can't add snapshot with sequence number %d, 
must be > than last sequence number %d",
-                       snapshot.SequenceNumber, b.lastSequenceNumber)
+                       snapshot.SequenceNumber, *b.lastSequenceNumber)

Review Comment:
   If we know that we're on version 2 and that we should never be nil in 
version 2 then I'm okay with forgoing the nil check for now.



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