kou commented on code in PR #38888:
URL: https://github.com/apache/arrow/pull/38888#discussion_r1408655837


##########
cpp/src/arrow/filesystem/azurefs.cc:
##########
@@ -970,6 +970,78 @@ class AzureFileSystem::Impl {
     return stream;
   }
 
+ private:
+  Status DeleteDirContentsWihtoutHierarchicalNamespace(const AzureLocation& 
location,
+                                                       bool missing_dir_ok) {
+    auto container_client =
+        blob_service_client_->GetBlobContainerClient(location.container);
+    Azure::Storage::Blobs::ListBlobsOptions options;
+    options.Prefix = internal::EnsureTrailingSlash(location.path);
+    // 
https://learn.microsoft.com/en-us/rest/api/storageservices/blob-batch#remarks
+    //
+    // Only supports up to 256 subrequests in a single batch. The
+    // size of the body for a batch request can't exceed 4 MB.
+    const int32_t kNumMaxRequestsInBatch = 256;
+    options.PageSizeHint = kNumMaxRequestsInBatch;
+    try {
+      auto list_response = container_client.ListBlobs(options);
+      if (!missing_dir_ok && list_response.Blobs.empty()) {
+        return Status::IOError("Specified directory doesn't exist: ", 
location.path, ": ",
+                               container_client.GetUrl());
+      }
+      while (list_response.HasPage() && !list_response.Blobs.empty()) {

Review Comment:
   (Hmm. I think that the case (empty blob but it's not the last response) 
isn't happen but I'm not sure because Azure Blob Storage is a proprietary 
product...)



-- 
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]

Reply via email to