Skip to content

Commit

Permalink
Attach metadata to directory marker blobs
Browse files Browse the repository at this point in the history
  • Loading branch information
felipecrv committed Jan 4, 2024
1 parent 9957577 commit 96bdba2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cpp/src/arrow/filesystem/azurefs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1443,7 +1443,12 @@ class AzureFileSystem::Impl {
auto dir_marker_blob_path = internal::EnsureTrailingSlash(path_within_container);
auto block_blob_client =
container_client.GetBlobClient(dir_marker_blob_path).AsBlockBlobClient();
block_blob_client.UploadFrom(nullptr, 0);
// Attach metadata that other filesystem implementations expect to be present
// on directory marker blobs.
// https://github.com/fsspec/adlfs/blob/32132c4094350fca2680155a5c236f2e9f991ba5/adlfs/spec.py#L855-L870
Blobs::UploadBlockBlobFromOptions blob_options;
blob_options.Metadata.emplace("is_directory", "true");
block_blob_client.UploadFrom(nullptr, 0, blob_options);
}

public:
Expand Down

0 comments on commit 96bdba2

Please sign in to comment.