From db2c489956adcc475fb6332ba210611a434c7ae5 Mon Sep 17 00:00:00 2001 From: HappenLee Date: Fri, 25 Oct 2024 09:32:34 +0800 Subject: [PATCH] [env](compile)open compile check in some function --- be/src/olap/tablet_reader.h | 2 +- be/src/util/hash_util.hpp | 4 +- be/src/util/murmur_hash3.cpp | 4 +- be/src/util/murmur_hash3.h | 4 +- be/src/util/string_parser.hpp | 6 +-- be/src/vec/functions/function_collection_in.h | 5 +- be/src/vec/functions/function_conv.cpp | 1 + be/src/vec/functions/function_convert_tz.h | 5 +- .../function_date_or_datetime_computation.h | 11 ++-- .../function_datetime_string_to_string.h | 6 ++- be/src/vec/functions/function_encryption.cpp | 53 +++++++++---------- be/src/vec/functions/function_hash.cpp | 1 + be/src/vec/functions/function_hex.cpp | 6 ++- be/src/vec/functions/function_hll.cpp | 8 +-- be/src/vec/functions/function_ip.h | 36 ++++++++----- 15 files changed, 88 insertions(+), 64 deletions(-) diff --git a/be/src/olap/tablet_reader.h b/be/src/olap/tablet_reader.h index 87af3bb08eb36e..dd9d39d9decee0 100644 --- a/be/src/olap/tablet_reader.h +++ b/be/src/olap/tablet_reader.h @@ -167,7 +167,7 @@ class TabletReader { // used for compaction to record row ids bool record_rowids = false; - RowIdConversion* rowid_conversion; + RowIdConversion* rowid_conversion = nullptr; std::vector topn_filter_source_node_ids; int topn_filter_target_node_id = -1; // used for special optimization for query : ORDER BY key LIMIT n diff --git a/be/src/util/hash_util.hpp b/be/src/util/hash_util.hpp index dc70b1c9f9c40b..e9ac72c5ccdcb4 100644 --- a/be/src/util/hash_util.hpp +++ b/be/src/util/hash_util.hpp @@ -134,7 +134,7 @@ class HashUtil { static const uint32_t MURMUR3_32_SEED = 104729; // modify from https://github.com/aappleby/smhasher/blob/master/src/MurmurHash3.cpp - static uint32_t murmur_hash3_32(const void* key, int32_t len, uint32_t seed) { + static uint32_t murmur_hash3_32(const void* key, int64_t len, uint32_t seed) { uint32_t out = 0; murmur_hash3_x86_32(key, len, seed, &out); return out; @@ -227,7 +227,7 @@ class HashUtil { // Our hash function is MurmurHash2, 64 bit version. // It was modified in order to provide the same result in // big and little endian archs (endian neutral). - static uint64_t murmur_hash64A(const void* key, int32_t len, unsigned int seed) { + static uint64_t murmur_hash64A(const void* key, int64_t len, unsigned int seed) { const uint64_t m = MURMUR_PRIME; const int r = 47; uint64_t h = seed ^ (len * m); diff --git a/be/src/util/murmur_hash3.cpp b/be/src/util/murmur_hash3.cpp index 96568d6978e225..edd1c44f338473 100644 --- a/be/src/util/murmur_hash3.cpp +++ b/be/src/util/murmur_hash3.cpp @@ -85,7 +85,7 @@ FORCE_INLINE uint64_t fmix64(uint64_t k) { //----------------------------------------------------------------------------- -void murmur_hash3_x86_32(const void* key, int len, uint32_t seed, void* out) { +void murmur_hash3_x86_32(const void* key, int64_t len, uint32_t seed, void* out) { const uint8_t* data = (const uint8_t*)key; const int nblocks = len / 4; @@ -435,7 +435,7 @@ void murmur_hash3_x64_128(const void* key, const int len, const uint32_t seed, v ((uint64_t*)out)[1] = h2; } -void murmur_hash3_x64_64(const void* key, const int len, const uint64_t seed, void* out) { +void murmur_hash3_x64_64(const void* key, const int64_t len, const uint64_t seed, void* out) { const uint8_t* data = (const uint8_t*)key; const int nblocks = len / 8; uint64_t h1 = seed; diff --git a/be/src/util/murmur_hash3.h b/be/src/util/murmur_hash3.h index c8e8964bf6a20e..249966460221a3 100644 --- a/be/src/util/murmur_hash3.h +++ b/be/src/util/murmur_hash3.h @@ -25,12 +25,12 @@ typedef unsigned __int64 uint64_t; //----------------------------------------------------------------------------- -void murmur_hash3_x86_32(const void* key, int len, uint32_t seed, void* out); +void murmur_hash3_x86_32(const void* key, int64_t len, uint32_t seed, void* out); void murmur_hash3_x86_128(const void* key, int len, uint32_t seed, void* out); void murmur_hash3_x64_128(const void* key, int len, uint32_t seed, void* out); -void murmur_hash3_x64_64(const void* key, int len, uint64_t seed, void* out); +void murmur_hash3_x64_64(const void* key, int64_t len, uint64_t seed, void* out); //----------------------------------------------------------------------------- diff --git a/be/src/util/string_parser.hpp b/be/src/util/string_parser.hpp index 67ab41cc1c7bee..5771434c4c6321 100644 --- a/be/src/util/string_parser.hpp +++ b/be/src/util/string_parser.hpp @@ -128,7 +128,7 @@ class StringParser { // Convert a string s representing a number in given base into a decimal number. template - static inline T string_to_int(const char* __restrict s, int len, int base, + static inline T string_to_int(const char* __restrict s, int64_t len, int base, ParseResult* result) { T ans = string_to_int_internal(s, len, base, result); if (LIKELY(*result == PARSE_SUCCESS)) { @@ -207,7 +207,7 @@ class StringParser { // Convert a string s representing a number in given base into a decimal number. // Return PARSE_FAILURE on leading whitespace. Trailing whitespace is allowed. template - static inline T string_to_int_internal(const char* __restrict s, int len, int base, + static inline T string_to_int_internal(const char* __restrict s, int64_t len, int base, ParseResult* result); // Converts an ascii string to an integer of type T assuming it cannot overflow @@ -385,7 +385,7 @@ T StringParser::string_to_unsigned_int_internal(const char* __restrict s, int le } template -T StringParser::string_to_int_internal(const char* __restrict s, int len, int base, +T StringParser::string_to_int_internal(const char* __restrict s, int64_t len, int base, ParseResult* result) { typedef typename std::make_unsigned::type UnsignedT; UnsignedT val = 0; diff --git a/be/src/vec/functions/function_collection_in.h b/be/src/vec/functions/function_collection_in.h index 33a4a2570800a9..755f2911245467 100644 --- a/be/src/vec/functions/function_collection_in.h +++ b/be/src/vec/functions/function_collection_in.h @@ -41,6 +41,7 @@ #include "vec/functions/function.h" namespace doris::vectorized { +#include "common/compile_check_begin.h" struct ColumnRowRef { ENABLE_FACTORY_CREATOR(ColumnRowRef); ColumnPtr column; @@ -128,7 +129,7 @@ class FunctionCollectionIn : public IFunction { } ColumnPtr column_ptr = std::move(args_column_ptr); // make collection ref into set - int col_size = column_ptr->size(); + auto col_size = column_ptr->size(); for (size_t i = 0; i < col_size; i++) { state->args_set.insert({column_ptr, i}); } @@ -191,3 +192,5 @@ class FunctionCollectionIn : public IFunction { }; } // namespace doris::vectorized + +#include "common/compile_check_end.h" diff --git a/be/src/vec/functions/function_conv.cpp b/be/src/vec/functions/function_conv.cpp index 3dbfd81e8a2a53..baac2af61ed2a3 100644 --- a/be/src/vec/functions/function_conv.cpp +++ b/be/src/vec/functions/function_conv.cpp @@ -49,6 +49,7 @@ #include "vec/functions/simple_function_factory.h" namespace doris { +#include "common/compile_check_begin.h" class FunctionContext; } // namespace doris diff --git a/be/src/vec/functions/function_convert_tz.h b/be/src/vec/functions/function_convert_tz.h index d0a600a9e41a86..7765568b5f134a 100644 --- a/be/src/vec/functions/function_convert_tz.h +++ b/be/src/vec/functions/function_convert_tz.h @@ -52,6 +52,7 @@ #include "vec/functions/function.h" #include "vec/runtime/vdatetime_value.h" namespace doris::vectorized { +#include "common/compile_check_begin.h" struct ConvertTzState { bool use_state = false; @@ -215,7 +216,7 @@ class FunctionConvertTZ : public IFunction { NullMap& result_null_map, size_t input_rows_count) { cctz::time_zone& from_tz = convert_tz_state->from_tz; cctz::time_zone& to_tz = convert_tz_state->to_tz; - auto push_null = [&](int row) { + auto push_null = [&](size_t row) { result_null_map[row] = true; result_column->insert_default(); }; @@ -310,3 +311,5 @@ class FunctionConvertTZ : public IFunction { }; } // namespace doris::vectorized + +#include "common/compile_check_end.h" diff --git a/be/src/vec/functions/function_date_or_datetime_computation.h b/be/src/vec/functions/function_date_or_datetime_computation.h index ac18965749eb8e..ba75a86ef7ecc4 100644 --- a/be/src/vec/functions/function_date_or_datetime_computation.h +++ b/be/src/vec/functions/function_date_or_datetime_computation.h @@ -27,6 +27,7 @@ #include #include +#include "common/cast_set.h" #include "common/compiler_util.h" #include "common/exception.h" #include "common/logging.h" @@ -645,7 +646,7 @@ struct DateTimeAddIntervalImpl { col_to->get_data(), null_map->get_data(), delta_vec_column->get_data()); } else { - Op::constant_vector(sources_const->template get_value(), + Op::constant_vector(sources_const->template get_value(), col_to->get_data(), null_map->get_data(), *not_nullable_column_ptr_arg1); } @@ -675,7 +676,7 @@ struct DateTimeAddIntervalImpl { Op::constant_vector(sources_const->template get_value(), col_to->get_data(), delta_vec_column->get_data()); } else { - Op::constant_vector(sources_const->template get_value(), + Op::constant_vector(sources_const->template get_value(), col_to->get_data(), *block.get_by_position(arguments[1]).column); } @@ -876,7 +877,7 @@ struct CurrentDateTimeImpl { if constexpr (WithPrecision) { if (const auto* const_column = check_and_get_column( block.get_by_position(arguments[0]).column)) { - int scale = const_column->get_int(0); + int64_t scale = const_column->get_int(0); dtv.from_unixtime(context->state()->timestamp_ms() / 1000, context->state()->nano_seconds(), context->state()->timezone_obj(), scale); @@ -1002,6 +1003,7 @@ struct CurrentTimeImpl { }; struct TimeToSecImpl { + // rethink the func should return int32 using ReturnType = DataTypeInt32; static constexpr auto name = "time_to_sec"; static Status execute(FunctionContext* context, Block& block, const ColumnNumbers& arguments, @@ -1012,7 +1014,8 @@ struct TimeToSecImpl { auto& res_data = res_col->get_data(); for (int i = 0; i < input_rows_count; ++i) { - res_data[i] = static_cast(column_data.get_element(i)) / (1000 * 1000); + res_data[i] = + cast_set(static_cast(column_data.get_element(i)) / (1000 * 1000)); } block.replace_by_position(result, std::move(res_col)); diff --git a/be/src/vec/functions/function_datetime_string_to_string.h b/be/src/vec/functions/function_datetime_string_to_string.h index 80fe6cf1f4174b..37eaefbbee08f5 100644 --- a/be/src/vec/functions/function_datetime_string_to_string.h +++ b/be/src/vec/functions/function_datetime_string_to_string.h @@ -23,6 +23,7 @@ #include #include +#include "common/cast_set.h" #include "common/status.h" #include "vec/aggregate_functions/aggregate_function.h" #include "vec/columns/column.h" @@ -46,6 +47,7 @@ #include "vec/runtime/vdatetime_value.h" namespace doris { +#include "common/compile_check_begin.h" class FunctionContext; } // namespace doris @@ -189,7 +191,7 @@ class FunctionDateTimeStringToString : public IFunction { for (int i = 0; i < len; ++i) { null_map[i] = Transform::template execute( ts[i], format, res_data, offset, context->state()->timezone_obj()); - res_offsets[i] = offset; + res_offsets[i] = cast_set(offset); } res_data.resize(offset); }, @@ -199,3 +201,5 @@ class FunctionDateTimeStringToString : public IFunction { }; } // namespace doris::vectorized + +#include "common/compile_check_end.h" diff --git a/be/src/vec/functions/function_encryption.cpp b/be/src/vec/functions/function_encryption.cpp index 9aaefc26a652cc..9c8028b1d87cb0 100644 --- a/be/src/vec/functions/function_encryption.cpp +++ b/be/src/vec/functions/function_encryption.cpp @@ -15,32 +15,25 @@ // specific language governing permissions and limitations // under the License. -#include -#include - #include +#include +#include #include #include #include #include #include +#include "common/cast_set.h" #include "common/status.h" #include "util/encryption_util.h" -#include "util/string_util.h" -#include "vec/aggregate_functions/aggregate_function.h" #include "vec/columns/column.h" #include "vec/columns/column_nullable.h" #include "vec/columns/column_string.h" #include "vec/columns/column_vector.h" -#include "vec/columns/columns_number.h" #include "vec/common/assert_cast.h" -#include "vec/common/pod_array.h" #include "vec/common/string_ref.h" #include "vec/core/block.h" -#include "vec/core/column_numbers.h" -#include "vec/core/column_with_type_and_name.h" -#include "vec/core/types.h" #include "vec/data_types/data_type.h" #include "vec/data_types/data_type_nullable.h" #include "vec/data_types/data_type_string.h" @@ -50,6 +43,7 @@ #include "vec/utils/util.hpp" namespace doris { +#include "common/compile_check_begin.h" class FunctionContext; } // namespace doris @@ -136,9 +130,9 @@ void execute_result_vector(std::vector& offsets_li template void execute_result_const(const ColumnString::Offsets* offsets_column, const ColumnString::Chars* chars_column, StringRef key_arg, size_t i, - EncryptionMode& encryption_mode, const char* iv_raw, int iv_length, + EncryptionMode& encryption_mode, const char* iv_raw, size_t iv_length, ColumnString::Chars& result_data, ColumnString::Offsets& result_offset, - NullMap& null_map, const char* aad, int aad_length) { + NullMap& null_map, const char* aad, size_t aad_length) { int src_size = (*offsets_column)[i] - (*offsets_column)[i - 1]; const auto* src_raw = reinterpret_cast(&(*chars_column)[(*offsets_column)[i - 1]]); execute_result(src_raw, src_size, key_arg.data, key_arg.size, i, @@ -147,15 +141,15 @@ void execute_result_const(const ColumnString::Offsets* offsets_column, } template -void execute_result(const char* src_raw, int src_size, const char* key_raw, int key_size, size_t i, - EncryptionMode& encryption_mode, const char* iv_raw, int iv_length, +void execute_result(const char* src_raw, size_t src_size, const char* key_raw, size_t key_size, + size_t i, EncryptionMode& encryption_mode, const char* iv_raw, size_t iv_length, ColumnString::Chars& result_data, ColumnString::Offsets& result_offset, - NullMap& null_map, const char* aad, int aad_length) { + NullMap& null_map, const char* aad, size_t aad_length) { if (src_size == 0) { StringOP::push_null_string(i, result_data, result_offset, null_map); return; } - int cipher_len = src_size; + auto cipher_len = src_size; if constexpr (is_encrypt) { cipher_len += 16; // for output AEAD tag @@ -438,22 +432,25 @@ struct EncryptionAndDecryptMultiImpl { }; struct EncryptImpl { - static int execute_impl(EncryptionMode mode, const unsigned char* source, - uint32_t source_length, const unsigned char* key, uint32_t key_length, - const char* iv, int iv_length, bool padding, unsigned char* encrypt, - const unsigned char* aad, int aad_length) { - return EncryptionUtil::encrypt(mode, source, source_length, key, key_length, iv, iv_length, - true, encrypt, aad, aad_length); + static int execute_impl(EncryptionMode mode, const unsigned char* source, size_t source_length, + const unsigned char* key, size_t key_length, const char* iv, + size_t iv_length, bool padding, unsigned char* encrypt, + const unsigned char* aad, size_t aad_length) { + // now the openssl only support int, so here we need to cast size_t to uint32_t + return EncryptionUtil::encrypt(mode, source, cast_set(source_length), key, + cast_set(key_length), iv, cast_set(iv_length), + true, encrypt, aad, cast_set(aad_length)); } }; struct DecryptImpl { - static int execute_impl(EncryptionMode mode, const unsigned char* source, - uint32_t source_length, const unsigned char* key, uint32_t key_length, - const char* iv, int iv_length, bool padding, unsigned char* encrypt, - const unsigned char* aad, int aad_length) { - return EncryptionUtil::decrypt(mode, source, source_length, key, key_length, iv, iv_length, - true, encrypt, aad, aad_length); + static int execute_impl(EncryptionMode mode, const unsigned char* source, size_t source_length, + const unsigned char* key, size_t key_length, const char* iv, + size_t iv_length, bool padding, unsigned char* encrypt, + const unsigned char* aad, size_t aad_length) { + return EncryptionUtil::decrypt(mode, source, cast_set(source_length), key, + cast_set(key_length), iv, cast_set(iv_length), + true, encrypt, aad, cast_set(aad_length)); } }; diff --git a/be/src/vec/functions/function_hash.cpp b/be/src/vec/functions/function_hash.cpp index 972d2eb0b9d8a1..a4648e54dfd512 100644 --- a/be/src/vec/functions/function_hash.cpp +++ b/be/src/vec/functions/function_hash.cpp @@ -38,6 +38,7 @@ #include "vec/utils/template_helpers.hpp" namespace doris::vectorized { +#include "common/compile_check_begin.h" constexpr uint64_t emtpy_value = 0xe28dbde7fe22e41c; template diff --git a/be/src/vec/functions/function_hex.cpp b/be/src/vec/functions/function_hex.cpp index f66849b9336335..5122fcb7ba1d64 100644 --- a/be/src/vec/functions/function_hex.cpp +++ b/be/src/vec/functions/function_hex.cpp @@ -25,6 +25,7 @@ #include #include +#include "common/cast_set.h" #include "common/status.h" #include "olap/hll.h" #include "util/simd/vstring_function.h" //place this header file at last to compile @@ -46,6 +47,7 @@ #include "vec/functions/simple_function_factory.h" namespace doris { +#include "common/compile_check_begin.h" class FunctionContext; } // namespace doris @@ -111,7 +113,7 @@ struct HexStringImpl { auto source = reinterpret_cast(&data[offsets[i - 1]]); size_t srclen = offsets[i] - offsets[i - 1]; hex_encode(source, srclen, dst_data_ptr, offset); - dst_offsets[i] = offset; + dst_offsets[i] = cast_set(offset); } return Status::OK(); } @@ -184,7 +186,7 @@ struct HexHLLImpl { dst_data_ptr = res_data.data() + offset; hex_encode(reinterpret_cast(hll_str.data()), hll_str.length(), dst_data_ptr, offset); - res_offsets[i] = offset; + res_offsets[i] = cast_set(offset); hll_str.clear(); } return Status::OK(); diff --git a/be/src/vec/functions/function_hll.cpp b/be/src/vec/functions/function_hll.cpp index a6b91e27c2dd1f..f47c1a8af45fb0 100644 --- a/be/src/vec/functions/function_hll.cpp +++ b/be/src/vec/functions/function_hll.cpp @@ -22,6 +22,7 @@ #include #include +#include "common/cast_set.h" #include "common/status.h" #include "olap/hll.h" #include "util/hash_util.hpp" @@ -47,6 +48,7 @@ #include "vec/functions/simple_function_factory.h" namespace doris::vectorized { +#include "common/compile_check_begin.h" struct HLLCardinality { static constexpr auto name = "hll_cardinality"; @@ -167,8 +169,8 @@ class FunctionHllFromBase64 : public IFunction { res.reserve(input_rows_count); std::string decode_buff; - int last_decode_buff_len = 0; - int curr_decode_buff_len = 0; + int64_t last_decode_buff_len = 0; + int64_t curr_decode_buff_len = 0; for (size_t i = 0; i < input_rows_count; ++i) { const char* src_str = reinterpret_cast(&data[offsets[i - 1]]); int64_t src_size = offsets[i] - offsets[i - 1]; @@ -302,7 +304,7 @@ struct HllToBase64 { DCHECK(outlen > 0); encoded_offset += outlen; - offsets[i] = encoded_offset; + offsets[i] = cast_set(encoded_offset); } return Status::OK(); } diff --git a/be/src/vec/functions/function_ip.h b/be/src/vec/functions/function_ip.h index ddb99d80a1b10b..51675ae7c7d893 100644 --- a/be/src/vec/functions/function_ip.h +++ b/be/src/vec/functions/function_ip.h @@ -24,6 +24,7 @@ #include #include +#include "common/cast_set.h" #include "vec/columns/column.h" #include "vec/columns/column_const.h" #include "vec/columns/column_nullable.h" @@ -49,6 +50,7 @@ #include "vec/runtime/ip_address_cidr.h" namespace doris::vectorized { +#include "common/compile_check_begin.h" class FunctionIPv4NumToString : public IFunction { private: @@ -75,12 +77,11 @@ class FunctionIPv4NumToString : public IFunction { for (size_t i = 0; i < vec_in.size(); ++i) { auto value = vec_in[i]; if (value < IPV4_MIN_NUM_VALUE || value > IPV4_MAX_NUM_VALUE) { - offsets_res[i] = pos - begin; null_map->get_data()[i] = 1; } else { format_ipv4(reinterpret_cast(&vec_in[i]), src_size, pos); - offsets_res[i] = pos - begin; } + offsets_res[i] = cast_set(pos - begin); } vec_res.resize(pos - begin); @@ -283,7 +284,6 @@ void process_ipv6_column(const ColumnPtr& column, size_t input_rows_count, } if (is_empty) { - offsets_res[i] = pos - begin; null_map->get_data()[i] = 1; } else { if constexpr (std::is_same_v) { @@ -296,8 +296,8 @@ void process_ipv6_column(const ColumnPtr& column, size_t input_rows_count, std::reverse(ipv6_address_data, ipv6_address_data + IPV6_BINARY_LENGTH); format_ipv6(ipv6_address_data, pos); } - offsets_res[i] = pos - begin; } + offsets_res[i] = cast_set(pos - begin); } } @@ -829,7 +829,7 @@ class FunctionIPv4CIDRToRange : public IFunction { throw Exception(ErrorCode::INVALID_ARGUMENT, "Illegal cidr value '{}'", std::to_string(cidr)); } - auto range = apply_cidr_mask(ip, cidr); + auto range = apply_cidr_mask(ip, cast_set(cidr)); vec_lower_range_output[i] = range.first; vec_upper_range_output[i] = range.second; } @@ -841,7 +841,7 @@ class FunctionIPv4CIDRToRange : public IFunction { } for (size_t i = 0; i < input_rows_count; ++i) { auto ip = vec_ip_input[i]; - auto range = apply_cidr_mask(ip, cidr); + auto range = apply_cidr_mask(ip, cast_set(cidr)); vec_lower_range_output[i] = range.first; vec_upper_range_output[i] = range.second; } @@ -853,7 +853,7 @@ class FunctionIPv4CIDRToRange : public IFunction { throw Exception(ErrorCode::INVALID_ARGUMENT, "Illegal cidr value '{}'", std::to_string(cidr)); } - auto range = apply_cidr_mask(ip, cidr); + auto range = apply_cidr_mask(ip, cast_set(cidr)); vec_lower_range_output[i] = range.first; vec_upper_range_output[i] = range.second; } @@ -937,11 +937,13 @@ class FunctionIPv6CIDRToRange : public IFunction { auto* src_data = const_cast(from_column.get_data_at(0).data); std::reverse(src_data, src_data + IPV6_BINARY_LENGTH); apply_cidr_mask(src_data, reinterpret_cast(&vec_res_lower_range[i]), - reinterpret_cast(&vec_res_upper_range[i]), cidr); + reinterpret_cast(&vec_res_upper_range[i]), + cast_set(cidr)); } else { apply_cidr_mask(from_column.get_data_at(0).data, reinterpret_cast(&vec_res_lower_range[i]), - reinterpret_cast(&vec_res_upper_range[i]), cidr); + reinterpret_cast(&vec_res_upper_range[i]), + cast_set(cidr)); } } } else if (is_cidr_const) { @@ -957,11 +959,13 @@ class FunctionIPv6CIDRToRange : public IFunction { auto* src_data = const_cast(from_column.get_data_at(i).data); std::reverse(src_data, src_data + IPV6_BINARY_LENGTH); apply_cidr_mask(src_data, reinterpret_cast(&vec_res_lower_range[i]), - reinterpret_cast(&vec_res_upper_range[i]), cidr); + reinterpret_cast(&vec_res_upper_range[i]), + cast_set(cidr)); } else { apply_cidr_mask(from_column.get_data_at(i).data, reinterpret_cast(&vec_res_lower_range[i]), - reinterpret_cast(&vec_res_upper_range[i]), cidr); + reinterpret_cast(&vec_res_upper_range[i]), + cast_set(cidr)); } } } else { @@ -977,11 +981,13 @@ class FunctionIPv6CIDRToRange : public IFunction { auto* src_data = const_cast(from_column.get_data_at(i).data); std::reverse(src_data, src_data + IPV6_BINARY_LENGTH); apply_cidr_mask(src_data, reinterpret_cast(&vec_res_lower_range[i]), - reinterpret_cast(&vec_res_upper_range[i]), cidr); + reinterpret_cast(&vec_res_upper_range[i]), + cast_set(cidr)); } else { apply_cidr_mask(from_column.get_data_at(i).data, reinterpret_cast(&vec_res_lower_range[i]), - reinterpret_cast(&vec_res_upper_range[i]), cidr); + reinterpret_cast(&vec_res_upper_range[i]), + cast_set(cidr)); } } } @@ -1315,7 +1321,7 @@ class FunctionCutIPv6 : public IFunction { UInt8 bytes_to_cut_count = is_ipv4_mapped(address) ? bytes_to_cut_for_ipv4_count : bytes_to_cut_for_ipv6_count; cut_address(address, pos, bytes_to_cut_count); - offsets_res[i] = pos - begin; + offsets_res[i] = cast_set(pos - begin); } block.replace_by_position(result, std::move(col_res)); @@ -1335,3 +1341,5 @@ class FunctionCutIPv6 : public IFunction { }; } // namespace doris::vectorized + +#include "common/compile_check_end.h"