You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2022/07/10 19:59:20 UTC

[GitHub] [iceberg] bryanck commented on a diff in pull request #5235: REST: Create commit catalog handler fix

bryanck commented on code in PR #5235:
URL: https://github.com/apache/iceberg/pull/5235#discussion_r917440086


##########
core/src/main/java/org/apache/iceberg/TableMetadata.java:
##########
@@ -985,10 +1012,12 @@ public Builder addSnapshot(Snapshot snapshot) {
         return this;
       }
 
+      ValidationException.check(!schemas.isEmpty(), "Attempting to add a snapshot before a schema is added");
+      ValidationException.check(!specs.isEmpty(), "Attempting to add a snapshot before a partition spec is added");
+      ValidationException.check(!sortOrders.isEmpty(), "Attempting to add a snapshot before a sort order is added");

Review Comment:
   When building metadata from empty, the table specs aren't initialized. These assertions ensure they are set before adding files, so files added during a transaction line up with the table specs.



-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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