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

Reply via email to