rdblue commented on a change in pull request #2932:
URL: https://github.com/apache/iceberg/pull/2932#discussion_r685321899



##########
File path: 
core/src/main/java/org/apache/iceberg/actions/BaseRewriteDataFilesAction.java
##########
@@ -268,23 +270,36 @@ public RewriteDataFilesActionResult execute() {
     return tasksGroupedByPartition.asMap();
   }
 
-  private void replaceDataFiles(Iterable<DataFile> deletedDataFiles, 
Iterable<DataFile> addedDataFiles,
-                                long startingSnapshotId) {
+  private void replaceDataFiles(
+      Iterable<DataFile> deletedDataFiles, Iterable<DataFile> addedDataFiles,
+      long startingSnapshotId) {
     try {
-      RewriteFiles rewriteFiles = table.newRewrite()
-          .validateFromSnapshot(startingSnapshotId)
-          .rewriteFiles(Sets.newHashSet(deletedDataFiles), 
Sets.newHashSet(addedDataFiles));
-      commit(rewriteFiles);
+      doReplace(deletedDataFiles, addedDataFiles, startingSnapshotId);
     } catch (Exception e) {
-      Tasks.foreach(Iterables.transform(addedDataFiles, f -> 
f.path().toString()))
-          .noRetry()
-          .suppressFailureWhenFinished()
-          .onFailure((location, exc) -> LOG.warn("Failed to delete: {}", 
location, exc))
-          .run(fileIO::deleteFile);
+      if (e instanceof CommitStateUnknownException) {

Review comment:
       Why is this not a separate `catch` block? I think it should be a `catch` 
instead of using `instanceof`.




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

Reply via email to