felipecrv commented on code in PR #39298:
URL: https://github.com/apache/arrow/pull/39298#discussion_r1431987234
##########
cpp/src/arrow/filesystem/azurefs.cc:
##########
@@ -1177,18 +1269,19 @@ class AzureFileSystem::Impl {
}
}
- ARROW_ASSIGN_OR_RAISE(auto hierarchical_namespace_enabled,
- hns_detector_.Enabled(location.container));
- if (!hierarchical_namespace_enabled) {
+ auto adlfs_client =
datalake_service_client_->GetFileSystemClient(location.container);
+ ARROW_ASSIGN_OR_RAISE(auto hns_support,
HierarchicalNamespaceSupport(adlfs_client));
+ if (hns_support == HNSSupport::kContainerNotFound) {
+ return PathNotFound(location);
+ }
+ if (hns_support == HNSSupport::kDisabled && !IsDfsEmulator(options_)) {
Review Comment:
We do need it.
In the Azure environment we will get `HNSSupport::kContainerNotFound` when a
container is not found even if the storage account doesn't support HNS.
On Azurite we get `HNSSupport` even when the container doesn't exist, so
returning `Status::OK()` is this situation would be a bogus success report.
There is a test expecting this function to fail on accounts with and without
HNS support *iff* the container doesn't exist.
Running the tests with `&& !IsDFSEmulator(options_)`:
```
[ RUN ]
TestAzuriteFileSystem.CreateDirFailureDirectoryWithMissingContainer
/Users/felipe/code/arrow/cpp/src/arrow/filesystem/azurefs_test.cc:1062:
Failure
Failed
Expected 'fs_->CreateDir(path, false)' to fail with IOError, but got OK
```
This extra condition is going to be removed in the fix for
https://github.com/apache/arrow/issues/38772 where I'm fixing the semantics of
directory operations.
--
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]