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

Method DeleteFile

cpp/src/arrow/filesystem/azurefs.cc:3449–3474  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3447}
3448
3449Status AzureFileSystem::DeleteFile(const std::string& path) {
3450 ARROW_ASSIGN_OR_RAISE(auto location, AzureLocation::FromString(path));
3451 if (location.container.empty()) {
3452 return Status::Invalid("DeleteFile requires a non-empty path.");
3453 }
3454 auto container_client = impl_->GetBlobContainerClient(location.container);
3455 if (location.path.empty()) {
3456 // Container paths (locations w/o path) are either not found or represent directories.
3457 ARROW_ASSIGN_OR_RAISE(auto container_info,
3458 GetContainerPropsAsFileInfo(location, container_client));
3459 return container_info.IsDirectory() ? NotAFile(location) : PathNotFound(location);
3460 }
3461 auto adlfs_client = impl_->GetFileSystemClient(location.container);
3462 ARROW_ASSIGN_OR_RAISE(auto hns_support,
3463 impl_->HierarchicalNamespaceSupport(adlfs_client));
3464 if (hns_support == HNSSupport::kContainerNotFound) {
3465 return PathNotFound(location);
3466 }
3467 if (hns_support == HNSSupport::kEnabled) {
3468 return impl_->DeleteFileOnFileSystem(adlfs_client, location,
3469 /*require_file_to_exist=*/true);
3470 }
3471 return impl_->DeleteFileOnContainer(container_client, location,
3472 /*require_file_to_exist=*/true,
3473 /*operation=*/"DeleteFile");
3474}
3475
3476Status AzureFileSystem::Move(const std::string& src, const std::string& dest) {
3477 ARROW_ASSIGN_OR_RAISE(auto src_location, AzureLocation::FromString(src));

Callers

nothing calls this directly

Calls 9

GetFileSystemClientMethod · 0.80
DeleteFileOnContainerMethod · 0.80
NotAFileFunction · 0.70
PathNotFoundFunction · 0.70
InvalidFunction · 0.50
emptyMethod · 0.45
IsDirectoryMethod · 0.45

Tested by

no test coverage detected