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 2019/08/24 18:50:11 UTC

[GitHub] [incubator-iceberg] rdblue commented on a change in pull request #389: Add test cases

rdblue commented on a change in pull request #389: Add test cases
URL: https://github.com/apache/incubator-iceberg/pull/389#discussion_r317371298
 
 

 ##########
 File path: core/src/test/java/org/apache/iceberg/TestScanSummary.java
 ##########
 @@ -32,7 +33,47 @@
 import static org.apache.iceberg.expressions.Expressions.lessThan;
 import static org.apache.iceberg.expressions.Expressions.lessThanOrEqual;
 
-public class TestScanSummary {
+public class TestScanSummary extends TableTestBase {
+
+  @Test
+  public void testSnapshotTimeRangeValidation() {
+    long t0 = System.currentTimeMillis();
+
+    table.newAppend()
+        .appendFile(FILE_A) // data_bucket=0
+        .appendFile(FILE_B) // data_bucket=1
+        .commit();
+
+    long t1 = System.currentTimeMillis();
+
+    table.newAppend()
+        .appendFile(FILE_C) // data_bucket=2
+        .commit();
+
+    long secondSnapshotId = table.currentSnapshot().snapshotId();
+
+    long t2 = System.currentTimeMillis();
+
+    // expire the first snapshot
+    table.expireSnapshots()
+        .expireOlderThan(t1)
+        .commit();
+
+    Assert.assertEquals("Should have one snapshot",
+        1, Lists.newArrayList(table.snapshots()).size());
 
 Review comment:
   Okay, I'll update it to make sure the timestamps aren't equal.

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


With regards,
Apache Git Services

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