kou commented on code in PR #41068:
URL: https://github.com/apache/arrow/pull/41068#discussion_r1558277407
##########
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:
https://github.com/apache/arrow/blob/cd607d00b9e3c5f2ac2a2e373ba7571fd75fc725/cpp/src/arrow/filesystem/azurefs.cc#L2859-L2866
https://github.com/apache/arrow/blob/cd607d00b9e3c5f2ac2a2e373ba7571fd75fc725/cpp/src/arrow/filesystem/azurefs.cc#L1740-L1779
The `FromContainer` suffix doesn't mean only for no HNS support. We use
`OnContainer`/`OnFileSystem` suffix for it. `FromContainer` just means that
it's for one container and it doesn't work with multiple containers.
----
Should we create
`GetFileInfoWithSelectorFromContainerOn{Container,FileSystem}()`? But their
names are too long...
--
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]