zhengzengprc commented on a change in pull request #3039:
URL: https://github.com/apache/iceberg/pull/3039#discussion_r759516344



##########
File path: core/src/main/java/org/apache/iceberg/util/SnapshotUtil.java
##########
@@ -101,6 +101,42 @@ public static Snapshot oldestAncestor(Table table) {
     return ancestorsOf(start, lookup);
   }
 
+  /**
+   * Traverses the history of the table's current snapshot

Review comment:
       @RussellSpitzer Thanks for the reviewing.
   I think your understanding is totally correct, in the first comment, 2 
should always return 1 if it is possible
   Last commit logic:
   `    for (Snapshot snapshot : currentAncestors(table)) {
         if (snapshot.timestampMillis() < timestamp) {
           return current;
         }
   
         current = snapshot;
       }
   
       return current;`
   
   I think last commit will behavior that instead of calling oldestAncestor at 
last:
   1.The youngest ancestor before a given timestamp
   2.The oldest ancestor for the entire table if no such ancestor exists before 
the given timestamp
   3.Null otherwise
   
   When we reach the return function, current is equal to the result of 
oldestAncestor. This is also some part I am confused from the @rdblue 's 
comment above, I don't think we need to call oldestAncestor when the loop(var 
current will point to oldestAncestor). Please correct me if I understand 
something wrong




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

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