wg1026688210 commented on a change in pull request #2932:
URL: https://github.com/apache/iceberg/pull/2932#discussion_r685645606
##########
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) {
+ LOG.warn("for unknown commiting state ,we should not delete file ");
Review comment:
thanks, learned a lot for me
--
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]