You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2022/08/08 15:44:46 UTC

[GitHub] [iceberg] singhpk234 commented on a diff in pull request #5459: Core: Use Bulk Delete when dropping table data and metadata

singhpk234 commented on code in PR #5459:
URL: https://github.com/apache/iceberg/pull/5459#discussion_r940326491


##########
core/src/main/java/org/apache/iceberg/CatalogUtil.java:
##########
@@ -102,6 +106,16 @@ public static void dropTableData(FileIO io, TableMetadata metadata) {
       deleteFiles(io, manifestsToDelete);
     }
 
+    if (io instanceof SupportsBulkOperations) {
+      SupportsBulkOperations bulkFileIO = (SupportsBulkOperations) io;
+      bulkFileIO.deleteFiles(Iterables.transform(manifestsToDelete, ManifestFile::path));
+      bulkFileIO.deleteFiles(manifestListsToDelete);
+      bulkFileIO.deleteFiles(
+          Iterables.transform(metadata.previousFiles(), TableMetadata.MetadataLogEntry::file));
+      bulkFileIO.deleteFiles(ImmutableList.of(metadata.metadataFileLocation()));

Review Comment:
   [question] can we concat all the iterators into 1 iterator and call bulkFileIO#deleteFiles only once WDYT ? 



-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org