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/01/27 17:18:13 UTC

[GitHub] [incubator-iceberg] rdblue commented on a change in pull request #750: Add time-travel methods (asOfTime, useSnapshot) in IcebergGenerics

rdblue commented on a change in pull request #750: Add time-travel methods (asOfTime,useSnapshot) in IcebergGenerics
URL: https://github.com/apache/incubator-iceberg/pull/750#discussion_r371372669
 
 

 ##########
 File path: data/src/test/java/org/apache/iceberg/data/TestLocalScan.java
 ##########
 @@ -215,28 +275,90 @@ public void testFullScan() {
     Iterable<Record> results = IcebergGenerics.read(sharedTable).build();
 
     Set<Record> expected = Sets.newHashSet();
-    expected.addAll(file1Records);
-    expected.addAll(file2Records);
-    expected.addAll(file3Records);
+    expected.addAll(file1SecondSnapshotRecords);
+    expected.addAll(file2SecondSnapshotRecords);
+    expected.addAll(file3SecondSnapshotRecords);
+
+    Set<Record> records = Sets.newHashSet(results);
+    Assert.assertEquals("Should produce correct number of records",
+        expected.size(), records.size());
+    Assert.assertEquals("Random record set should match",
+        Sets.newHashSet(expected), records);
+    Assert.assertNotNull(records.stream().findFirst().get().getField("id"));
+    Assert.assertNotNull(records.stream().findFirst().get().getField("data"));
+  }
+
+  @Test
+  public void testUnknownSnapshotId() {
+    exceptionRule.expect(IllegalArgumentException.class);
+    exceptionRule.expectMessage(startsWith("Cannot find snapshot with ID "));
 
 Review comment:
   Instead of using `ExpectedException`, we use `AssertHelpers.assertThrows`. That also supports matching the contents of the thrown exception's message.

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