RussellSpitzer commented on a change in pull request #796:
URL: https://github.com/apache/iceberg/pull/796#discussion_r478458235
##########
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 this may be clearer and not require the Atomic if we do a little
refactoring and do two recursive walks,
`Precondition.require((ancestorOf(table, fromSnapshotId, toSnapshotId))`
then doing the ancestorIds lookup?
Or if we want to keep the current logic I believe we can just throw an
IllegalStateException in the lambda instead of returning null or using the
atomic boolean.
----------------------------------------------------------------
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]