kbendick commented on code in PR #5469:
URL: https://github.com/apache/iceberg/pull/5469#discussion_r941819922
##########
spark/v3.3/spark/src/test/java/org/apache/iceberg/spark/actions/TestExpireSnapshotsAction.java:
##########
@@ -1215,4 +1215,39 @@ public void testUseLocalIterator() {
jobsRunDuringStreamResults);
});
}
+
+ @Test
+ public void testExpireAfterExecute() {
+ table
+ .newAppend()
+ .appendFile(FILE_A) // data_bucket=0
+ .commit();
+
+ rightAfterSnapshot();
+
+ table
+ .newAppend()
+ .appendFile(FILE_B) // data_bucket=1
+ .commit();
+
+ table
+ .newAppend()
+ .appendFile(FILE_C) // data_bucket=2
+ .commit();
+
+ long t3 = rightAfterSnapshot();
+
+ ExpireSnapshotsSparkAction action =
SparkActions.get().expireSnapshots(table);
+
+ action.expireOlderThan(t3).retainLast(2);
+
+ ExpireSnapshots.Result result = action.execute();
+ checkExpirationResults(0L, 0L, 0L, 0L, 1L, result);
+
+ List<FileInfo> typedExpiredFiles = action.expireFiles().collectAsList();
Review Comment:
We might want to update more of these tests off of `expire` and onto
`expireFiles` (and off of `Dataset<Row>` in the process).
But having this one test is sufficient and we can cleanup the tests more
during deprecation or in a later PR.
--
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]