singhpk234 commented on code in PR #13653:
URL: https://github.com/apache/iceberg/pull/13653#discussion_r2229465111
##########
core/src/main/java/org/apache/iceberg/BaseTransaction.java:
##########
@@ -499,6 +487,17 @@ private void cleanAllUpdates() {
});
}
+ private void deleteUncommittedFiles(Iterable<String> paths) {
+ if (ops.io() instanceof SupportsBulkOperations) {
+ ((SupportsBulkOperations) ops.io()).deleteFiles(paths);
+ } else {
+ Tasks.foreach(paths)
+ .suppressFailureWhenFinished()
+ .onFailure((file, exc) -> LOG.warn("Failed to delete uncommitted
file: {}", file, exc))
+ .run(ops.io()::deleteFile);
+ }
+ }
Review Comment:
[optional] may be we can move this check to a FileIOUtil class which takes
fileIO and Iterator<String> as args to avoid this if else everywhere, wdyt ?
##########
core/src/main/java/org/apache/iceberg/BaseTransaction.java:
##########
@@ -499,6 +487,17 @@ private void cleanAllUpdates() {
});
}
+ private void deleteUncommittedFiles(Iterable<String> paths) {
+ if (ops.io() instanceof SupportsBulkOperations) {
+ ((SupportsBulkOperations) ops.io()).deleteFiles(paths);
+ } else {
+ Tasks.foreach(paths)
Review Comment:
[doubt] any reason why is it not run with a threadPool ?
--
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]