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/10/14 23:05:38 UTC

[GitHub] [incubator-iceberg] rdblue commented on a change in pull request #543: Avoid NullPointerException in FindFiles when there is no snapshot

rdblue commented on a change in pull request #543: Avoid NullPointerException in FindFiles when there is no snapshot
URL: https://github.com/apache/incubator-iceberg/pull/543#discussion_r334695148
 
 

 ##########
 File path: core/src/test/java/org/apache/iceberg/TestFindFiles.java
 ##########
 @@ -153,6 +153,23 @@ public void testCaseSensitivity() {
     Assert.assertEquals(pathSet(FILE_A), pathSet(files));
   }
 
+  @Test
+  public void testNoSnapshot() {
+    // a table has no snapshot when it just gets created and no data is loaded yet
+
+    // verify NPE is NOT thrown
+    Iterable<DataFile> files = null;
+    try {
+      files = FindFiles.in(table).collect();
+    } catch (NullPointerException npe) {
+      npe.printStackTrace();
 
 Review comment:
   Instead of print, I think you should log this or assert that it is null.

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