You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "felipecrv (via GitHub)" <gi...@apache.org> on 2023/12/01 01:46:04 UTC

Re: [PR] GH-38701: [C++][FS][Azure] Implement `DeleteDirContents()` [arrow]

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


##########
cpp/src/arrow/filesystem/azurefs.cc:
##########
@@ -970,6 +970,79 @@ 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);

Review Comment:
   Wow. From the name, I though it **ensured** a trailing slash on the output. 🥲
   
   I like this because `Prefix` is a nullable, so not doing anything to it makes even more sense than setting it to a `""` value.
   
   ```cpp
   if (!location.path.empty()) {
     options.Prefix = internal::EnsureTrailingSlash(location.path);
   }
   ```



##########
cpp/src/arrow/filesystem/azurefs.cc:
##########
@@ -970,6 +970,79 @@ 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);

Review Comment:
   Wow. From the name, I though it **ensured** a trailing slash on the output. 🥲
   
   I like this because `Prefix` is a nullable, so not doing anything to it makes even more sense than setting it to a `""` value.
   
   ```cpp
   if (!location.path.empty()) {
     options.Prefix = internal::EnsureTrailingSlash(location.path);
   }
   ```



-- 
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: github-unsubscribe@arrow.apache.org

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