rdblue commented on a change in pull request #1101:
URL: https://github.com/apache/iceberg/pull/1101#discussion_r467142266



##########
File path: core/src/test/java/org/apache/iceberg/TestMergeAppend.java
##########
@@ -121,56 +156,86 @@ public void testMergeWithAppendFilesAndManifest() throws 
IOException {
 
     TableMetadata base = readMetadata();
     Assert.assertNull("Should not have a current snapshot", 
base.currentSnapshot());
+    Assert.assertEquals("Last sequence number should be 0", 0, 
base.lastSequenceNumber());
 
     ManifestFile manifest = writeManifest(FILE_A, FILE_B);
-    Snapshot pending = table.newAppend()
+    table.newAppend()
         .appendFile(FILE_C)
         .appendFile(FILE_D)
         .appendManifest(manifest)
-        .apply();
+        .commit();
+
+    Snapshot committedSnapshot = table.currentSnapshot();
+    Assert.assertNotNull("Should create a snapshot", table.currentSnapshot());
+    V1Assert.assertEquals("Last sequence number should be 0", 0, 
table.ops().current().lastSequenceNumber());
+    V2Assert.assertEquals("Last sequence number should be 1", 1, 
table.ops().current().lastSequenceNumber());
 
-    long pendingId = pending.snapshotId();
+    long snapshotId = committedSnapshot.snapshotId();
 
-    Assert.assertEquals("Should create 1 merged manifest", 1, 
pending.allManifests().size());
-    validateManifest(pending.allManifests().get(0),
-        ids(pendingId, pendingId, pendingId, pendingId),
-        files(FILE_C, FILE_D, FILE_A, FILE_B));
+    Assert.assertEquals("Should create 1 merged manifest", 1, 
committedSnapshot.allManifests().size());
+
+    validateManifest(committedSnapshot.allManifests().get(0),
+        seqs(1, 1, 1, 1),
+        ids(snapshotId, snapshotId, snapshotId, snapshotId),
+        files(FILE_C, FILE_D, FILE_A, FILE_B),
+        statuses(Status.ADDED, Status.ADDED, Status.ADDED, Status.ADDED)
+    );
   }
 
   @Test
   public void testMergeWithExistingManifest() {
     // merge all manifests for this test
     table.updateProperties().set("commit.manifest.min-count-to-merge", 
"1").commit();
-
+    V1Assert.assertEquals("Last sequence number should be 0", 0, 
readMetadata().lastSequenceNumber());
+    V2Assert.assertEquals("Last sequence number should be 0", 0, 
readMetadata().lastSequenceNumber());
     Assert.assertEquals("Table should start empty", 0, 
listManifestFiles().size());
 
     table.newAppend()
         .appendFile(FILE_A)
         .appendFile(FILE_B)
         .commit();
 
+    Assert.assertNotNull("Should create a snapshot", table.currentSnapshot());
+    V1Assert.assertEquals("Last sequence number should be 0", 0, 
table.ops().current().lastSequenceNumber());
+    V2Assert.assertEquals("Last sequence number should be 1", 1, 
table.ops().current().lastSequenceNumber());
+
     TableMetadata base = readMetadata();
-    long baseId = base.currentSnapshot().snapshotId();
+    Snapshot commitBefore = table.currentSnapshot();
+    long baseId = commitBefore.snapshotId();
+    validateSnapshot(null, commitBefore, 1, FILE_A, FILE_B);
+
     Assert.assertEquals("Should create 1 manifest for initial write",
-        1, base.currentSnapshot().allManifests().size());
+        1, commitBefore.allManifests().size());
     ManifestFile initialManifest = 
base.currentSnapshot().allManifests().get(0);
+    validateManifest(initialManifest,
+        seqs(1, 1),
+        ids(baseId, baseId),
+        files(FILE_A, FILE_B),
+        statuses(Status.ADDED, Status.ADDED));
 
-    Snapshot pending = table.newAppend()
+    table.newAppend()
         .appendFile(FILE_C)
         .appendFile(FILE_D)
-        .apply();
+        .commit();
+    V1Assert.assertEquals("Last sequence number should be 0", 0, 
table.ops().current().lastSequenceNumber());
+    V2Assert.assertEquals("Last sequence number should be 1", 2, 
table.ops().current().lastSequenceNumber());

Review comment:
       Nit: context is incorrect.




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



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

Reply via email to