From 2c60782ced9b1f75b9089ed36dc2fd326cc96523 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Fri, 2 Aug 2024 16:16:55 +0900 Subject: [PATCH] Add float family types to ValueTYpe --- cpp/src/arrow/array/statistics.h | 3 ++- cpp/src/arrow/array/statistics_test.cc | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cpp/src/arrow/array/statistics.h b/cpp/src/arrow/array/statistics.h index ab9069e3a742e..7357e27f41f5b 100644 --- a/cpp/src/arrow/array/statistics.h +++ b/cpp/src/arrow/array/statistics.h @@ -23,6 +23,7 @@ #include #include +#include "arrow/util/float16.h" #include "arrow/util/visibility.h" namespace arrow { @@ -35,7 +36,7 @@ namespace arrow { struct ARROW_EXPORT ArrayStatistics { using ValueType = std::variant; + uint64_t, util::Float16, float, double, std::string, std::string_view>; ArrayStatistics() = default; ~ArrayStatistics() = default; diff --git a/cpp/src/arrow/array/statistics_test.cc b/cpp/src/arrow/array/statistics_test.cc index 33f99266e373b..a465ac0bc2e0d 100644 --- a/cpp/src/arrow/array/statistics_test.cc +++ b/cpp/src/arrow/array/statistics_test.cc @@ -89,9 +89,9 @@ TEST(ArrayStatisticsTest, TestEquality) { statistics2.is_min_exact = false; ASSERT_EQ(statistics1, statistics2); - statistics1.max = static_cast(-255); + statistics1.max = arrow::util::Float16(-29); ASSERT_NE(statistics1, statistics2); - statistics2.max = static_cast(-255); + statistics2.max = arrow::util::Float16(-29); ASSERT_EQ(statistics1, statistics2); statistics1.is_max_exact = true;