MCPcopy Create free account
hub / github.com/apache/arrow / TestDetectHierarchicalNamespace

Method TestDetectHierarchicalNamespace

cpp/src/arrow/filesystem/azurefs_test.cc:2163–2186  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2161};
2162
2163void TestAzureFileSystem::TestDetectHierarchicalNamespace(bool trip_up_azurite) {
2164 EXPECT_OK_AND_ASSIGN(auto env, GetAzureEnv());
2165 if (trip_up_azurite && env->backend() != AzureBackend::kAzurite) {
2166 return;
2167 }
2168
2169 auto data = SetUpPreexistingData();
2170 if (trip_up_azurite) {
2171 // Azurite causes GetDirectoryClient("/") to throw a std::out_of_range
2172 // exception when a "/" blob exists, so we exercise that code path.
2173 auto container_client =
2174 blob_service_client_->GetBlobContainerClient(data.container_name);
2175 CreateBlob(container_client, "/");
2176 }
2177
2178 auto adlfs_client = datalake_service_client_->GetFileSystemClient(data.container_name);
2179 ASSERT_OK_AND_ASSIGN(auto hns_support, internal::CheckIfHierarchicalNamespaceIsEnabled(
2180 adlfs_client, options_));
2181 if (env->WithHierarchicalNamespace()) {
2182 ASSERT_EQ(hns_support, HNSSupport::kEnabled);
2183 } else {
2184 ASSERT_EQ(hns_support, HNSSupport::kDisabled);
2185 }
2186}
2187
2188void TestAzureFileSystem::TestDetectHierarchicalNamespaceOnMissingContainer() {
2189 auto container_name = PreexistingData::RandomContainerName(rng_);

Callers 1

TYPED_TESTFunction · 0.80

Calls 4

backendMethod · 0.80
GetFileSystemClientMethod · 0.80

Tested by

no test coverage detected