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

 ##########
 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:
   V1 writers should not pass any sequence number other than 0, and it won't 
get written to the file even though it is compatible. And reading v1 metadata 
should always fill in the sequence number with 0.

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