kbendick commented on code in PR #4503:
URL: https://github.com/apache/iceberg/pull/4503#discussion_r845278389
##########
spark/v3.2/spark/src/test/java/org/apache/iceberg/spark/actions/TestRemoveOrphanFilesAction.java:
##########
@@ -150,10 +150,20 @@ public void testDryRun() throws IOException,
InterruptedException {
Assert.assertEquals("Action should find 1 file", invalidFiles,
result2.orphanFileLocations());
Assert.assertTrue("Invalid file should be present", fs.exists(new
Path(invalidFiles.get(0))));
+ String actualFilesTableName = "actualFilesTable";
+ spark.createDataset(allFiles,
Encoders.STRING()).toDF("file_path").createOrReplaceTempView(actualFilesTableName);
DeleteOrphanFiles.Result result3 = actions.deleteOrphanFiles(table)
+ .deleteWith(s -> { })
+ .actualFilesTable(actualFilesTableName)
+ .execute();
+
+ Assert.assertEquals("Action should find 1 file", invalidFiles,
result3.orphanFileLocations());
+ Assert.assertTrue("Invalid file should be present", fs.exists(new
Path(invalidFiles.get(0))));
+
+ DeleteOrphanFiles.Result result4 = actions.deleteOrphanFiles(table)
Review Comment:
If we add support for things like `older_than`, we should probably make a
separate test case for the actual files table option so we can exercise various
scenarios focused on that one area.
--
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]