diff --git a/cpp/src/arrow/filesystem/azurefs.cc b/cpp/src/arrow/filesystem/azurefs.cc index 2e4dd6684d7b3..2c3d81ca24c51 100644 --- a/cpp/src/arrow/filesystem/azurefs.cc +++ b/cpp/src/arrow/filesystem/azurefs.cc @@ -629,7 +629,7 @@ class ObjectAppendStream final : public io::OutputStream { std::shared_ptr owned_buffer = nullptr) { RETURN_NOT_OK(CheckClosed("append")); auto append_data = reinterpret_cast(data); - auto block_content = Azure::Core::IO::MemoryBodyStream(append_data, nbytes); + Azure::Core::IO::MemoryBodyStream block_content(append_data, nbytes); if (block_content.Length() == 0) { return Status::OK(); } @@ -639,7 +639,7 @@ class ObjectAppendStream final : public io::OutputStream { // New block ID must always be distinct from the existing block IDs. Otherwise we // will accidentally replace the content of existing blocks, causing corruption. // We will use monotonically increasing integers. - std::string new_block_id = std::to_string(n_block_ids); + auto new_block_id = std::to_string(n_block_ids); // Pad to 5 digits, because Azure allows a maximum of 50,000 blocks. const size_t target_number_of_digits = 5; diff --git a/cpp/src/arrow/filesystem/azurefs_test.cc b/cpp/src/arrow/filesystem/azurefs_test.cc index 7cbb8c77a76c8..e9b9a6f34b88c 100644 --- a/cpp/src/arrow/filesystem/azurefs_test.cc +++ b/cpp/src/arrow/filesystem/azurefs_test.cc @@ -686,8 +686,7 @@ TEST_F(AzuriteFileSystemTest, TestWriteMetadata) { TEST_F(AzuriteFileSystemTest, OpenOutputStreamSmall) { const auto path = PreexistingContainerPath() + "test-write-object"; - std::shared_ptr output; - ASSERT_OK_AND_ASSIGN(output, fs_->OpenOutputStream(path, {})); + ASSERT_OK_AND_ASSIGN(auto output, fs_->OpenOutputStream(path, {})); const std::string_view expected(kLoremIpsum); ASSERT_OK(output->Write(expected)); ASSERT_OK(output->Close());