zhjwpku commented on code in PR #966:
URL: https://github.com/apache/iceberg-cpp/pull/966#discussion_r4110740970
##########
src/iceberg/arrow/s3/arrow_s3_file_io.cc:
##########
@@ -284,12 +284,18 @@ Status ArrowS3FileIO::DeleteFile(const std::string&
file_location) {
}
Status ArrowS3FileIO::DeleteFiles(const std::vector<std::string>&
file_locations) {
- std::unordered_map<ArrowFileSystemFileIO*, std::vector<std::string>>
locations_by_io;
+ // Like Java's S3FileIO, keep going after a failure and report the count.
+ // Arrow's S3 DeleteFiles deletes one file at a time too.
+ size_t failed = 0;
for (const auto& file_location : file_locations) {
- locations_by_io[&FileIOForPath(file_location)].push_back(file_location);
+ if (auto status = FileIOForPath(file_location).DeleteFile(file_location);
Review Comment:
Should we use a thread pool to delete files concurrently? Sequential S3
deletes could be slow for large batches. Java's S3FileIO does that, so maybe we
should pursue that too, but not a requirement for this PR.
--
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]