From bc85ae4a3feafe7b541a172845e0a3e2bbaab9e6 Mon Sep 17 00:00:00 2001 From: octalene Date: Tue, 23 Aug 2022 23:42:01 -0700 Subject: [PATCH] MINOR: [C++] Fix StringFormatter type error in localfs_benchmark (#13932) since size_t is passed as the first argument to the StringFormatter, it needs to be templated with Int64Type instead of Int32Type Lead-authored-by: Aldrin M Co-authored-by: Aldrin Montana Signed-off-by: Antoine Pitrou --- cpp/src/arrow/filesystem/localfs_benchmark.cc | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/cpp/src/arrow/filesystem/localfs_benchmark.cc b/cpp/src/arrow/filesystem/localfs_benchmark.cc index 537b408bc271d..1eb15ccfe23a3 100644 --- a/cpp/src/arrow/filesystem/localfs_benchmark.cc +++ b/cpp/src/arrow/filesystem/localfs_benchmark.cc @@ -27,7 +27,6 @@ #include "arrow/testing/gtest_util.h" #include "arrow/testing/random.h" #include "arrow/util/async_generator.h" -#include "arrow/util/formatting.h" #include "arrow/util/io_util.h" #include "arrow/util/make_unique.h" #include "arrow/util/string_view.h" @@ -66,13 +65,9 @@ class LocalFSFixture : public benchmark::Fixture { arrow::internal::PlatformFilename cur_root_dir) { ASSERT_OK(arrow::internal::CreateDir(cur_root_dir)); - arrow::internal::StringFormatter format; for (size_t i = 0; i < num_files_; ++i) { - std::string fname = "file_"; - format(i, [&fname](util::string_view formatted) { - fname.append(formatted.data(), formatted.size()); - }); - ASSERT_OK_AND_ASSIGN(auto path, cur_root_dir.Join(std::move(fname))); + ASSERT_OK_AND_ASSIGN(auto path, + cur_root_dir.Join(std::string{"file_" + std::to_string(i)})); ASSERT_OK(MakeEmptyFile(path.ToString())); } @@ -81,11 +76,8 @@ class LocalFSFixture : public benchmark::Fixture { } for (size_t i = 0; i < num_dirs_; ++i) { - std::string dirname = "dir_"; - format(i, [&dirname](util::string_view formatted) { - dirname.append(formatted.data(), formatted.size()); - }); - ASSERT_OK_AND_ASSIGN(auto path, cur_root_dir.Join(std::move(dirname))); + ASSERT_OK_AND_ASSIGN(auto path, + cur_root_dir.Join(std::string{"dir_" + std::to_string(i)})); InitializeDatasetStructure(cur_nesting_level + 1, std::move(path)); } }