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 2020/08/05 21:47:33 UTC

[GitHub] [iceberg] rdblue commented on a change in pull request #1101: Add sequence number assertions in merge append unit tests

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



##########
File path: core/src/test/java/org/apache/iceberg/TestMergeAppend.java
##########
@@ -75,17 +85,30 @@ public void testEmptyTableAppendManifest() 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()
         .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());
 
-    validateSnapshot(base.currentSnapshot(), pending, FILE_A, FILE_B);
+    validateSnapshot(base.currentSnapshot(), committedSnapshot, FILE_A, FILE_B);

Review comment:
       Is this validation still needed if `validateManifest` is called below?




----------------------------------------------------------------
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:
users@infra.apache.org



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