nastra commented on code in PR #11171:
URL: https://github.com/apache/iceberg/pull/11171#discussion_r1768250558


##########
spark/v3.3/spark-extensions/src/test/java/org/apache/iceberg/spark/extensions/TestRollbackToTimestampProcedure.java:
##########
@@ -252,6 +254,41 @@ public void 
testRollbackToTimestampWithoutExplicitCatalog() {
         sql("SELECT * FROM %s ORDER BY id", tableName));
   }
 
+  @Test
+  public void testRollbackToTimestampBeforeOrEqualToOldestSnapshot() {
+    sql("CREATE TABLE %s (id bigint NOT NULL, data string) USING iceberg", 
tableName);
+    sql("INSERT INTO TABLE %s VALUES (1, 'a')", tableName);
+
+    Table table = validationCatalog.loadTable(tableIdent);
+    Snapshot firstSnapshot = table.currentSnapshot();
+    Timestamp beforeFirstSnapshotTimestamp =
+        Timestamp.from(Instant.ofEpochMilli(firstSnapshot.timestampMillis() - 
1));
+    Timestamp exactFirstSnapshotTimestamp =
+        Timestamp.from(Instant.ofEpochMilli(firstSnapshot.timestampMillis()));
+
+    waitUntilAfter(firstSnapshot.timestampMillis());
+    sql("INSERT INTO TABLE %s VALUES (2, 'b')", tableName);

Review Comment:
   I think the test would also pass without having to write new data. 
`waitUntilAfter` can then also be removed



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

Reply via email to