From 22134a8f3b9645ad3cefeeac15892604829c3d87 Mon Sep 17 00:00:00 2001 From: mwish Date: Wed, 29 Jan 2025 18:04:18 +0800 Subject: [PATCH] Fix compile and use TypeClass of Scalar --- cpp/src/arrow/scalar.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cpp/src/arrow/scalar.cc b/cpp/src/arrow/scalar.cc index 21dbda3b96f50..c7c4433cecc8e 100644 --- a/cpp/src/arrow/scalar.cc +++ b/cpp/src/arrow/scalar.cc @@ -1177,14 +1177,15 @@ enable_if_duration>> CastImpl( } // time to time -template +template ::ScalarType::TypeClass> enable_if_time>> CastImpl( const TimeScalar& from, std::shared_ptr to_type) { using ToScalar = typename TypeTraits::ScalarType; ARROW_ASSIGN_OR_RAISE( auto value, util::ConvertTimestampValue(AsTimestampType(from.type), AsTimestampType(to_type), from.value)); - return std::make_shared(value, std::move(to_type)); + return std::make_shared(static_cast(value), std::move(to_type)); } constexpr int64_t kMillisecondsInDay = 86400000;