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

 ##########
 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:
   It used the `ManifestWriter` factory method that created a snapshot with ID 
-1. Any writer that did this and appended the manifest could get in a bad state 
by picking up previously staged changes, not just Flink.

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