mengna-lin commented on code in PR #18477:
URL: https://github.com/apache/iceberg/pull/18477#discussion_r4362049643
##########
spark/v4.2/spark/src/main/java/org/apache/iceberg/spark/actions/BaseSparkAction.java:
##########
@@ -407,14 +414,26 @@ public long totalFilesCount() {
private static class ReadManifest implements
FlatMapFunction<ManifestFileBean, FileInfo> {
private final Broadcast<Table> table;
+ private final SetAccumulator<String> missingManifests;
- ReadManifest(Broadcast<Table> table) {
+ ReadManifest(Broadcast<Table> table, SetAccumulator<String>
missingManifests) {
this.table = table;
+ this.missingManifests = missingManifests;
}
@Override
public Iterator<FileInfo> call(ManifestFileBean manifest) {
- return new ClosingIterator<>(entries(manifest));
+ try {
+ return new ClosingIterator<>(entries(manifest));
+ } catch (NotFoundException e) {
+ if (missingManifests == null) {
+ throw e;
+ }
Review Comment:
This condition means that manifests in a retained snapshot is missing and
table is corrupted. In this condition we should throw exception and abort the
job. Otherwise valid files might be deleted.
--
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]