CTTY commented on code in PR #17360:
URL: https://github.com/apache/iceberg/pull/17360#discussion_r3670072213
##########
core/src/main/java/org/apache/iceberg/util/SnapshotUtil.java:
##########
@@ -390,9 +390,12 @@ public static long snapshotIdAsOfTime(Table table, long
timestampMillis) {
public static Long nullableSnapshotIdAsOfTime(Table table, long
timestampMillis) {
Long snapshotId = null;
+ long bestTimestamp = Long.MIN_VALUE;
for (HistoryEntry logEntry : table.history()) {
- if (logEntry.timestampMillis() <= timestampMillis) {
+ if (logEntry.timestampMillis() <= timestampMillis
+ && logEntry.timestampMillis() > bestTimestamp) {
Review Comment:
Makes sense to me
--
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]