twuebi commented on code in PR #575:
URL: https://github.com/apache/iceberg-go/pull/575#discussion_r2370350089
##########
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:
Not sure what error to return tho, that'd be a bug in our implementation, I
don't think returning an error in that situation is helpful? I think we may be
in this situation?
https://burntsushi.net/unwrap/#why-not-return-an-error-instead-of-panicking
--
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]