This is an automated email from the ASF dual-hosted git repository.

kou pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/main by this push:
     new 667e9170ef MINOR: [C++] Fix conversion warnings on MSVC (#39797)
667e9170ef is described below

commit 667e9170ef363e9b4a067be3be245d2dcd4b7a6f
Author: Antoine Pitrou <[email protected]>
AuthorDate: Fri Jan 26 01:31:46 2024 +0100

    MINOR: [C++] Fix conversion warnings on MSVC (#39797)
    
    ### Rationale for this change
    
    Fix a conversion warning that fails compiling arrow-dataset-file-benchmark 
on MSVC.
    
    ### Are these changes tested?
    
    Yes, by CI.
    
    ### Are there any user-facing changes?
    
    No.
    
    Authored-by: Antoine Pitrou <[email protected]>
    Signed-off-by: Sutou Kouhei <[email protected]>
---
 cpp/src/arrow/dataset/file_benchmark.cc | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/cpp/src/arrow/dataset/file_benchmark.cc 
b/cpp/src/arrow/dataset/file_benchmark.cc
index f687392d13..8aa2ac5a6f 100644
--- a/cpp/src/arrow/dataset/file_benchmark.cc
+++ b/cpp/src/arrow/dataset/file_benchmark.cc
@@ -66,7 +66,7 @@ static void GetAllFragments(benchmark::State& state) {
     ABORT_NOT_OK(fragments.Visit([](std::shared_ptr<Fragment>) { return 
Status::OK(); }));
   }
   state.SetItemsProcessed(state.iterations() * dataset.num_fragments);
-  state.counters["num_fragments"] = dataset.num_fragments;
+  state.counters["num_fragments"] = static_cast<double>(dataset.num_fragments);
 }
 
 static void GetFilteredFragments(benchmark::State& state, compute::Expression 
filter) {
@@ -82,8 +82,8 @@ static void GetFilteredFragments(benchmark::State& state, 
compute::Expression fi
     }));
   }
   state.SetItemsProcessed(state.iterations() * dataset.num_fragments);
-  state.counters["num_fragments"] = dataset.num_fragments;
-  state.counters["num_filtered_fragments"] = num_filtered_fragments;
+  state.counters["num_fragments"] = static_cast<double>(dataset.num_fragments);
+  state.counters["num_filtered_fragments"] = 
static_cast<double>(num_filtered_fragments);
 }
 
 using compute::field_ref;

Reply via email to