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


##########
table/metadata.go:
##########
@@ -1670,6 +1711,106 @@ func (m *metadataV2) checkLastSequenceNumber() error {
        return nil
 }
 
+// metadataV3 represents table metadata for format version 3
+type metadataV3 struct {
+       LastSeqNum     int64 `json:"last-sequence-number"`
+       NextRowIDValue int64 `json:"next-row-id"`
+
+       commonMetadata
+}
+
+func initMetadataV3Deser() *metadataV3 {
+       return &metadataV3{
+               LastSeqNum:     -1,
+               NextRowIDValue: -1,
+               commonMetadata: initCommonMetadataForDeserialization(),
+       }
+}
+
+func (m *metadataV3) LastSequenceNumber() int64 { return m.LastSeqNum }
+func (m *metadataV3) NextRowID() int64 {
+       if m.NextRowIDValue == -1 {
+               return 0 // RFor v1/v2 compatibility when field is missing
+       }
+       return m.NextRowIDValue

Review Comment:
   ```suggestion
        return max(0, m.NextRowIDValue)
   ```
   
   maybe?



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