mengna-lin commented on code in PR #18477:
URL: https://github.com/apache/iceberg/pull/18477#discussion_r4516735572
##########
spark/v4.2/spark/src/main/java/org/apache/iceberg/spark/actions/ExpireSnapshotsSparkAction.java:
##########
@@ -222,10 +230,24 @@ private String jobDesc() {
}
private ExpireSnapshots.Result doExecute() {
- if (streamResults()) {
- return deleteFiles(expireFiles().toLocalIterator());
- } else {
- return deleteFiles(expireFiles().collectAsList().iterator());
+ Dataset<FileInfo> expiredFiles = expireFiles();
+ Iterator<FileInfo> filesToDelete =
+ streamResults() ? expiredFiles.toLocalIterator() :
expiredFiles.collectAsList().iterator();
+ ExpireSnapshots.Result result = deleteFiles(filesToDelete);
+ failIfMissingMetadata();
Review Comment:
I have applied the change. One concern I have is that now the spark job
succeeds even if there are missing metadata files. In this case users won't be
notified even if the table is corrupted. What do you think?
--
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]