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 2021/10/22 15:31:10 UTC

[GitHub] [iceberg] rdblue commented on a change in pull request #3349: Spark: Fix NPE if streaming read since an expired snapshot.

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



##########
File path: core/src/main/java/org/apache/iceberg/util/SnapshotUtil.java
##########
@@ -72,10 +72,15 @@ public static boolean ancestorOf(Table table, long snapshotId, long ancestorSnap
    */
   public static Snapshot oldestSnapshot(Table table) {
     Snapshot current = table.currentSnapshot();
+    Snapshot parent;
     while (current != null && current.parentId() != null) {
-      current = table.snapshot(current.parentId());
+      parent = table.snapshot(current.parentId());
+      if (parent != null) {
+        current = parent;
+      } else {
+        return current;
+      }
     }
-

Review comment:
       Please remove non-functional changes like this that will cause commit conflicts.




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

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

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