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


##########
cpp/src/arrow/filesystem/azurefs.cc:
##########
@@ -1642,11 +1642,27 @@ class AzureFileSystem::Impl {
       options.Prefix = {};
       found = true;  // Unless the container itself is not found later!
     } else {
-      options.Prefix = internal::EnsureTrailingSlash(base_location.path);
+      ARROW_ASSIGN_OR_RAISE(
+          auto prefix, AzureLocation::FromString(
+                           
std::string(internal::EnsureTrailingSlash(select.base_dir))));
+      ARROW_ASSIGN_OR_RAISE(auto info, GetFileInfo(container_client, prefix));
+      if (info.type() == FileType::NotFound) {
+        if (select.allow_not_found) {
+          return Status::OK();
+        } else {
+          return PathNotFound(base_location);
+        }
+      } else if (info.type() != FileType::Directory) {
+        return NotADir(base_location);
+      }
+      options.Prefix = prefix.path;
     }
     options.PageSizeHint = page_size_hint;
     options.Include = Blobs::Models::ListBlobsIncludeFlags::Metadata;
 
+    auto adlfs_client = GetFileSystemClient(base_location.container);
+    ARROW_ASSIGN_OR_RAISE(auto hns_support, 
HierarchicalNamespaceSupport(adlfs_client));

Review Comment:
   > I can understand what you say but the current implementation doesn't:
   >
   > GetFileInfoWithSelector() isn't dispatched based on HNS support:
   
   But what I meant was changing/fixing `GetFileInfoWithSelector` to do that.
   
   > Should we create 
GetFileInfoWithSelectorFromContainerOn{Container,FileSystem}()? But their names 
are too long...
   
   ADLFS calls "filesystem" what "blobs" calls "container", so you replace the 
last word of the name:
   
   ```cpp
     Status GetFileInfoWithSelectorFromContainer(const 
Blobs::BlobContainerClient& container_client, ...);
     Status GetFileInfoWithSelecitonFromFilesystem(const 
DataLake::DataLakeFileSystemClient& adlfs_client, ...);
    ```
   
   



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