aokolnychyi commented on a change in pull request #910: Update Snapshot and 
TableMetadata with sequence numbers
URL: https://github.com/apache/incubator-iceberg/pull/910#discussion_r406941346
 
 

 ##########
 File path: core/src/main/java/org/apache/iceberg/TableMetadata.java
 ##########
 @@ -197,14 +200,16 @@ public String toString() {
                 List<MetadataLogEntry> previousFiles) {
     Preconditions.checkArgument(formatVersion <= 
SUPPORTED_TABLE_FORMAT_VERSION,
         "Unsupported format version: v%s", formatVersion);
-    if (formatVersion > 1) {
-      Preconditions.checkArgument(uuid != null, "UUID is required in format 
v%s", formatVersion);
-    }
+    Preconditions.checkArgument(formatVersion == 1 || uuid != null,
+        "UUID is required in format v%s", formatVersion);
+    Preconditions.checkArgument(formatVersion > 1 || lastSequenceNumber == 0,
+        "Sequence number must be 0 in v1: %s", lastSequenceNumber);
 
 Review comment:
   So, v1 writers will only be allowed to write sequence numbers as 0 and we 
will assume 0 as sequence numbers in metadata entities without an explicit 
value, correct?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to