jerryshao commented on a change in pull request #796:
URL: https://github.com/apache/iceberg/pull/796#discussion_r478804826



##########
File path: core/src/main/java/org/apache/iceberg/util/SnapshotUtil.java
##########
@@ -68,8 +69,20 @@ public static boolean ancestorOf(Table table, long 
snapshotId, long ancestorSnap
    * This method assumes that fromSnapshotId is an ancestor of toSnapshotId
    */
   public static List<Long> snapshotIdsBetween(Table table, long 
fromSnapshotId, long toSnapshotId) {
+    AtomicBoolean isAncestor = new AtomicBoolean(false);

Review comment:
       I think doing two rounds of traversing is quite time consuming if we 
have many snapshots in a table, so I prefer not to change to that way.
   
   > throw an IllegalStateException in the lambda instead of returning null or 
using the atomic boolean.
   
   The `AtomicBoolean` here is to check if `fromSnapshotId` is not existed. We 
can only know if `fromSnapshotId` is existed or not after doing a full 
traversing, so throwing an Exception during traversing in lambda seems hard to 
achieve.
   
   




----------------------------------------------------------------
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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to