rdblue commented on a change in pull request #1110:
URL: https://github.com/apache/iceberg/pull/1110#discussion_r440482764



##########
File path: core/src/main/java/org/apache/iceberg/TableMetadata.java
##########
@@ -253,14 +253,21 @@ public String toString() {
     for (HistoryEntry logEntry : snapshotLog) {
       if (last != null) {
         Preconditions.checkArgument(
-            (logEntry.timestampMillis() - last.timestampMillis()) >= 0,
+            (logEntry.timestampMillis() - last.timestampMillis()) >= 
-ONE_MINUTE,
             "[BUG] Expected sorted snapshot log entries.");
       }
       last = logEntry;
     }
+    if (last != null) {

Review comment:
       It shouldn't be evaluated eagerly. Are you sure about that? We use [this 
pattern in other classes] 
(https://github.com/apache/iceberg/blob/master/core/src/main/java/org/apache/iceberg/hadoop/HadoopTableOperations.java#L131-L132)
 without a problem.

##########
File path: core/src/main/java/org/apache/iceberg/TableMetadata.java
##########
@@ -253,14 +253,21 @@ public String toString() {
     for (HistoryEntry logEntry : snapshotLog) {
       if (last != null) {
         Preconditions.checkArgument(
-            (logEntry.timestampMillis() - last.timestampMillis()) >= 0,
+            (logEntry.timestampMillis() - last.timestampMillis()) >= 
-ONE_MINUTE,
             "[BUG] Expected sorted snapshot log entries.");
       }
       last = logEntry;
     }
+    if (last != null) {

Review comment:
       It shouldn't be evaluated eagerly. Are you sure about that? We use [this 
pattern in other 
classes](https://github.com/apache/iceberg/blob/master/core/src/main/java/org/apache/iceberg/hadoop/HadoopTableOperations.java#L131-L132)
 without a problem.




----------------------------------------------------------------
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]

Reply via email to