aokolnychyi commented on a change in pull request #675: Inherit snapshot ids 
for manifest entries
URL: https://github.com/apache/incubator-iceberg/pull/675#discussion_r371891978
 
 

 ##########
 File path: core/src/main/java/org/apache/iceberg/BaseRewriteManifests.java
 ##########
 @@ -129,17 +134,23 @@ public RewriteManifests deleteManifest(ManifestFile 
manifest) {
 
   @Override
   public RewriteManifests addManifest(ManifestFile manifest) {
-    try {
-      // the appended manifest must be rewritten with this update's snapshot ID
-      addedManifests.add(copyManifest(manifest));
-    } catch (IllegalArgumentException e) {
-      throw new IllegalArgumentException("Cannot append manifest: " + 
e.getMessage());
+    Preconditions.checkArgument(!manifest.hasAddedFiles(), "Cannot add 
manifest with added files");
+    Preconditions.checkArgument(!manifest.hasDeletedFiles(), "Cannot add 
manifest with deleted files");
+    Preconditions.checkArgument(manifest.snapshotId() == null, "Snapshot id 
must be assigned during commit");
 
 Review comment:
   I think it is reasonable. I updated the condition to allow -1.  Right now, 
if inheritance is enabled but snapshot ID is -1, we will still rewrite the 
manifest.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to