amogh-jahagirdar commented on code in PR #5459:
URL: https://github.com/apache/iceberg/pull/5459#discussion_r950735275
##########
core/src/main/java/org/apache/iceberg/CatalogUtil.java:
##########
@@ -102,6 +106,26 @@ public static void dropTableData(FileIO io, TableMetadata
metadata) {
deleteFiles(io, manifestsToDelete);
}
+ if (io instanceof SupportsBulkOperations) {
+ SupportsBulkOperations bulkFileIO = (SupportsBulkOperations) io;
+ Iterable<String> manifestPaths = Iterables.transform(manifestsToDelete,
ManifestFile::path);
+ Iterable<String> prevMetadataFiles =
+ Iterables.transform(metadata.previousFiles(),
TableMetadata.MetadataLogEntry::file);
+ try {
+ Iterable<String> filesToDelete =
+ Iterables.concat(
+ manifestPaths,
+ manifestListsToDelete,
+ prevMetadataFiles,
+ ImmutableList.of(metadata.metadataFileLocation()));
+ bulkFileIO.deleteFiles(filesToDelete);
Review Comment:
Sure, I've updated so it's the 2nd way. This seems much cleaner, we delegate
to the bulk deletion at the "last" layer, rather than having multiple branches.
Thanks for this!
--
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]