Skip to content

Commit

Permalink
Autoformat
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom-Newton committed Oct 4, 2024
1 parent ac99056 commit 0afc3a9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions cpp/src/arrow/filesystem/azurefs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1806,8 +1806,8 @@ class AzureFileSystem::Impl {
// BlobPrefixes. A BlobPrefix always ends with kDelimiter ("/"), so we can
// distinguish between a directory and a file by checking if we received a
// prefix or a blob.
// This strategy allows us to implement GetFileInfo with just 1 blob storage
// operation in almost every case.
// This strategy allows us to implement GetFileInfo with just 1 blob storage
// operation in almost every case.
if (!list_response.BlobPrefixes.empty()) {
// Ensure the returned BlobPrefixes[0] string doesn't contain more characters than
// the requested Prefix. For instance, if we request with Prefix="dir/abra" and
Expand All @@ -1830,17 +1830,17 @@ class AzureFileSystem::Impl {
std::chrono::system_clock::time_point{blob.Details.LastModified});
return info;
} else if (blob.Name[options.Prefix.Value().length()] < internal::kSep) {
// First list result did not indicate a directory and there is definitely no
// exactly matching blob. However, there may still be a directory that we
// initially missed because the first list result came before
// First list result did not indicate a directory and there is definitely no
// exactly matching blob. However, there may still be a directory that we
// initially missed because the first list result came before
// `options.Prefix + internal::kSep` lexigraphically.
// For example the flat namespace storage account has the following blobs:
// - container/dir.txt
// - container/dir/file.txt
// GetFileInfo(container/dir) should return FileType::Directory but in this
// edge case `blob = "dir.txt"`, so without further checks we would incorrectly
// GetFileInfo(container/dir) should return FileType::Directory but in this
// edge case `blob = "dir.txt"`, so without further checks we would incorrectly
// return FileType::NotFound.
// Therefore we make an extra list operation with the trailing slash to confirm
// Therefore we make an extra list operation with the trailing slash to confirm
// whether the path is a directory.
options.Prefix = internal::EnsureTrailingSlash(location.path);
auto list_with_trailing_slash_response = container_client.ListBlobs(options);
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/arrow/filesystem/azurefs_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2080,7 +2080,7 @@ void TestAzureFileSystem::TestGetFileInfoObjectWithNestedStructure() {
ASSERT_OK(output->Close());

// . is immediately before "/" lexicographically, ensure that this doesn't
// cause unexpected issues. NOTE: Its seems real Azure blob storage doesn't
// cause unexpected issues. NOTE: Its seems real Azure blob storage doesn't
// allow blob names to end in `.`
ASSERT_OK_AND_ASSIGN(output, fs()->OpenOutputStream(
data.ContainerPath("test-object-dir/some_other_dir.a"),
Expand Down

0 comments on commit 0afc3a9

Please sign in to comment.