diff --git a/cpp/src/arrow/scalar.cc b/cpp/src/arrow/scalar.cc index 21dbda3b96f50..63affc80a06ee 100644 --- a/cpp/src/arrow/scalar.cc +++ b/cpp/src/arrow/scalar.cc @@ -1177,14 +1177,16 @@ 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;