Guosmilesmile commented on code in PR #12639: URL: https://github.com/apache/iceberg/pull/12639#discussion_r2038650822
########## flink/v1.20/flink/src/main/java/org/apache/iceberg/flink/source/enumerator/ContinuousSplitPlannerImpl.java: ########## @@ -122,6 +123,53 @@ private ContinuousEnumerationResult discoverIncrementalSplits( return new ContinuousEnumerationResult(Collections.emptyList(), lastPosition, lastPosition); } else { Long lastConsumedSnapshotId = lastPosition.snapshotId(); + if (scanContext.snapshotExpirationResetStrategy() != SnapshotExpirationResetStrategy.DEFAULT + && lastConsumedSnapshotId != null + && !SnapshotUtil.isParentAncestorOf( + table, currentSnapshot.snapshotId(), lastConsumedSnapshotId)) { + switch (scanContext.snapshotExpirationResetStrategy()) { + case LATEST: + { + IcebergEnumeratorPosition newPosition = + IcebergEnumeratorPosition.of( + currentSnapshot.snapshotId(), currentSnapshot.timestampMillis()); + LOG.info( + "Snapshot expiration, last snapshot reset to latest : {}", + currentSnapshot.snapshotId()); + return new ContinuousEnumerationResult( + Collections.emptyList(), lastPosition, newPosition); + } + case EARLIEST: + default: Review Comment: Thanks for your review! Since there is a check above to determine whether it is the DEFAULT strategy, at this point, only EARLIEST and LATEST . ```java if (scanContext.snapshotExpirationResetStrategy() != SnapshotExpirationResetStrategy.DEFAULT && lastConsumedSnapshotId != null && !SnapshotUtil.isParentAncestorOf( table, currentSnapshot.snapshotId(), lastConsumedSnapshotId)) ``` However, my implementation could indeed be misleading, and I have already modified this part. -- 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-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org