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 2020/08/27 14:23:33 UTC

[GitHub] [iceberg] RussellSpitzer commented on a change in pull request #796: Support Spark Structured Streaming Read for Iceberg

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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org