From 84792d08866c4d1e20564b263bfa793f7a8a559e Mon Sep 17 00:00:00 2001 From: zclllyybb Date: Fri, 25 Aug 2023 11:47:39 +0800 Subject: [PATCH] fix compile of master (#23467) --- be/src/vec/functions/function_cast.h | 4 ++-- be/src/vec/io/io_helper.h | 18 ++++++++++-------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/be/src/vec/functions/function_cast.h b/be/src/vec/functions/function_cast.h index d3221590a3..4d9c6b0311 100644 --- a/be/src/vec/functions/function_cast.h +++ b/be/src/vec/functions/function_cast.h @@ -857,11 +857,11 @@ bool try_parse_impl(typename DataType::FieldType& x, ReadBuffer& rb, std::shared_mutex& cache_lock, Additions additions [[maybe_unused]] = Additions()) { if constexpr (IsDateTimeType) { - return try_read_datetime_text(x, rb, local_time_zone, time_zone_cache); + return try_read_datetime_text(x, rb, local_time_zone, time_zone_cache, cache_lock); } if constexpr (IsDateType) { - return try_read_date_text(x, rb, local_time_zone, time_zone_cache); + return try_read_date_text(x, rb, local_time_zone, time_zone_cache, cache_lock); } if constexpr (IsDateV2Type) { diff --git a/be/src/vec/io/io_helper.h b/be/src/vec/io/io_helper.h index 1eb324c477..3565cc67d7 100644 --- a/be/src/vec/io/io_helper.h +++ b/be/src/vec/io/io_helper.h @@ -284,10 +284,11 @@ bool read_date_text_impl(T& x, ReadBuffer& buf) { template bool read_date_text_impl(T& x, ReadBuffer& buf, const cctz::time_zone& local_time_zone, - ZoneList& time_zone_cache) { + ZoneList& time_zone_cache, std::shared_mutex& cache_lock) { static_assert(std::is_same_v); auto dv = binary_cast(x); - auto ans = dv.from_date_str(buf.position(), buf.count(), local_time_zone, time_zone_cache); + auto ans = dv.from_date_str(buf.position(), buf.count(), local_time_zone, time_zone_cache, + &cache_lock); dv.cast_to_date(); // only to match the is_all_read() check to prevent return null @@ -311,10 +312,11 @@ bool read_datetime_text_impl(T& x, ReadBuffer& buf) { template bool read_datetime_text_impl(T& x, ReadBuffer& buf, const cctz::time_zone& local_time_zone, - ZoneList& time_zone_cache) { + ZoneList& time_zone_cache, std::shared_mutex& cache_lock) { static_assert(std::is_same_v); auto dv = binary_cast(x); - auto ans = dv.from_date_str(buf.position(), buf.count(), local_time_zone, time_zone_cache); + auto ans = dv.from_date_str(buf.position(), buf.count(), local_time_zone, time_zone_cache, + &cache_lock); dv.to_datetime(); // only to match the is_all_read() check to prevent return null @@ -453,14 +455,14 @@ bool try_read_decimal_text(T& x, ReadBuffer& in, UInt32 precision, UInt32 scale) template bool try_read_datetime_text(T& x, ReadBuffer& in, const cctz::time_zone& local_time_zone, - ZoneList& time_zone_cache) { - return read_datetime_text_impl(x, in, local_time_zone, time_zone_cache); + ZoneList& time_zone_cache, std::shared_mutex& cache_lock) { + return read_datetime_text_impl(x, in, local_time_zone, time_zone_cache, cache_lock); } template bool try_read_date_text(T& x, ReadBuffer& in, const cctz::time_zone& local_time_zone, - ZoneList& time_zone_cache) { - return read_date_text_impl(x, in, local_time_zone, time_zone_cache); + ZoneList& time_zone_cache, std::shared_mutex& cache_lock) { + return read_date_text_impl(x, in, local_time_zone, time_zone_cache, cache_lock); } template