be/src/exprs/function/cast/function_cast.cpp
Line | Count | Source |
1 | | // Licensed to the Apache Software Foundation (ASF) under one |
2 | | // or more contributor license agreements. See the NOTICE file |
3 | | // distributed with this work for additional information |
4 | | // regarding copyright ownership. The ASF licenses this file |
5 | | // to you under the Apache License, Version 2.0 (the |
6 | | // "License"); you may not use this file except in compliance |
7 | | // with the License. You may obtain a copy of the License at |
8 | | // |
9 | | // http://www.apache.org/licenses/LICENSE-2.0 |
10 | | // |
11 | | // Unless required by applicable law or agreed to in writing, |
12 | | // software distributed under the License is distributed on an |
13 | | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
14 | | // KIND, either express or implied. See the License for the |
15 | | // specific language governing permissions and limitations |
16 | | // under the License. |
17 | | |
18 | | #include <utility> |
19 | | |
20 | | #include "core/data_type/data_type_agg_state.h" |
21 | | #include "core/data_type/data_type_decimal.h" |
22 | | #include "core/data_type/data_type_number.h" // IWYU pragma: keep |
23 | | #include "core/data_type/data_type_quantilestate.h" |
24 | | #include "core/data_type/primitive_type.h" |
25 | | #include "exprs/function/cast/cast_to_array.h" |
26 | | #include "exprs/function/cast/cast_to_jsonb.h" |
27 | | #include "exprs/function/cast/cast_to_map.h" |
28 | | #include "exprs/function/cast/cast_to_struct.h" |
29 | | #include "exprs/function/cast/cast_to_variant.h" |
30 | | #include "exprs/function/cast/cast_wrapper_decls.h" |
31 | | #include "exprs/function/simple_function_factory.h" |
32 | | |
33 | | namespace doris { |
34 | | |
35 | | namespace CastWrapper { |
36 | | |
37 | | WrapperType create_hll_wrapper(FunctionContext* context, const DataTypePtr& from_type_untyped, |
38 | 6 | const DataTypeHLL& to_type) { |
39 | | /// Conversion from String through parsing. |
40 | 6 | if (check_and_get_data_type<DataTypeString>(from_type_untyped.get())) { |
41 | 6 | return cast_from_string_to_generic; |
42 | 6 | } |
43 | | |
44 | 0 | return CastWrapper::create_unsupport_wrapper("Cast to HLL only support from String type"); |
45 | 6 | } |
46 | | |
47 | | WrapperType create_bitmap_wrapper(FunctionContext* context, const DataTypePtr& from_type_untyped, |
48 | 5 | const DataTypeBitMap& to_type) { |
49 | | /// Conversion from String through parsing. |
50 | 5 | if (check_and_get_data_type<DataTypeString>(from_type_untyped.get())) { |
51 | 5 | return cast_from_string_to_generic; |
52 | 5 | } |
53 | | |
54 | 0 | return CastWrapper::create_unsupport_wrapper("Cast to BitMap only support from String type"); |
55 | 5 | } |
56 | | |
57 | | WrapperType create_quantile_state_wrapper(FunctionContext* context, |
58 | | const DataTypePtr& from_type_untyped, |
59 | 2 | const DataTypeQuantileState& to_type) { |
60 | | /// Conversion from String through parsing. |
61 | 2 | if (check_and_get_data_type<DataTypeString>(from_type_untyped.get())) { |
62 | 2 | return cast_from_string_to_generic; |
63 | 2 | } |
64 | | |
65 | 0 | return CastWrapper::create_unsupport_wrapper( |
66 | 0 | "Cast to QuantileState only support from String type"); |
67 | 2 | } |
68 | | |
69 | 2 | WrapperType create_varbinary_wrapper(const DataTypePtr& from_type_untyped) { |
70 | | /// Conversion from String through parsing. |
71 | 2 | if (check_and_get_data_type<DataTypeString>(from_type_untyped.get())) { |
72 | 2 | return cast_from_string_to_generic; |
73 | 2 | } |
74 | | |
75 | 0 | return CastWrapper::create_unsupport_wrapper("Cast to Varbinary only support from String type"); |
76 | 2 | } |
77 | | |
78 | | WrapperType prepare_unpack_dictionaries(FunctionContext* context, const DataTypePtr& from_type, |
79 | 442k | const DataTypePtr& to_type) { |
80 | 442k | const auto& from_nested = from_type; |
81 | 442k | const auto& to_nested = to_type; |
82 | | |
83 | 442k | if (from_type->is_null_literal()) { |
84 | 2.14k | if (!to_nested->is_nullable()) { |
85 | 0 | return CastWrapper::create_unsupport_wrapper( |
86 | 0 | "Cannot convert NULL to a non-nullable type"); |
87 | 0 | } |
88 | | |
89 | 2.14k | return [](FunctionContext* context, Block& block, const ColumnNumbers&, uint32_t result, |
90 | 2.14k | size_t input_rows_count, const NullMap::value_type* null_map = nullptr) { |
91 | | /// TODO: remove this in the future. |
92 | 2.14k | auto& res = block.get_by_position(result); |
93 | 2.14k | res.column = res.type->create_column_const_with_default_value(input_rows_count) |
94 | 2.14k | ->convert_to_full_column_if_const(); |
95 | 2.14k | return Status::OK(); |
96 | 2.14k | }; |
97 | 2.14k | } |
98 | | |
99 | 440k | auto wrapper = prepare_remove_nullable(context, from_nested, to_nested); |
100 | | |
101 | 440k | return wrapper; |
102 | 442k | } |
103 | | |
104 | | bool need_replace_null_data_to_default(FunctionContext* context, const DataTypePtr& from_type, |
105 | 410k | const DataTypePtr& to_type) { |
106 | 410k | if (from_type->equals(*to_type)) { |
107 | 80.8k | return false; |
108 | 80.8k | } |
109 | | |
110 | 330k | auto make_default_wrapper = [&](const auto& types) -> bool { |
111 | 248k | using Types = std::decay_t<decltype(types)>; |
112 | 248k | using ToDataType = typename Types::LeftType; |
113 | | |
114 | | if constexpr (!(IsDataTypeDecimalOrNumber<ToDataType> || IsDatelikeV1Types<ToDataType> || |
115 | | IsDatelikeV2Types<ToDataType> || |
116 | 36.5k | std::is_same_v<ToDataType, DataTypeTimeV2>)) { |
117 | 36.5k | return false; |
118 | 36.5k | } |
119 | 0 | return call_on_index_and_data_type< |
120 | 248k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { |
121 | 186k | using Types2 = std::decay_t<decltype(types2)>; |
122 | 186k | using FromDataType = typename Types2::LeftType; |
123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || |
124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || |
125 | 93.2k | std::is_same_v<FromDataType, DataTypeTimeV2>)) { |
126 | 93.2k | return false; |
127 | 93.2k | } |
128 | 61.3k | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { |
129 | 61.3k | using FromFieldType = typename FromDataType::FieldType; |
130 | 61.3k | using ToFieldType = typename ToDataType::FieldType; |
131 | 61.3k | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); |
132 | 61.3k | UInt32 from_scale = 0; |
133 | | |
134 | 61.3k | if constexpr (IsDataTypeDecimal<FromDataType>) { |
135 | 29.5k | const auto* from_decimal_type = |
136 | 29.5k | check_and_get_data_type<FromDataType>(from_type.get()); |
137 | 29.5k | from_precision = |
138 | 29.5k | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); |
139 | 29.5k | from_scale = from_decimal_type->get_scale(); |
140 | 29.5k | } |
141 | | |
142 | 61.3k | UInt32 to_max_digits = 0; |
143 | 61.3k | UInt32 to_precision = 0; |
144 | 61.3k | UInt32 to_scale = 0; |
145 | | |
146 | 61.3k | if constexpr (IsDataTypeDecimal<ToDataType>) { |
147 | 55.1k | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); |
148 | | |
149 | 55.1k | const auto* to_decimal_type = |
150 | 55.1k | check_and_get_data_type<ToDataType>(to_type.get()); |
151 | 55.1k | to_precision = to_decimal_type->get_precision(); |
152 | 55.1k | ToDataType::check_type_precision(to_precision); |
153 | | |
154 | 55.1k | to_scale = to_decimal_type->get_scale(); |
155 | 55.1k | ToDataType::check_type_scale(to_scale); |
156 | 55.1k | } |
157 | 61.3k | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { |
158 | 6.17k | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); |
159 | 6.17k | to_precision = to_max_digits; |
160 | 6.17k | } |
161 | | |
162 | 61.3k | bool narrow_integral = context->check_overflow_for_decimal() && |
163 | 61.3k | (to_precision - to_scale) <= (from_precision - from_scale); |
164 | | |
165 | 61.3k | bool multiply_may_overflow = context->check_overflow_for_decimal(); |
166 | 61.3k | if (to_scale > from_scale) { |
167 | 12.3k | multiply_may_overflow &= |
168 | 12.3k | (from_precision + to_scale - from_scale) >= to_max_digits; |
169 | 12.3k | } |
170 | 61.3k | return narrow_integral || multiply_may_overflow; |
171 | 61.3k | } |
172 | 0 | return false; |
173 | 186k | }); Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE2EEEvEEEEbRKT_ENKUlSI_E_clINSB_ISE_SE_EEEEbSI_ function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE2EEEvEEEEbRKT_ENKUlSI_E_clINSB_INSC_ILSD_3EEESE_EEEEbSI_ Line | Count | Source | 120 | 18 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 18 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 18 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 18 | return false; | 173 | 18 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE2EEEvEEEEbRKT_ENKUlSI_E_clINSB_INSC_ILSD_4EEESE_EEEEbSI_ Line | Count | Source | 120 | 15 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 15 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 15 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 15 | return false; | 173 | 15 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE2EEEvEEEEbRKT_ENKUlSI_E_clINSB_INSC_ILSD_5EEESE_EEEEbSI_ Line | Count | Source | 120 | 32 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 32 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 32 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 32 | return false; | 173 | 32 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE2EEEvEEEEbRKT_ENKUlSI_E_clINSB_INSC_ILSD_6EEESE_EEEEbSI_ Line | Count | Source | 120 | 97 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 97 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 97 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 97 | return false; | 173 | 97 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE2EEEvEEEEbRKT_ENKUlSI_E_clINSB_INSC_ILSD_7EEESE_EEEEbSI_ Line | Count | Source | 120 | 7 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 7 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 7 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 7 | return false; | 173 | 7 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE2EEEvEEEEbRKT_ENKUlSI_E_clINSB_INSC_ILSD_8EEESE_EEEEbSI_ Line | Count | Source | 120 | 2 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 2 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 2 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 2 | return false; | 173 | 2 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE2EEEvEEEEbRKT_ENKUlSI_E_clINSB_INSC_ILSD_9EEESE_EEEEbSI_ Line | Count | Source | 120 | 7 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 7 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 7 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 7 | return false; | 173 | 7 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE2EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_15DataTypeDecimalILSD_28EEESE_EEEEbSI_ Line | Count | Source | 120 | 12 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 12 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 12 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 12 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 12 | using FromFieldType = typename FromDataType::FieldType; | 130 | 12 | using ToFieldType = typename ToDataType::FieldType; | 131 | 12 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 12 | UInt32 from_scale = 0; | 133 | | | 134 | 12 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 12 | const auto* from_decimal_type = | 136 | 12 | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 12 | from_precision = | 138 | 12 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 12 | from_scale = from_decimal_type->get_scale(); | 140 | 12 | } | 141 | | | 142 | 12 | UInt32 to_max_digits = 0; | 143 | 12 | UInt32 to_precision = 0; | 144 | 12 | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | 12 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | 12 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | 12 | to_precision = to_max_digits; | 160 | 12 | } | 161 | | | 162 | 12 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 12 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 12 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 12 | if (to_scale > from_scale) { | 167 | 0 | multiply_may_overflow &= | 168 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 0 | } | 170 | 12 | return narrow_integral || multiply_may_overflow; | 171 | 12 | } | 172 | 0 | return false; | 173 | 12 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE2EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_15DataTypeDecimalILSD_29EEESE_EEEEbSI_ Line | Count | Source | 120 | 5 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 5 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 5 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 5 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 5 | using FromFieldType = typename FromDataType::FieldType; | 130 | 5 | using ToFieldType = typename ToDataType::FieldType; | 131 | 5 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 5 | UInt32 from_scale = 0; | 133 | | | 134 | 5 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 5 | const auto* from_decimal_type = | 136 | 5 | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 5 | from_precision = | 138 | 5 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 5 | from_scale = from_decimal_type->get_scale(); | 140 | 5 | } | 141 | | | 142 | 5 | UInt32 to_max_digits = 0; | 143 | 5 | UInt32 to_precision = 0; | 144 | 5 | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | 5 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | 5 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | 5 | to_precision = to_max_digits; | 160 | 5 | } | 161 | | | 162 | 5 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 5 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 5 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 5 | if (to_scale > from_scale) { | 167 | 0 | multiply_may_overflow &= | 168 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 0 | } | 170 | 5 | return narrow_integral || multiply_may_overflow; | 171 | 5 | } | 172 | 0 | return false; | 173 | 5 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE2EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_15DataTypeDecimalILSD_20EEESE_EEEEbSI_ Line | Count | Source | 120 | 2 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 2 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 2 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 2 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 2 | using FromFieldType = typename FromDataType::FieldType; | 130 | 2 | using ToFieldType = typename ToDataType::FieldType; | 131 | 2 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 2 | UInt32 from_scale = 0; | 133 | | | 134 | 2 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 2 | const auto* from_decimal_type = | 136 | 2 | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 2 | from_precision = | 138 | 2 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 2 | from_scale = from_decimal_type->get_scale(); | 140 | 2 | } | 141 | | | 142 | 2 | UInt32 to_max_digits = 0; | 143 | 2 | UInt32 to_precision = 0; | 144 | 2 | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | 2 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | 2 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | 2 | to_precision = to_max_digits; | 160 | 2 | } | 161 | | | 162 | 2 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 2 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 2 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 2 | if (to_scale > from_scale) { | 167 | 0 | multiply_may_overflow &= | 168 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 0 | } | 170 | 2 | return narrow_integral || multiply_may_overflow; | 171 | 2 | } | 172 | 0 | return false; | 173 | 2 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE2EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_15DataTypeDecimalILSD_30EEESE_EEEEbSI_ Line | Count | Source | 120 | 5 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 5 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 5 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 5 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 5 | using FromFieldType = typename FromDataType::FieldType; | 130 | 5 | using ToFieldType = typename ToDataType::FieldType; | 131 | 5 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 5 | UInt32 from_scale = 0; | 133 | | | 134 | 5 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 5 | const auto* from_decimal_type = | 136 | 5 | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 5 | from_precision = | 138 | 5 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 5 | from_scale = from_decimal_type->get_scale(); | 140 | 5 | } | 141 | | | 142 | 5 | UInt32 to_max_digits = 0; | 143 | 5 | UInt32 to_precision = 0; | 144 | 5 | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | 5 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | 5 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | 5 | to_precision = to_max_digits; | 160 | 5 | } | 161 | | | 162 | 5 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 5 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 5 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 5 | if (to_scale > from_scale) { | 167 | 0 | multiply_may_overflow &= | 168 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 0 | } | 170 | 5 | return narrow_integral || multiply_may_overflow; | 171 | 5 | } | 172 | 0 | return false; | 173 | 5 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE2EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_15DataTypeDecimalILSD_35EEESE_EEEEbSI_ Line | Count | Source | 120 | 2 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 2 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 2 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 2 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 2 | using FromFieldType = typename FromDataType::FieldType; | 130 | 2 | using ToFieldType = typename ToDataType::FieldType; | 131 | 2 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 2 | UInt32 from_scale = 0; | 133 | | | 134 | 2 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 2 | const auto* from_decimal_type = | 136 | 2 | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 2 | from_precision = | 138 | 2 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 2 | from_scale = from_decimal_type->get_scale(); | 140 | 2 | } | 141 | | | 142 | 2 | UInt32 to_max_digits = 0; | 143 | 2 | UInt32 to_precision = 0; | 144 | 2 | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | 2 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | 2 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | 2 | to_precision = to_max_digits; | 160 | 2 | } | 161 | | | 162 | 2 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 2 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 2 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 2 | if (to_scale > from_scale) { | 167 | 0 | multiply_may_overflow &= | 168 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 0 | } | 170 | 2 | return narrow_integral || multiply_may_overflow; | 171 | 2 | } | 172 | 0 | return false; | 173 | 2 | }); |
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE2EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_12DataTypeDateESE_EEEEbSI_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE2EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeDateV2ESE_EEEEbSI_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE2EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_18DataTypeDateTimeV2ESE_EEEEbSI_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE2EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_16DataTypeDateTimeESE_EEEEbSI_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE2EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeTimeV2ESE_EEEEbSI_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE2EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_19DataTypeTimeStampTzESE_EEEEbSI_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE2EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_12DataTypeIPv4ESE_EEEEbSI_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE2EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_12DataTypeIPv6ESE_EEEEbSI_ function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE2EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeStringESE_EEEEbSI_ Line | Count | Source | 120 | 820 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 820 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 820 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | 820 | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | 820 | return false; | 127 | 820 | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 820 | return false; | 173 | 820 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE3EEEvEEEEbRKT_ENKUlSI_E_clINSB_INSC_ILSD_2EEESE_EEEEbSI_ Line | Count | Source | 120 | 2.57k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 2.57k | using Types2 = std::decay_t<decltype(types2)>; | 122 | 2.57k | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 2.57k | return false; | 173 | 2.57k | }); |
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE3EEEvEEEEbRKT_ENKUlSI_E_clINSB_ISE_SE_EEEEbSI_ function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE3EEEvEEEEbRKT_ENKUlSI_E_clINSB_INSC_ILSD_4EEESE_EEEEbSI_ Line | Count | Source | 120 | 10 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 10 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 10 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 10 | return false; | 173 | 10 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE3EEEvEEEEbRKT_ENKUlSI_E_clINSB_INSC_ILSD_5EEESE_EEEEbSI_ Line | Count | Source | 120 | 143 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 143 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 143 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 143 | return false; | 173 | 143 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE3EEEvEEEEbRKT_ENKUlSI_E_clINSB_INSC_ILSD_6EEESE_EEEEbSI_ Line | Count | Source | 120 | 220 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 220 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 220 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 220 | return false; | 173 | 220 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE3EEEvEEEEbRKT_ENKUlSI_E_clINSB_INSC_ILSD_7EEESE_EEEEbSI_ Line | Count | Source | 120 | 7 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 7 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 7 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 7 | return false; | 173 | 7 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE3EEEvEEEEbRKT_ENKUlSI_E_clINSB_INSC_ILSD_8EEESE_EEEEbSI_ Line | Count | Source | 120 | 23 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 23 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 23 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 23 | return false; | 173 | 23 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE3EEEvEEEEbRKT_ENKUlSI_E_clINSB_INSC_ILSD_9EEESE_EEEEbSI_ Line | Count | Source | 120 | 30 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 30 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 30 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 30 | return false; | 173 | 30 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE3EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_15DataTypeDecimalILSD_28EEESE_EEEEbSI_ Line | Count | Source | 120 | 21 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 21 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 21 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 21 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 21 | using FromFieldType = typename FromDataType::FieldType; | 130 | 21 | using ToFieldType = typename ToDataType::FieldType; | 131 | 21 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 21 | UInt32 from_scale = 0; | 133 | | | 134 | 21 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 21 | const auto* from_decimal_type = | 136 | 21 | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 21 | from_precision = | 138 | 21 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 21 | from_scale = from_decimal_type->get_scale(); | 140 | 21 | } | 141 | | | 142 | 21 | UInt32 to_max_digits = 0; | 143 | 21 | UInt32 to_precision = 0; | 144 | 21 | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | 21 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | 21 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | 21 | to_precision = to_max_digits; | 160 | 21 | } | 161 | | | 162 | 21 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 21 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 21 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 21 | if (to_scale > from_scale) { | 167 | 0 | multiply_may_overflow &= | 168 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 0 | } | 170 | 21 | return narrow_integral || multiply_may_overflow; | 171 | 21 | } | 172 | 0 | return false; | 173 | 21 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE3EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_15DataTypeDecimalILSD_29EEESE_EEEEbSI_ Line | Count | Source | 120 | 24 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 24 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 24 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 24 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 24 | using FromFieldType = typename FromDataType::FieldType; | 130 | 24 | using ToFieldType = typename ToDataType::FieldType; | 131 | 24 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 24 | UInt32 from_scale = 0; | 133 | | | 134 | 24 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 24 | const auto* from_decimal_type = | 136 | 24 | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 24 | from_precision = | 138 | 24 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 24 | from_scale = from_decimal_type->get_scale(); | 140 | 24 | } | 141 | | | 142 | 24 | UInt32 to_max_digits = 0; | 143 | 24 | UInt32 to_precision = 0; | 144 | 24 | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | 24 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | 24 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | 24 | to_precision = to_max_digits; | 160 | 24 | } | 161 | | | 162 | 24 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 24 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 24 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 24 | if (to_scale > from_scale) { | 167 | 0 | multiply_may_overflow &= | 168 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 0 | } | 170 | 24 | return narrow_integral || multiply_may_overflow; | 171 | 24 | } | 172 | 0 | return false; | 173 | 24 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE3EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_15DataTypeDecimalILSD_20EEESE_EEEEbSI_ Line | Count | Source | 120 | 8 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 8 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 8 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 8 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 8 | using FromFieldType = typename FromDataType::FieldType; | 130 | 8 | using ToFieldType = typename ToDataType::FieldType; | 131 | 8 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 8 | UInt32 from_scale = 0; | 133 | | | 134 | 8 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 8 | const auto* from_decimal_type = | 136 | 8 | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 8 | from_precision = | 138 | 8 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 8 | from_scale = from_decimal_type->get_scale(); | 140 | 8 | } | 141 | | | 142 | 8 | UInt32 to_max_digits = 0; | 143 | 8 | UInt32 to_precision = 0; | 144 | 8 | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | 8 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | 8 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | 8 | to_precision = to_max_digits; | 160 | 8 | } | 161 | | | 162 | 8 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 8 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 8 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 8 | if (to_scale > from_scale) { | 167 | 0 | multiply_may_overflow &= | 168 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 0 | } | 170 | 8 | return narrow_integral || multiply_may_overflow; | 171 | 8 | } | 172 | 0 | return false; | 173 | 8 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE3EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_15DataTypeDecimalILSD_30EEESE_EEEEbSI_ Line | Count | Source | 120 | 25 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 25 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 25 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 25 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 25 | using FromFieldType = typename FromDataType::FieldType; | 130 | 25 | using ToFieldType = typename ToDataType::FieldType; | 131 | 25 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 25 | UInt32 from_scale = 0; | 133 | | | 134 | 25 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 25 | const auto* from_decimal_type = | 136 | 25 | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 25 | from_precision = | 138 | 25 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 25 | from_scale = from_decimal_type->get_scale(); | 140 | 25 | } | 141 | | | 142 | 25 | UInt32 to_max_digits = 0; | 143 | 25 | UInt32 to_precision = 0; | 144 | 25 | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | 25 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | 25 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | 25 | to_precision = to_max_digits; | 160 | 25 | } | 161 | | | 162 | 25 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 25 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 25 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 25 | if (to_scale > from_scale) { | 167 | 0 | multiply_may_overflow &= | 168 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 0 | } | 170 | 25 | return narrow_integral || multiply_may_overflow; | 171 | 25 | } | 172 | 0 | return false; | 173 | 25 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE3EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_15DataTypeDecimalILSD_35EEESE_EEEEbSI_ Line | Count | Source | 120 | 24 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 24 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 24 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 24 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 24 | using FromFieldType = typename FromDataType::FieldType; | 130 | 24 | using ToFieldType = typename ToDataType::FieldType; | 131 | 24 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 24 | UInt32 from_scale = 0; | 133 | | | 134 | 24 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 24 | const auto* from_decimal_type = | 136 | 24 | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 24 | from_precision = | 138 | 24 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 24 | from_scale = from_decimal_type->get_scale(); | 140 | 24 | } | 141 | | | 142 | 24 | UInt32 to_max_digits = 0; | 143 | 24 | UInt32 to_precision = 0; | 144 | 24 | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | 24 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | 24 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | 24 | to_precision = to_max_digits; | 160 | 24 | } | 161 | | | 162 | 24 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 24 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 24 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 24 | if (to_scale > from_scale) { | 167 | 0 | multiply_may_overflow &= | 168 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 0 | } | 170 | 24 | return narrow_integral || multiply_may_overflow; | 171 | 24 | } | 172 | 0 | return false; | 173 | 24 | }); |
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE3EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_12DataTypeDateESE_EEEEbSI_ function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE3EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeDateV2ESE_EEEEbSI_ Line | Count | Source | 120 | 72 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 72 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 72 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 72 | return false; | 173 | 72 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE3EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_18DataTypeDateTimeV2ESE_EEEEbSI_ Line | Count | Source | 120 | 24 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 24 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 24 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 24 | return false; | 173 | 24 | }); |
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE3EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_16DataTypeDateTimeESE_EEEEbSI_ function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE3EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeTimeV2ESE_EEEEbSI_ Line | Count | Source | 120 | 320 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 320 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 320 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 320 | return false; | 173 | 320 | }); |
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE3EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_19DataTypeTimeStampTzESE_EEEEbSI_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE3EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_12DataTypeIPv4ESE_EEEEbSI_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE3EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_12DataTypeIPv6ESE_EEEEbSI_ function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE3EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeStringESE_EEEEbSI_ Line | Count | Source | 120 | 4.05k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 4.05k | using Types2 = std::decay_t<decltype(types2)>; | 122 | 4.05k | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | 4.05k | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | 4.05k | return false; | 127 | 4.05k | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 4.05k | return false; | 173 | 4.05k | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE4EEEvEEEEbRKT_ENKUlSI_E_clINSB_INSC_ILSD_2EEESE_EEEEbSI_ Line | Count | Source | 120 | 306 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 306 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 306 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 306 | return false; | 173 | 306 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE4EEEvEEEEbRKT_ENKUlSI_E_clINSB_INSC_ILSD_3EEESE_EEEEbSI_ Line | Count | Source | 120 | 1.55k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 1.55k | using Types2 = std::decay_t<decltype(types2)>; | 122 | 1.55k | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 1.55k | return false; | 173 | 1.55k | }); |
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE4EEEvEEEEbRKT_ENKUlSI_E_clINSB_ISE_SE_EEEEbSI_ function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE4EEEvEEEEbRKT_ENKUlSI_E_clINSB_INSC_ILSD_5EEESE_EEEEbSI_ Line | Count | Source | 120 | 138 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 138 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 138 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 138 | return false; | 173 | 138 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE4EEEvEEEEbRKT_ENKUlSI_E_clINSB_INSC_ILSD_6EEESE_EEEEbSI_ Line | Count | Source | 120 | 100 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 100 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 100 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 100 | return false; | 173 | 100 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE4EEEvEEEEbRKT_ENKUlSI_E_clINSB_INSC_ILSD_7EEESE_EEEEbSI_ Line | Count | Source | 120 | 20 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 20 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 20 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 20 | return false; | 173 | 20 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE4EEEvEEEEbRKT_ENKUlSI_E_clINSB_INSC_ILSD_8EEESE_EEEEbSI_ Line | Count | Source | 120 | 21 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 21 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 21 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 21 | return false; | 173 | 21 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE4EEEvEEEEbRKT_ENKUlSI_E_clINSB_INSC_ILSD_9EEESE_EEEEbSI_ Line | Count | Source | 120 | 25 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 25 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 25 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 25 | return false; | 173 | 25 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE4EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_15DataTypeDecimalILSD_28EEESE_EEEEbSI_ Line | Count | Source | 120 | 21 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 21 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 21 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 21 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 21 | using FromFieldType = typename FromDataType::FieldType; | 130 | 21 | using ToFieldType = typename ToDataType::FieldType; | 131 | 21 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 21 | UInt32 from_scale = 0; | 133 | | | 134 | 21 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 21 | const auto* from_decimal_type = | 136 | 21 | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 21 | from_precision = | 138 | 21 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 21 | from_scale = from_decimal_type->get_scale(); | 140 | 21 | } | 141 | | | 142 | 21 | UInt32 to_max_digits = 0; | 143 | 21 | UInt32 to_precision = 0; | 144 | 21 | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | 21 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | 21 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | 21 | to_precision = to_max_digits; | 160 | 21 | } | 161 | | | 162 | 21 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 21 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 21 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 21 | if (to_scale > from_scale) { | 167 | 0 | multiply_may_overflow &= | 168 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 0 | } | 170 | 21 | return narrow_integral || multiply_may_overflow; | 171 | 21 | } | 172 | 0 | return false; | 173 | 21 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE4EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_15DataTypeDecimalILSD_29EEESE_EEEEbSI_ Line | Count | Source | 120 | 24 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 24 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 24 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 24 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 24 | using FromFieldType = typename FromDataType::FieldType; | 130 | 24 | using ToFieldType = typename ToDataType::FieldType; | 131 | 24 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 24 | UInt32 from_scale = 0; | 133 | | | 134 | 24 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 24 | const auto* from_decimal_type = | 136 | 24 | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 24 | from_precision = | 138 | 24 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 24 | from_scale = from_decimal_type->get_scale(); | 140 | 24 | } | 141 | | | 142 | 24 | UInt32 to_max_digits = 0; | 143 | 24 | UInt32 to_precision = 0; | 144 | 24 | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | 24 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | 24 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | 24 | to_precision = to_max_digits; | 160 | 24 | } | 161 | | | 162 | 24 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 24 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 24 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 24 | if (to_scale > from_scale) { | 167 | 0 | multiply_may_overflow &= | 168 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 0 | } | 170 | 24 | return narrow_integral || multiply_may_overflow; | 171 | 24 | } | 172 | 0 | return false; | 173 | 24 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE4EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_15DataTypeDecimalILSD_20EEESE_EEEEbSI_ Line | Count | Source | 120 | 8 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 8 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 8 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 8 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 8 | using FromFieldType = typename FromDataType::FieldType; | 130 | 8 | using ToFieldType = typename ToDataType::FieldType; | 131 | 8 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 8 | UInt32 from_scale = 0; | 133 | | | 134 | 8 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 8 | const auto* from_decimal_type = | 136 | 8 | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 8 | from_precision = | 138 | 8 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 8 | from_scale = from_decimal_type->get_scale(); | 140 | 8 | } | 141 | | | 142 | 8 | UInt32 to_max_digits = 0; | 143 | 8 | UInt32 to_precision = 0; | 144 | 8 | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | 8 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | 8 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | 8 | to_precision = to_max_digits; | 160 | 8 | } | 161 | | | 162 | 8 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 8 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 8 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 8 | if (to_scale > from_scale) { | 167 | 0 | multiply_may_overflow &= | 168 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 0 | } | 170 | 8 | return narrow_integral || multiply_may_overflow; | 171 | 8 | } | 172 | 0 | return false; | 173 | 8 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE4EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_15DataTypeDecimalILSD_30EEESE_EEEEbSI_ Line | Count | Source | 120 | 26 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 26 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 26 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 26 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 26 | using FromFieldType = typename FromDataType::FieldType; | 130 | 26 | using ToFieldType = typename ToDataType::FieldType; | 131 | 26 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 26 | UInt32 from_scale = 0; | 133 | | | 134 | 26 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 26 | const auto* from_decimal_type = | 136 | 26 | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 26 | from_precision = | 138 | 26 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 26 | from_scale = from_decimal_type->get_scale(); | 140 | 26 | } | 141 | | | 142 | 26 | UInt32 to_max_digits = 0; | 143 | 26 | UInt32 to_precision = 0; | 144 | 26 | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | 26 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | 26 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | 26 | to_precision = to_max_digits; | 160 | 26 | } | 161 | | | 162 | 26 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 26 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 26 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 26 | if (to_scale > from_scale) { | 167 | 0 | multiply_may_overflow &= | 168 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 0 | } | 170 | 26 | return narrow_integral || multiply_may_overflow; | 171 | 26 | } | 172 | 0 | return false; | 173 | 26 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE4EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_15DataTypeDecimalILSD_35EEESE_EEEEbSI_ Line | Count | Source | 120 | 26 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 26 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 26 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 26 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 26 | using FromFieldType = typename FromDataType::FieldType; | 130 | 26 | using ToFieldType = typename ToDataType::FieldType; | 131 | 26 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 26 | UInt32 from_scale = 0; | 133 | | | 134 | 26 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 26 | const auto* from_decimal_type = | 136 | 26 | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 26 | from_precision = | 138 | 26 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 26 | from_scale = from_decimal_type->get_scale(); | 140 | 26 | } | 141 | | | 142 | 26 | UInt32 to_max_digits = 0; | 143 | 26 | UInt32 to_precision = 0; | 144 | 26 | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | 26 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | 26 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | 26 | to_precision = to_max_digits; | 160 | 26 | } | 161 | | | 162 | 26 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 26 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 26 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 26 | if (to_scale > from_scale) { | 167 | 0 | multiply_may_overflow &= | 168 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 0 | } | 170 | 26 | return narrow_integral || multiply_may_overflow; | 171 | 26 | } | 172 | 0 | return false; | 173 | 26 | }); |
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE4EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_12DataTypeDateESE_EEEEbSI_ function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE4EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeDateV2ESE_EEEEbSI_ Line | Count | Source | 120 | 72 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 72 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 72 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 72 | return false; | 173 | 72 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE4EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_18DataTypeDateTimeV2ESE_EEEEbSI_ Line | Count | Source | 120 | 24 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 24 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 24 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 24 | return false; | 173 | 24 | }); |
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE4EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_16DataTypeDateTimeESE_EEEEbSI_ function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE4EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeTimeV2ESE_EEEEbSI_ Line | Count | Source | 120 | 320 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 320 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 320 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 320 | return false; | 173 | 320 | }); |
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE4EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_19DataTypeTimeStampTzESE_EEEEbSI_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE4EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_12DataTypeIPv4ESE_EEEEbSI_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE4EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_12DataTypeIPv6ESE_EEEEbSI_ function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE4EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeStringESE_EEEEbSI_ Line | Count | Source | 120 | 2.90k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 2.90k | using Types2 = std::decay_t<decltype(types2)>; | 122 | 2.90k | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | 2.90k | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | 2.90k | return false; | 127 | 2.90k | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 2.90k | return false; | 173 | 2.90k | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE5EEEvEEEEbRKT_ENKUlSI_E_clINSB_INSC_ILSD_2EEESE_EEEEbSI_ Line | Count | Source | 120 | 44 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 44 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 44 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 44 | return false; | 173 | 44 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE5EEEvEEEEbRKT_ENKUlSI_E_clINSB_INSC_ILSD_3EEESE_EEEEbSI_ Line | Count | Source | 120 | 3.49k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 3.49k | using Types2 = std::decay_t<decltype(types2)>; | 122 | 3.49k | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 3.49k | return false; | 173 | 3.49k | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE5EEEvEEEEbRKT_ENKUlSI_E_clINSB_INSC_ILSD_4EEESE_EEEEbSI_ Line | Count | Source | 120 | 365 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 365 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 365 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 365 | return false; | 173 | 365 | }); |
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE5EEEvEEEEbRKT_ENKUlSI_E_clINSB_ISE_SE_EEEEbSI_ function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE5EEEvEEEEbRKT_ENKUlSI_E_clINSB_INSC_ILSD_6EEESE_EEEEbSI_ Line | Count | Source | 120 | 1.66k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 1.66k | using Types2 = std::decay_t<decltype(types2)>; | 122 | 1.66k | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 1.66k | return false; | 173 | 1.66k | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE5EEEvEEEEbRKT_ENKUlSI_E_clINSB_INSC_ILSD_7EEESE_EEEEbSI_ Line | Count | Source | 120 | 13 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 13 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 13 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 13 | return false; | 173 | 13 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE5EEEvEEEEbRKT_ENKUlSI_E_clINSB_INSC_ILSD_8EEESE_EEEEbSI_ Line | Count | Source | 120 | 20 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 20 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 20 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 20 | return false; | 173 | 20 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE5EEEvEEEEbRKT_ENKUlSI_E_clINSB_INSC_ILSD_9EEESE_EEEEbSI_ Line | Count | Source | 120 | 130 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 130 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 130 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 130 | return false; | 173 | 130 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE5EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_15DataTypeDecimalILSD_28EEESE_EEEEbSI_ Line | Count | Source | 120 | 21 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 21 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 21 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 21 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 21 | using FromFieldType = typename FromDataType::FieldType; | 130 | 21 | using ToFieldType = typename ToDataType::FieldType; | 131 | 21 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 21 | UInt32 from_scale = 0; | 133 | | | 134 | 21 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 21 | const auto* from_decimal_type = | 136 | 21 | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 21 | from_precision = | 138 | 21 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 21 | from_scale = from_decimal_type->get_scale(); | 140 | 21 | } | 141 | | | 142 | 21 | UInt32 to_max_digits = 0; | 143 | 21 | UInt32 to_precision = 0; | 144 | 21 | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | 21 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | 21 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | 21 | to_precision = to_max_digits; | 160 | 21 | } | 161 | | | 162 | 21 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 21 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 21 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 21 | if (to_scale > from_scale) { | 167 | 0 | multiply_may_overflow &= | 168 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 0 | } | 170 | 21 | return narrow_integral || multiply_may_overflow; | 171 | 21 | } | 172 | 0 | return false; | 173 | 21 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE5EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_15DataTypeDecimalILSD_29EEESE_EEEEbSI_ Line | Count | Source | 120 | 38 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 38 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 38 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 38 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 38 | using FromFieldType = typename FromDataType::FieldType; | 130 | 38 | using ToFieldType = typename ToDataType::FieldType; | 131 | 38 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 38 | UInt32 from_scale = 0; | 133 | | | 134 | 38 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 38 | const auto* from_decimal_type = | 136 | 38 | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 38 | from_precision = | 138 | 38 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 38 | from_scale = from_decimal_type->get_scale(); | 140 | 38 | } | 141 | | | 142 | 38 | UInt32 to_max_digits = 0; | 143 | 38 | UInt32 to_precision = 0; | 144 | 38 | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | 38 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | 38 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | 38 | to_precision = to_max_digits; | 160 | 38 | } | 161 | | | 162 | 38 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 38 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 38 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 38 | if (to_scale > from_scale) { | 167 | 0 | multiply_may_overflow &= | 168 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 0 | } | 170 | 38 | return narrow_integral || multiply_may_overflow; | 171 | 38 | } | 172 | 0 | return false; | 173 | 38 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE5EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_15DataTypeDecimalILSD_20EEESE_EEEEbSI_ Line | Count | Source | 120 | 8 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 8 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 8 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 8 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 8 | using FromFieldType = typename FromDataType::FieldType; | 130 | 8 | using ToFieldType = typename ToDataType::FieldType; | 131 | 8 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 8 | UInt32 from_scale = 0; | 133 | | | 134 | 8 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 8 | const auto* from_decimal_type = | 136 | 8 | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 8 | from_precision = | 138 | 8 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 8 | from_scale = from_decimal_type->get_scale(); | 140 | 8 | } | 141 | | | 142 | 8 | UInt32 to_max_digits = 0; | 143 | 8 | UInt32 to_precision = 0; | 144 | 8 | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | 8 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | 8 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | 8 | to_precision = to_max_digits; | 160 | 8 | } | 161 | | | 162 | 8 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 8 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 8 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 8 | if (to_scale > from_scale) { | 167 | 0 | multiply_may_overflow &= | 168 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 0 | } | 170 | 8 | return narrow_integral || multiply_may_overflow; | 171 | 8 | } | 172 | 0 | return false; | 173 | 8 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE5EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_15DataTypeDecimalILSD_30EEESE_EEEEbSI_ Line | Count | Source | 120 | 249 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 249 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 249 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 249 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 249 | using FromFieldType = typename FromDataType::FieldType; | 130 | 249 | using ToFieldType = typename ToDataType::FieldType; | 131 | 249 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 249 | UInt32 from_scale = 0; | 133 | | | 134 | 249 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 249 | const auto* from_decimal_type = | 136 | 249 | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 249 | from_precision = | 138 | 249 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 249 | from_scale = from_decimal_type->get_scale(); | 140 | 249 | } | 141 | | | 142 | 249 | UInt32 to_max_digits = 0; | 143 | 249 | UInt32 to_precision = 0; | 144 | 249 | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | 249 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | 249 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | 249 | to_precision = to_max_digits; | 160 | 249 | } | 161 | | | 162 | 249 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 249 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 249 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 249 | if (to_scale > from_scale) { | 167 | 0 | multiply_may_overflow &= | 168 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 0 | } | 170 | 249 | return narrow_integral || multiply_may_overflow; | 171 | 249 | } | 172 | 0 | return false; | 173 | 249 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE5EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_15DataTypeDecimalILSD_35EEESE_EEEEbSI_ Line | Count | Source | 120 | 21 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 21 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 21 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 21 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 21 | using FromFieldType = typename FromDataType::FieldType; | 130 | 21 | using ToFieldType = typename ToDataType::FieldType; | 131 | 21 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 21 | UInt32 from_scale = 0; | 133 | | | 134 | 21 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 21 | const auto* from_decimal_type = | 136 | 21 | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 21 | from_precision = | 138 | 21 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 21 | from_scale = from_decimal_type->get_scale(); | 140 | 21 | } | 141 | | | 142 | 21 | UInt32 to_max_digits = 0; | 143 | 21 | UInt32 to_precision = 0; | 144 | 21 | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | 21 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | 21 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | 21 | to_precision = to_max_digits; | 160 | 21 | } | 161 | | | 162 | 21 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 21 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 21 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 21 | if (to_scale > from_scale) { | 167 | 0 | multiply_may_overflow &= | 168 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 0 | } | 170 | 21 | return narrow_integral || multiply_may_overflow; | 171 | 21 | } | 172 | 0 | return false; | 173 | 21 | }); |
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE5EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_12DataTypeDateESE_EEEEbSI_ function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE5EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeDateV2ESE_EEEEbSI_ Line | Count | Source | 120 | 12 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 12 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 12 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 12 | return false; | 173 | 12 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE5EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_18DataTypeDateTimeV2ESE_EEEEbSI_ Line | Count | Source | 120 | 24 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 24 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 24 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 24 | return false; | 173 | 24 | }); |
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE5EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_16DataTypeDateTimeESE_EEEEbSI_ function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE5EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeTimeV2ESE_EEEEbSI_ Line | Count | Source | 120 | 276 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 276 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 276 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 276 | return false; | 173 | 276 | }); |
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE5EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_19DataTypeTimeStampTzESE_EEEEbSI_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE5EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_12DataTypeIPv4ESE_EEEEbSI_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE5EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_12DataTypeIPv6ESE_EEEEbSI_ function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE5EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeStringESE_EEEEbSI_ Line | Count | Source | 120 | 19.5k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 19.5k | using Types2 = std::decay_t<decltype(types2)>; | 122 | 19.5k | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | 19.5k | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | 19.5k | return false; | 127 | 19.5k | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 19.5k | return false; | 173 | 19.5k | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE6EEEvEEEEbRKT_ENKUlSI_E_clINSB_INSC_ILSD_2EEESE_EEEEbSI_ Line | Count | Source | 120 | 578 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 578 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 578 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 578 | return false; | 173 | 578 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE6EEEvEEEEbRKT_ENKUlSI_E_clINSB_INSC_ILSD_3EEESE_EEEEbSI_ Line | Count | Source | 120 | 1.27k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 1.27k | using Types2 = std::decay_t<decltype(types2)>; | 122 | 1.27k | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 1.27k | return false; | 173 | 1.27k | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE6EEEvEEEEbRKT_ENKUlSI_E_clINSB_INSC_ILSD_4EEESE_EEEEbSI_ Line | Count | Source | 120 | 659 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 659 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 659 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 659 | return false; | 173 | 659 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE6EEEvEEEEbRKT_ENKUlSI_E_clINSB_INSC_ILSD_5EEESE_EEEEbSI_ Line | Count | Source | 120 | 8.09k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 8.09k | using Types2 = std::decay_t<decltype(types2)>; | 122 | 8.09k | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 8.09k | return false; | 173 | 8.09k | }); |
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE6EEEvEEEEbRKT_ENKUlSI_E_clINSB_ISE_SE_EEEEbSI_ function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE6EEEvEEEEbRKT_ENKUlSI_E_clINSB_INSC_ILSD_7EEESE_EEEEbSI_ Line | Count | Source | 120 | 314 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 314 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 314 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 314 | return false; | 173 | 314 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE6EEEvEEEEbRKT_ENKUlSI_E_clINSB_INSC_ILSD_8EEESE_EEEEbSI_ Line | Count | Source | 120 | 642 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 642 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 642 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 642 | return false; | 173 | 642 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE6EEEvEEEEbRKT_ENKUlSI_E_clINSB_INSC_ILSD_9EEESE_EEEEbSI_ Line | Count | Source | 120 | 2.33k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 2.33k | using Types2 = std::decay_t<decltype(types2)>; | 122 | 2.33k | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 2.33k | return false; | 173 | 2.33k | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE6EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_15DataTypeDecimalILSD_28EEESE_EEEEbSI_ Line | Count | Source | 120 | 312 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 312 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 312 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 312 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 312 | using FromFieldType = typename FromDataType::FieldType; | 130 | 312 | using ToFieldType = typename ToDataType::FieldType; | 131 | 312 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 312 | UInt32 from_scale = 0; | 133 | | | 134 | 312 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 312 | const auto* from_decimal_type = | 136 | 312 | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 312 | from_precision = | 138 | 312 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 312 | from_scale = from_decimal_type->get_scale(); | 140 | 312 | } | 141 | | | 142 | 312 | UInt32 to_max_digits = 0; | 143 | 312 | UInt32 to_precision = 0; | 144 | 312 | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | 312 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | 312 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | 312 | to_precision = to_max_digits; | 160 | 312 | } | 161 | | | 162 | 312 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 312 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 312 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 312 | if (to_scale > from_scale) { | 167 | 0 | multiply_may_overflow &= | 168 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 0 | } | 170 | 313 | return narrow_integral || multiply_may_overflow; | 171 | 312 | } | 172 | 0 | return false; | 173 | 312 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE6EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_15DataTypeDecimalILSD_29EEESE_EEEEbSI_ Line | Count | Source | 120 | 318 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 318 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 318 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 318 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 318 | using FromFieldType = typename FromDataType::FieldType; | 130 | 318 | using ToFieldType = typename ToDataType::FieldType; | 131 | 318 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 318 | UInt32 from_scale = 0; | 133 | | | 134 | 318 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 318 | const auto* from_decimal_type = | 136 | 318 | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 318 | from_precision = | 138 | 318 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 318 | from_scale = from_decimal_type->get_scale(); | 140 | 318 | } | 141 | | | 142 | 318 | UInt32 to_max_digits = 0; | 143 | 318 | UInt32 to_precision = 0; | 144 | 318 | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | 318 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | 318 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | 318 | to_precision = to_max_digits; | 160 | 318 | } | 161 | | | 162 | 318 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 318 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 318 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 318 | if (to_scale > from_scale) { | 167 | 0 | multiply_may_overflow &= | 168 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 0 | } | 170 | 318 | return narrow_integral || multiply_may_overflow; | 171 | 318 | } | 172 | 0 | return false; | 173 | 318 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE6EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_15DataTypeDecimalILSD_20EEESE_EEEEbSI_ Line | Count | Source | 120 | 304 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 304 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 304 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 304 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 304 | using FromFieldType = typename FromDataType::FieldType; | 130 | 304 | using ToFieldType = typename ToDataType::FieldType; | 131 | 304 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 304 | UInt32 from_scale = 0; | 133 | | | 134 | 304 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 304 | const auto* from_decimal_type = | 136 | 304 | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 304 | from_precision = | 138 | 304 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 304 | from_scale = from_decimal_type->get_scale(); | 140 | 304 | } | 141 | | | 142 | 304 | UInt32 to_max_digits = 0; | 143 | 304 | UInt32 to_precision = 0; | 144 | 304 | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | 304 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | 304 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | 304 | to_precision = to_max_digits; | 160 | 304 | } | 161 | | | 162 | 304 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 304 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 304 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 304 | if (to_scale > from_scale) { | 167 | 0 | multiply_may_overflow &= | 168 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 0 | } | 170 | 304 | return narrow_integral || multiply_may_overflow; | 171 | 304 | } | 172 | 0 | return false; | 173 | 304 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE6EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_15DataTypeDecimalILSD_30EEESE_EEEEbSI_ Line | Count | Source | 120 | 746 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 746 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 746 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 746 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 746 | using FromFieldType = typename FromDataType::FieldType; | 130 | 746 | using ToFieldType = typename ToDataType::FieldType; | 131 | 746 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 746 | UInt32 from_scale = 0; | 133 | | | 134 | 746 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 746 | const auto* from_decimal_type = | 136 | 746 | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 746 | from_precision = | 138 | 746 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 746 | from_scale = from_decimal_type->get_scale(); | 140 | 746 | } | 141 | | | 142 | 746 | UInt32 to_max_digits = 0; | 143 | 746 | UInt32 to_precision = 0; | 144 | 746 | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | 746 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | 746 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | 746 | to_precision = to_max_digits; | 160 | 746 | } | 161 | | | 162 | 746 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 746 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 746 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 746 | if (to_scale > from_scale) { | 167 | 0 | multiply_may_overflow &= | 168 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 0 | } | 170 | 746 | return narrow_integral || multiply_may_overflow; | 171 | 746 | } | 172 | 0 | return false; | 173 | 746 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE6EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_15DataTypeDecimalILSD_35EEESE_EEEEbSI_ Line | Count | Source | 120 | 22 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 22 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 22 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 22 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 22 | using FromFieldType = typename FromDataType::FieldType; | 130 | 22 | using ToFieldType = typename ToDataType::FieldType; | 131 | 22 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 22 | UInt32 from_scale = 0; | 133 | | | 134 | 22 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 22 | const auto* from_decimal_type = | 136 | 22 | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 22 | from_precision = | 138 | 22 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 22 | from_scale = from_decimal_type->get_scale(); | 140 | 22 | } | 141 | | | 142 | 22 | UInt32 to_max_digits = 0; | 143 | 22 | UInt32 to_precision = 0; | 144 | 22 | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | 22 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | 22 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | 22 | to_precision = to_max_digits; | 160 | 22 | } | 161 | | | 162 | 22 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 22 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 22 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 22 | if (to_scale > from_scale) { | 167 | 0 | multiply_may_overflow &= | 168 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 0 | } | 170 | 22 | return narrow_integral || multiply_may_overflow; | 171 | 22 | } | 172 | 0 | return false; | 173 | 22 | }); |
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE6EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_12DataTypeDateESE_EEEEbSI_ function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE6EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeDateV2ESE_EEEEbSI_ Line | Count | Source | 120 | 1.25k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 1.25k | using Types2 = std::decay_t<decltype(types2)>; | 122 | 1.25k | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 1.25k | return false; | 173 | 1.25k | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE6EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_18DataTypeDateTimeV2ESE_EEEEbSI_ Line | Count | Source | 120 | 1.25k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 1.25k | using Types2 = std::decay_t<decltype(types2)>; | 122 | 1.25k | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 1.25k | return false; | 173 | 1.25k | }); |
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE6EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_16DataTypeDateTimeESE_EEEEbSI_ function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE6EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeTimeV2ESE_EEEEbSI_ Line | Count | Source | 120 | 4 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 4 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 4 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 4 | return false; | 173 | 4 | }); |
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE6EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_19DataTypeTimeStampTzESE_EEEEbSI_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE6EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_12DataTypeIPv4ESE_EEEEbSI_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE6EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_12DataTypeIPv6ESE_EEEEbSI_ function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE6EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeStringESE_EEEEbSI_ Line | Count | Source | 120 | 22.1k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 22.1k | using Types2 = std::decay_t<decltype(types2)>; | 122 | 22.1k | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | 22.1k | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | 22.1k | return false; | 127 | 22.1k | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 22.1k | return false; | 173 | 22.1k | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE7EEEvEEEEbRKT_ENKUlSI_E_clINSB_INSC_ILSD_2EEESE_EEEEbSI_ Line | Count | Source | 120 | 131 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 131 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 131 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 131 | return false; | 173 | 131 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE7EEEvEEEEbRKT_ENKUlSI_E_clINSB_INSC_ILSD_3EEESE_EEEEbSI_ Line | Count | Source | 120 | 109 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 109 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 109 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 109 | return false; | 173 | 109 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE7EEEvEEEEbRKT_ENKUlSI_E_clINSB_INSC_ILSD_4EEESE_EEEEbSI_ Line | Count | Source | 120 | 79 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 79 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 79 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 79 | return false; | 173 | 79 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE7EEEvEEEEbRKT_ENKUlSI_E_clINSB_INSC_ILSD_5EEESE_EEEEbSI_ Line | Count | Source | 120 | 135 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 135 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 135 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 135 | return false; | 173 | 135 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE7EEEvEEEEbRKT_ENKUlSI_E_clINSB_INSC_ILSD_6EEESE_EEEEbSI_ Line | Count | Source | 120 | 590 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 590 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 590 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 590 | return false; | 173 | 590 | }); |
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE7EEEvEEEEbRKT_ENKUlSI_E_clINSB_ISE_SE_EEEEbSI_ function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE7EEEvEEEEbRKT_ENKUlSI_E_clINSB_INSC_ILSD_8EEESE_EEEEbSI_ Line | Count | Source | 120 | 9 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 9 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 9 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 9 | return false; | 173 | 9 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE7EEEvEEEEbRKT_ENKUlSI_E_clINSB_INSC_ILSD_9EEESE_EEEEbSI_ Line | Count | Source | 120 | 13 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 13 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 13 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 13 | return false; | 173 | 13 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE7EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_15DataTypeDecimalILSD_28EEESE_EEEEbSI_ Line | Count | Source | 120 | 18 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 18 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 18 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 18 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 18 | using FromFieldType = typename FromDataType::FieldType; | 130 | 18 | using ToFieldType = typename ToDataType::FieldType; | 131 | 18 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 18 | UInt32 from_scale = 0; | 133 | | | 134 | 18 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 18 | const auto* from_decimal_type = | 136 | 18 | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 18 | from_precision = | 138 | 18 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 18 | from_scale = from_decimal_type->get_scale(); | 140 | 18 | } | 141 | | | 142 | 18 | UInt32 to_max_digits = 0; | 143 | 18 | UInt32 to_precision = 0; | 144 | 18 | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | 18 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | 18 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | 18 | to_precision = to_max_digits; | 160 | 18 | } | 161 | | | 162 | 18 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 18 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 18 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 18 | if (to_scale > from_scale) { | 167 | 0 | multiply_may_overflow &= | 168 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 0 | } | 170 | 18 | return narrow_integral || multiply_may_overflow; | 171 | 18 | } | 172 | 0 | return false; | 173 | 18 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE7EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_15DataTypeDecimalILSD_29EEESE_EEEEbSI_ Line | Count | Source | 120 | 21 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 21 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 21 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 21 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 21 | using FromFieldType = typename FromDataType::FieldType; | 130 | 21 | using ToFieldType = typename ToDataType::FieldType; | 131 | 21 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 21 | UInt32 from_scale = 0; | 133 | | | 134 | 21 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 21 | const auto* from_decimal_type = | 136 | 21 | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 21 | from_precision = | 138 | 21 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 21 | from_scale = from_decimal_type->get_scale(); | 140 | 21 | } | 141 | | | 142 | 21 | UInt32 to_max_digits = 0; | 143 | 21 | UInt32 to_precision = 0; | 144 | 21 | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | 21 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | 21 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | 21 | to_precision = to_max_digits; | 160 | 21 | } | 161 | | | 162 | 21 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 21 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 21 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 21 | if (to_scale > from_scale) { | 167 | 0 | multiply_may_overflow &= | 168 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 0 | } | 170 | 21 | return narrow_integral || multiply_may_overflow; | 171 | 21 | } | 172 | 0 | return false; | 173 | 21 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE7EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_15DataTypeDecimalILSD_20EEESE_EEEEbSI_ Line | Count | Source | 120 | 8 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 8 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 8 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 8 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 8 | using FromFieldType = typename FromDataType::FieldType; | 130 | 8 | using ToFieldType = typename ToDataType::FieldType; | 131 | 8 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 8 | UInt32 from_scale = 0; | 133 | | | 134 | 8 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 8 | const auto* from_decimal_type = | 136 | 8 | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 8 | from_precision = | 138 | 8 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 8 | from_scale = from_decimal_type->get_scale(); | 140 | 8 | } | 141 | | | 142 | 8 | UInt32 to_max_digits = 0; | 143 | 8 | UInt32 to_precision = 0; | 144 | 8 | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | 8 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | 8 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | 8 | to_precision = to_max_digits; | 160 | 8 | } | 161 | | | 162 | 8 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 8 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 8 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 8 | if (to_scale > from_scale) { | 167 | 0 | multiply_may_overflow &= | 168 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 0 | } | 170 | 8 | return narrow_integral || multiply_may_overflow; | 171 | 8 | } | 172 | 0 | return false; | 173 | 8 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE7EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_15DataTypeDecimalILSD_30EEESE_EEEEbSI_ Line | Count | Source | 120 | 21 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 21 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 21 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 21 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 21 | using FromFieldType = typename FromDataType::FieldType; | 130 | 21 | using ToFieldType = typename ToDataType::FieldType; | 131 | 21 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 21 | UInt32 from_scale = 0; | 133 | | | 134 | 21 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 21 | const auto* from_decimal_type = | 136 | 21 | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 21 | from_precision = | 138 | 21 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 21 | from_scale = from_decimal_type->get_scale(); | 140 | 21 | } | 141 | | | 142 | 21 | UInt32 to_max_digits = 0; | 143 | 21 | UInt32 to_precision = 0; | 144 | 21 | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | 21 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | 21 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | 21 | to_precision = to_max_digits; | 160 | 21 | } | 161 | | | 162 | 21 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 21 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 21 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 21 | if (to_scale > from_scale) { | 167 | 0 | multiply_may_overflow &= | 168 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 0 | } | 170 | 21 | return narrow_integral || multiply_may_overflow; | 171 | 21 | } | 172 | 0 | return false; | 173 | 21 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE7EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_15DataTypeDecimalILSD_35EEESE_EEEEbSI_ Line | Count | Source | 120 | 782 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 782 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 782 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 782 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 782 | using FromFieldType = typename FromDataType::FieldType; | 130 | 782 | using ToFieldType = typename ToDataType::FieldType; | 131 | 782 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 782 | UInt32 from_scale = 0; | 133 | | | 134 | 782 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 782 | const auto* from_decimal_type = | 136 | 782 | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 782 | from_precision = | 138 | 782 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 782 | from_scale = from_decimal_type->get_scale(); | 140 | 782 | } | 141 | | | 142 | 782 | UInt32 to_max_digits = 0; | 143 | 782 | UInt32 to_precision = 0; | 144 | 782 | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | 782 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | 782 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | 782 | to_precision = to_max_digits; | 160 | 782 | } | 161 | | | 162 | 782 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 782 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 782 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 782 | if (to_scale > from_scale) { | 167 | 0 | multiply_may_overflow &= | 168 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 0 | } | 170 | 782 | return narrow_integral || multiply_may_overflow; | 171 | 782 | } | 172 | 0 | return false; | 173 | 782 | }); |
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE7EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_12DataTypeDateESE_EEEEbSI_ function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE7EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeDateV2ESE_EEEEbSI_ Line | Count | Source | 120 | 2 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 2 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 2 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 2 | return false; | 173 | 2 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE7EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_18DataTypeDateTimeV2ESE_EEEEbSI_ Line | Count | Source | 120 | 16 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 16 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 16 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 16 | return false; | 173 | 16 | }); |
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE7EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_16DataTypeDateTimeESE_EEEEbSI_ function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE7EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeTimeV2ESE_EEEEbSI_ Line | Count | Source | 120 | 4 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 4 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 4 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 4 | return false; | 173 | 4 | }); |
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE7EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_19DataTypeTimeStampTzESE_EEEEbSI_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE7EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_12DataTypeIPv4ESE_EEEEbSI_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE7EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_12DataTypeIPv6ESE_EEEEbSI_ function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE7EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeStringESE_EEEEbSI_ Line | Count | Source | 120 | 2.57k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 2.57k | using Types2 = std::decay_t<decltype(types2)>; | 122 | 2.57k | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | 2.57k | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | 2.57k | return false; | 127 | 2.57k | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 2.57k | return false; | 173 | 2.57k | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE8EEEvEEEEbRKT_ENKUlSI_E_clINSB_INSC_ILSD_2EEESE_EEEEbSI_ Line | Count | Source | 120 | 2 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 2 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 2 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 2 | return false; | 173 | 2 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE8EEEvEEEEbRKT_ENKUlSI_E_clINSB_INSC_ILSD_3EEESE_EEEEbSI_ Line | Count | Source | 120 | 19 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 19 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 19 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 19 | return false; | 173 | 19 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE8EEEvEEEEbRKT_ENKUlSI_E_clINSB_INSC_ILSD_4EEESE_EEEEbSI_ Line | Count | Source | 120 | 6 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 6 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 6 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 6 | return false; | 173 | 6 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE8EEEvEEEEbRKT_ENKUlSI_E_clINSB_INSC_ILSD_5EEESE_EEEEbSI_ Line | Count | Source | 120 | 18 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 18 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 18 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 18 | return false; | 173 | 18 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE8EEEvEEEEbRKT_ENKUlSI_E_clINSB_INSC_ILSD_6EEESE_EEEEbSI_ Line | Count | Source | 120 | 6 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 6 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 6 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 6 | return false; | 173 | 6 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE8EEEvEEEEbRKT_ENKUlSI_E_clINSB_INSC_ILSD_7EEESE_EEEEbSI_ Line | Count | Source | 120 | 115 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 115 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 115 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 115 | return false; | 173 | 115 | }); |
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE8EEEvEEEEbRKT_ENKUlSI_E_clINSB_ISE_SE_EEEEbSI_ function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE8EEEvEEEEbRKT_ENKUlSI_E_clINSB_INSC_ILSD_9EEESE_EEEEbSI_ Line | Count | Source | 120 | 89 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 89 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 89 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 89 | return false; | 173 | 89 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE8EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_15DataTypeDecimalILSD_28EEESE_EEEEbSI_ Line | Count | Source | 120 | 117 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 117 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 117 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 117 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 117 | using FromFieldType = typename FromDataType::FieldType; | 130 | 117 | using ToFieldType = typename ToDataType::FieldType; | 131 | 117 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 117 | UInt32 from_scale = 0; | 133 | | | 134 | 117 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 117 | const auto* from_decimal_type = | 136 | 117 | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 117 | from_precision = | 138 | 117 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 117 | from_scale = from_decimal_type->get_scale(); | 140 | 117 | } | 141 | | | 142 | 117 | UInt32 to_max_digits = 0; | 143 | 117 | UInt32 to_precision = 0; | 144 | 117 | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | 117 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | 117 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | 117 | to_precision = to_max_digits; | 160 | 117 | } | 161 | | | 162 | 117 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 117 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 117 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 117 | if (to_scale > from_scale) { | 167 | 0 | multiply_may_overflow &= | 168 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 0 | } | 170 | 117 | return narrow_integral || multiply_may_overflow; | 171 | 117 | } | 172 | 0 | return false; | 173 | 117 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE8EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_15DataTypeDecimalILSD_29EEESE_EEEEbSI_ Line | Count | Source | 120 | 112 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 112 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 112 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 112 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 112 | using FromFieldType = typename FromDataType::FieldType; | 130 | 112 | using ToFieldType = typename ToDataType::FieldType; | 131 | 112 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 112 | UInt32 from_scale = 0; | 133 | | | 134 | 112 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 112 | const auto* from_decimal_type = | 136 | 112 | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 112 | from_precision = | 138 | 112 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 112 | from_scale = from_decimal_type->get_scale(); | 140 | 112 | } | 141 | | | 142 | 112 | UInt32 to_max_digits = 0; | 143 | 112 | UInt32 to_precision = 0; | 144 | 112 | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | 112 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | 112 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | 112 | to_precision = to_max_digits; | 160 | 112 | } | 161 | | | 162 | 112 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 112 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 112 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 112 | if (to_scale > from_scale) { | 167 | 0 | multiply_may_overflow &= | 168 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 0 | } | 170 | 112 | return narrow_integral || multiply_may_overflow; | 171 | 112 | } | 172 | 0 | return false; | 173 | 112 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE8EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_15DataTypeDecimalILSD_20EEESE_EEEEbSI_ Line | Count | Source | 120 | 16 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 16 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 16 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 16 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 16 | using FromFieldType = typename FromDataType::FieldType; | 130 | 16 | using ToFieldType = typename ToDataType::FieldType; | 131 | 16 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 16 | UInt32 from_scale = 0; | 133 | | | 134 | 16 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 16 | const auto* from_decimal_type = | 136 | 16 | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 16 | from_precision = | 138 | 16 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 16 | from_scale = from_decimal_type->get_scale(); | 140 | 16 | } | 141 | | | 142 | 16 | UInt32 to_max_digits = 0; | 143 | 16 | UInt32 to_precision = 0; | 144 | 16 | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | 16 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | 16 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | 16 | to_precision = to_max_digits; | 160 | 16 | } | 161 | | | 162 | 16 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 16 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 16 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 16 | if (to_scale > from_scale) { | 167 | 0 | multiply_may_overflow &= | 168 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 0 | } | 170 | 16 | return narrow_integral || multiply_may_overflow; | 171 | 16 | } | 172 | 0 | return false; | 173 | 16 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE8EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_15DataTypeDecimalILSD_30EEESE_EEEEbSI_ Line | Count | Source | 120 | 97 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 97 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 97 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 97 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 97 | using FromFieldType = typename FromDataType::FieldType; | 130 | 97 | using ToFieldType = typename ToDataType::FieldType; | 131 | 97 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 97 | UInt32 from_scale = 0; | 133 | | | 134 | 97 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 97 | const auto* from_decimal_type = | 136 | 97 | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 97 | from_precision = | 138 | 97 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 97 | from_scale = from_decimal_type->get_scale(); | 140 | 97 | } | 141 | | | 142 | 97 | UInt32 to_max_digits = 0; | 143 | 97 | UInt32 to_precision = 0; | 144 | 97 | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | 97 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | 97 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | 97 | to_precision = to_max_digits; | 160 | 97 | } | 161 | | | 162 | 97 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 97 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 97 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 97 | if (to_scale > from_scale) { | 167 | 0 | multiply_may_overflow &= | 168 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 0 | } | 170 | 97 | return narrow_integral || multiply_may_overflow; | 171 | 97 | } | 172 | 0 | return false; | 173 | 97 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE8EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_15DataTypeDecimalILSD_35EEESE_EEEEbSI_ Line | Count | Source | 120 | 554 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 554 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 554 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 554 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 554 | using FromFieldType = typename FromDataType::FieldType; | 130 | 554 | using ToFieldType = typename ToDataType::FieldType; | 131 | 554 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 554 | UInt32 from_scale = 0; | 133 | | | 134 | 554 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 554 | const auto* from_decimal_type = | 136 | 554 | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 554 | from_precision = | 138 | 554 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 554 | from_scale = from_decimal_type->get_scale(); | 140 | 554 | } | 141 | | | 142 | 554 | UInt32 to_max_digits = 0; | 143 | 554 | UInt32 to_precision = 0; | 144 | 554 | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | 554 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | 554 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | 554 | to_precision = to_max_digits; | 160 | 554 | } | 161 | | | 162 | 554 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 554 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 554 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 554 | if (to_scale > from_scale) { | 167 | 0 | multiply_may_overflow &= | 168 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 0 | } | 170 | 554 | return narrow_integral || multiply_may_overflow; | 171 | 554 | } | 172 | 0 | return false; | 173 | 554 | }); |
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE8EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_12DataTypeDateESE_EEEEbSI_ function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE8EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeDateV2ESE_EEEEbSI_ Line | Count | Source | 120 | 39 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 39 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 39 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 39 | return false; | 173 | 39 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE8EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_18DataTypeDateTimeV2ESE_EEEEbSI_ Line | Count | Source | 120 | 7.78k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 7.78k | using Types2 = std::decay_t<decltype(types2)>; | 122 | 7.78k | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 7.78k | return false; | 173 | 7.78k | }); |
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE8EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_16DataTypeDateTimeESE_EEEEbSI_ function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE8EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeTimeV2ESE_EEEEbSI_ Line | Count | Source | 120 | 162 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 162 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 162 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 162 | return false; | 173 | 162 | }); |
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE8EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_19DataTypeTimeStampTzESE_EEEEbSI_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE8EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_12DataTypeIPv4ESE_EEEEbSI_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE8EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_12DataTypeIPv6ESE_EEEEbSI_ function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE8EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeStringESE_EEEEbSI_ Line | Count | Source | 120 | 1.73k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 1.73k | using Types2 = std::decay_t<decltype(types2)>; | 122 | 1.73k | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | 1.73k | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | 1.73k | return false; | 127 | 1.73k | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 1.73k | return false; | 173 | 1.73k | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE9EEEvEEEEbRKT_ENKUlSI_E_clINSB_INSC_ILSD_2EEESE_EEEEbSI_ Line | Count | Source | 120 | 298 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 298 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 298 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 298 | return false; | 173 | 298 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE9EEEvEEEEbRKT_ENKUlSI_E_clINSB_INSC_ILSD_3EEESE_EEEEbSI_ Line | Count | Source | 120 | 558 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 558 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 558 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 558 | return false; | 173 | 558 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE9EEEvEEEEbRKT_ENKUlSI_E_clINSB_INSC_ILSD_4EEESE_EEEEbSI_ Line | Count | Source | 120 | 1.00k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 1.00k | using Types2 = std::decay_t<decltype(types2)>; | 122 | 1.00k | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 1.00k | return false; | 173 | 1.00k | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE9EEEvEEEEbRKT_ENKUlSI_E_clINSB_INSC_ILSD_5EEESE_EEEEbSI_ Line | Count | Source | 120 | 1.21k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 1.21k | using Types2 = std::decay_t<decltype(types2)>; | 122 | 1.21k | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 1.21k | return false; | 173 | 1.21k | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE9EEEvEEEEbRKT_ENKUlSI_E_clINSB_INSC_ILSD_6EEESE_EEEEbSI_ Line | Count | Source | 120 | 1.61k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 1.61k | using Types2 = std::decay_t<decltype(types2)>; | 122 | 1.61k | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 1.61k | return false; | 173 | 1.61k | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE9EEEvEEEEbRKT_ENKUlSI_E_clINSB_INSC_ILSD_7EEESE_EEEEbSI_ Line | Count | Source | 120 | 196 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 196 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 196 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 196 | return false; | 173 | 196 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE9EEEvEEEEbRKT_ENKUlSI_E_clINSB_INSC_ILSD_8EEESE_EEEEbSI_ Line | Count | Source | 120 | 1.29k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 1.29k | using Types2 = std::decay_t<decltype(types2)>; | 122 | 1.29k | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 1.29k | return false; | 173 | 1.29k | }); |
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE9EEEvEEEEbRKT_ENKUlSI_E_clINSB_ISE_SE_EEEEbSI_ function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE9EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_15DataTypeDecimalILSD_28EEESE_EEEEbSI_ Line | Count | Source | 120 | 524 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 524 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 524 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 524 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 524 | using FromFieldType = typename FromDataType::FieldType; | 130 | 524 | using ToFieldType = typename ToDataType::FieldType; | 131 | 524 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 524 | UInt32 from_scale = 0; | 133 | | | 134 | 524 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 524 | const auto* from_decimal_type = | 136 | 524 | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 524 | from_precision = | 138 | 524 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 524 | from_scale = from_decimal_type->get_scale(); | 140 | 524 | } | 141 | | | 142 | 524 | UInt32 to_max_digits = 0; | 143 | 524 | UInt32 to_precision = 0; | 144 | 524 | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | 524 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | 524 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | 524 | to_precision = to_max_digits; | 160 | 524 | } | 161 | | | 162 | 524 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 524 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 524 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 524 | if (to_scale > from_scale) { | 167 | 0 | multiply_may_overflow &= | 168 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 0 | } | 170 | 524 | return narrow_integral || multiply_may_overflow; | 171 | 524 | } | 172 | 0 | return false; | 173 | 524 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE9EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_15DataTypeDecimalILSD_29EEESE_EEEEbSI_ Line | Count | Source | 120 | 327 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 327 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 327 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 327 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 327 | using FromFieldType = typename FromDataType::FieldType; | 130 | 327 | using ToFieldType = typename ToDataType::FieldType; | 131 | 327 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 327 | UInt32 from_scale = 0; | 133 | | | 134 | 327 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 327 | const auto* from_decimal_type = | 136 | 327 | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 327 | from_precision = | 138 | 327 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 327 | from_scale = from_decimal_type->get_scale(); | 140 | 327 | } | 141 | | | 142 | 327 | UInt32 to_max_digits = 0; | 143 | 327 | UInt32 to_precision = 0; | 144 | 327 | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | 327 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | 327 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | 327 | to_precision = to_max_digits; | 160 | 327 | } | 161 | | | 162 | 327 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 327 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 327 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 327 | if (to_scale > from_scale) { | 167 | 0 | multiply_may_overflow &= | 168 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 0 | } | 170 | 327 | return narrow_integral || multiply_may_overflow; | 171 | 327 | } | 172 | 0 | return false; | 173 | 327 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE9EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_15DataTypeDecimalILSD_20EEESE_EEEEbSI_ Line | Count | Source | 120 | 56 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 56 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 56 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 56 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 56 | using FromFieldType = typename FromDataType::FieldType; | 130 | 56 | using ToFieldType = typename ToDataType::FieldType; | 131 | 56 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 56 | UInt32 from_scale = 0; | 133 | | | 134 | 56 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 56 | const auto* from_decimal_type = | 136 | 56 | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 56 | from_precision = | 138 | 56 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 56 | from_scale = from_decimal_type->get_scale(); | 140 | 56 | } | 141 | | | 142 | 56 | UInt32 to_max_digits = 0; | 143 | 56 | UInt32 to_precision = 0; | 144 | 56 | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | 56 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | 56 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | 56 | to_precision = to_max_digits; | 160 | 56 | } | 161 | | | 162 | 56 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 56 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 56 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 56 | if (to_scale > from_scale) { | 167 | 0 | multiply_may_overflow &= | 168 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 0 | } | 170 | 56 | return narrow_integral || multiply_may_overflow; | 171 | 56 | } | 172 | 0 | return false; | 173 | 56 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE9EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_15DataTypeDecimalILSD_30EEESE_EEEEbSI_ Line | Count | Source | 120 | 692 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 692 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 692 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 692 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 692 | using FromFieldType = typename FromDataType::FieldType; | 130 | 692 | using ToFieldType = typename ToDataType::FieldType; | 131 | 692 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 692 | UInt32 from_scale = 0; | 133 | | | 134 | 692 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 692 | const auto* from_decimal_type = | 136 | 692 | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 692 | from_precision = | 138 | 692 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 692 | from_scale = from_decimal_type->get_scale(); | 140 | 692 | } | 141 | | | 142 | 692 | UInt32 to_max_digits = 0; | 143 | 692 | UInt32 to_precision = 0; | 144 | 692 | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | 692 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | 692 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | 692 | to_precision = to_max_digits; | 160 | 692 | } | 161 | | | 162 | 692 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 692 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 692 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 692 | if (to_scale > from_scale) { | 167 | 0 | multiply_may_overflow &= | 168 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 0 | } | 170 | 692 | return narrow_integral || multiply_may_overflow; | 171 | 692 | } | 172 | 0 | return false; | 173 | 692 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE9EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_15DataTypeDecimalILSD_35EEESE_EEEEbSI_ Line | Count | Source | 120 | 544 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 544 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 544 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 544 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 544 | using FromFieldType = typename FromDataType::FieldType; | 130 | 544 | using ToFieldType = typename ToDataType::FieldType; | 131 | 544 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 544 | UInt32 from_scale = 0; | 133 | | | 134 | 544 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 544 | const auto* from_decimal_type = | 136 | 544 | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 544 | from_precision = | 138 | 544 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 544 | from_scale = from_decimal_type->get_scale(); | 140 | 544 | } | 141 | | | 142 | 544 | UInt32 to_max_digits = 0; | 143 | 544 | UInt32 to_precision = 0; | 144 | 544 | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | 544 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | 544 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | 544 | to_precision = to_max_digits; | 160 | 544 | } | 161 | | | 162 | 544 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 544 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 544 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 544 | if (to_scale > from_scale) { | 167 | 0 | multiply_may_overflow &= | 168 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 0 | } | 170 | 544 | return narrow_integral || multiply_may_overflow; | 171 | 544 | } | 172 | 0 | return false; | 173 | 544 | }); |
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE9EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_12DataTypeDateESE_EEEEbSI_ function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE9EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeDateV2ESE_EEEEbSI_ Line | Count | Source | 120 | 89 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 89 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 89 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 89 | return false; | 173 | 89 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE9EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_18DataTypeDateTimeV2ESE_EEEEbSI_ Line | Count | Source | 120 | 7.84k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 7.84k | using Types2 = std::decay_t<decltype(types2)>; | 122 | 7.84k | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 7.84k | return false; | 173 | 7.84k | }); |
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE9EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_16DataTypeDateTimeESE_EEEEbSI_ function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE9EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeTimeV2ESE_EEEEbSI_ Line | Count | Source | 120 | 162 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 162 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 162 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 162 | return false; | 173 | 162 | }); |
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE9EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_19DataTypeTimeStampTzESE_EEEEbSI_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE9EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_12DataTypeIPv4ESE_EEEEbSI_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE9EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_12DataTypeIPv6ESE_EEEEbSI_ function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE9EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeStringESE_EEEEbSI_ Line | Count | Source | 120 | 6.41k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 6.41k | using Types2 = std::decay_t<decltype(types2)>; | 122 | 6.41k | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | 6.41k | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | 6.41k | return false; | 127 | 6.41k | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 6.41k | return false; | 173 | 6.41k | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE28EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeNumberILSD_2EEESE_EEEEbSI_ Line | Count | Source | 120 | 19 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 19 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 19 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 19 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 19 | using FromFieldType = typename FromDataType::FieldType; | 130 | 19 | using ToFieldType = typename ToDataType::FieldType; | 131 | 19 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 19 | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | 19 | UInt32 to_max_digits = 0; | 143 | 19 | UInt32 to_precision = 0; | 144 | 19 | UInt32 to_scale = 0; | 145 | | | 146 | 19 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 19 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 19 | const auto* to_decimal_type = | 150 | 19 | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 19 | to_precision = to_decimal_type->get_precision(); | 152 | 19 | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 19 | to_scale = to_decimal_type->get_scale(); | 155 | 19 | ToDataType::check_type_scale(to_scale); | 156 | 19 | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | 19 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 19 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 19 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 19 | if (to_scale > from_scale) { | 167 | 18 | multiply_may_overflow &= | 168 | 18 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 18 | } | 170 | 19 | return narrow_integral || multiply_may_overflow; | 171 | 19 | } | 172 | 0 | return false; | 173 | 19 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE28EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeNumberILSD_3EEESE_EEEEbSI_ Line | Count | Source | 120 | 482 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 482 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 482 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 482 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 482 | using FromFieldType = typename FromDataType::FieldType; | 130 | 482 | using ToFieldType = typename ToDataType::FieldType; | 131 | 482 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 482 | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | 482 | UInt32 to_max_digits = 0; | 143 | 482 | UInt32 to_precision = 0; | 144 | 482 | UInt32 to_scale = 0; | 145 | | | 146 | 482 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 482 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 482 | const auto* to_decimal_type = | 150 | 482 | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 482 | to_precision = to_decimal_type->get_precision(); | 152 | 482 | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 482 | to_scale = to_decimal_type->get_scale(); | 155 | 482 | ToDataType::check_type_scale(to_scale); | 156 | 482 | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | 482 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 482 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 482 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 482 | if (to_scale > from_scale) { | 167 | 279 | multiply_may_overflow &= | 168 | 279 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 279 | } | 170 | 482 | return narrow_integral || multiply_may_overflow; | 171 | 482 | } | 172 | 0 | return false; | 173 | 482 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE28EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeNumberILSD_4EEESE_EEEEbSI_ Line | Count | Source | 120 | 500 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 500 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 500 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 500 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 500 | using FromFieldType = typename FromDataType::FieldType; | 130 | 500 | using ToFieldType = typename ToDataType::FieldType; | 131 | 500 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 500 | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | 500 | UInt32 to_max_digits = 0; | 143 | 500 | UInt32 to_precision = 0; | 144 | 500 | UInt32 to_scale = 0; | 145 | | | 146 | 500 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 500 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 500 | const auto* to_decimal_type = | 150 | 500 | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 500 | to_precision = to_decimal_type->get_precision(); | 152 | 500 | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 500 | to_scale = to_decimal_type->get_scale(); | 155 | 500 | ToDataType::check_type_scale(to_scale); | 156 | 500 | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | 500 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 500 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 500 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 500 | if (to_scale > from_scale) { | 167 | 252 | multiply_may_overflow &= | 168 | 252 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 252 | } | 170 | 500 | return narrow_integral || multiply_may_overflow; | 171 | 500 | } | 172 | 0 | return false; | 173 | 500 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE28EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeNumberILSD_5EEESE_EEEEbSI_ Line | Count | Source | 120 | 553 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 553 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 553 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 553 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 553 | using FromFieldType = typename FromDataType::FieldType; | 130 | 553 | using ToFieldType = typename ToDataType::FieldType; | 131 | 553 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 553 | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | 553 | UInt32 to_max_digits = 0; | 143 | 553 | UInt32 to_precision = 0; | 144 | 553 | UInt32 to_scale = 0; | 145 | | | 146 | 553 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 553 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 553 | const auto* to_decimal_type = | 150 | 553 | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 553 | to_precision = to_decimal_type->get_precision(); | 152 | 553 | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 553 | to_scale = to_decimal_type->get_scale(); | 155 | 553 | ToDataType::check_type_scale(to_scale); | 156 | 553 | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | 553 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 553 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 553 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 553 | if (to_scale > from_scale) { | 167 | 280 | multiply_may_overflow &= | 168 | 280 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 280 | } | 170 | 553 | return narrow_integral || multiply_may_overflow; | 171 | 553 | } | 172 | 0 | return false; | 173 | 553 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE28EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeNumberILSD_6EEESE_EEEEbSI_ Line | Count | Source | 120 | 612 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 612 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 612 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 612 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 612 | using FromFieldType = typename FromDataType::FieldType; | 130 | 612 | using ToFieldType = typename ToDataType::FieldType; | 131 | 612 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 612 | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | 612 | UInt32 to_max_digits = 0; | 143 | 612 | UInt32 to_precision = 0; | 144 | 612 | UInt32 to_scale = 0; | 145 | | | 146 | 612 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 612 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 612 | const auto* to_decimal_type = | 150 | 612 | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 612 | to_precision = to_decimal_type->get_precision(); | 152 | 612 | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 612 | to_scale = to_decimal_type->get_scale(); | 155 | 612 | ToDataType::check_type_scale(to_scale); | 156 | 612 | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | 612 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 612 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 612 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 612 | if (to_scale > from_scale) { | 167 | 266 | multiply_may_overflow &= | 168 | 266 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 266 | } | 170 | 612 | return narrow_integral || multiply_may_overflow; | 171 | 612 | } | 172 | 0 | return false; | 173 | 612 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE28EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeNumberILSD_7EEESE_EEEEbSI_ Line | Count | Source | 120 | 549 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 549 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 549 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 549 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 549 | using FromFieldType = typename FromDataType::FieldType; | 130 | 549 | using ToFieldType = typename ToDataType::FieldType; | 131 | 549 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 549 | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | 549 | UInt32 to_max_digits = 0; | 143 | 549 | UInt32 to_precision = 0; | 144 | 549 | UInt32 to_scale = 0; | 145 | | | 146 | 549 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 549 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 549 | const auto* to_decimal_type = | 150 | 549 | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 549 | to_precision = to_decimal_type->get_precision(); | 152 | 549 | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 549 | to_scale = to_decimal_type->get_scale(); | 155 | 549 | ToDataType::check_type_scale(to_scale); | 156 | 549 | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | 549 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 549 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 549 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 549 | if (to_scale > from_scale) { | 167 | 278 | multiply_may_overflow &= | 168 | 278 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 278 | } | 170 | 549 | return narrow_integral || multiply_may_overflow; | 171 | 549 | } | 172 | 0 | return false; | 173 | 549 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE28EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeNumberILSD_8EEESE_EEEEbSI_ Line | Count | Source | 120 | 104 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 104 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 104 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 104 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 104 | using FromFieldType = typename FromDataType::FieldType; | 130 | 104 | using ToFieldType = typename ToDataType::FieldType; | 131 | 104 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 104 | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | 104 | UInt32 to_max_digits = 0; | 143 | 104 | UInt32 to_precision = 0; | 144 | 104 | UInt32 to_scale = 0; | 145 | | | 146 | 104 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 104 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 104 | const auto* to_decimal_type = | 150 | 104 | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 104 | to_precision = to_decimal_type->get_precision(); | 152 | 104 | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 104 | to_scale = to_decimal_type->get_scale(); | 155 | 104 | ToDataType::check_type_scale(to_scale); | 156 | 104 | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | 104 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 104 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 104 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 104 | if (to_scale > from_scale) { | 167 | 68 | multiply_may_overflow &= | 168 | 68 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 68 | } | 170 | 104 | return narrow_integral || multiply_may_overflow; | 171 | 104 | } | 172 | 0 | return false; | 173 | 104 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE28EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeNumberILSD_9EEESE_EEEEbSI_ Line | Count | Source | 120 | 308 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 308 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 308 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 308 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 308 | using FromFieldType = typename FromDataType::FieldType; | 130 | 308 | using ToFieldType = typename ToDataType::FieldType; | 131 | 308 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 308 | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | 308 | UInt32 to_max_digits = 0; | 143 | 308 | UInt32 to_precision = 0; | 144 | 308 | UInt32 to_scale = 0; | 145 | | | 146 | 308 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 308 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 308 | const auto* to_decimal_type = | 150 | 308 | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 308 | to_precision = to_decimal_type->get_precision(); | 152 | 308 | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 308 | to_scale = to_decimal_type->get_scale(); | 155 | 308 | ToDataType::check_type_scale(to_scale); | 156 | 308 | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | 308 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 308 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 308 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 308 | if (to_scale > from_scale) { | 167 | 258 | multiply_may_overflow &= | 168 | 258 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 258 | } | 170 | 308 | return narrow_integral || multiply_may_overflow; | 171 | 308 | } | 172 | 0 | return false; | 173 | 308 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE28EEEvEEEEbRKT_ENKUlSI_E_clINSB_ISE_SE_EEEEbSI_ Line | Count | Source | 120 | 400 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 400 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 400 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 400 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 400 | using FromFieldType = typename FromDataType::FieldType; | 130 | 400 | using ToFieldType = typename ToDataType::FieldType; | 131 | 400 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 400 | UInt32 from_scale = 0; | 133 | | | 134 | 400 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 400 | const auto* from_decimal_type = | 136 | 400 | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 400 | from_precision = | 138 | 400 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 400 | from_scale = from_decimal_type->get_scale(); | 140 | 400 | } | 141 | | | 142 | 400 | UInt32 to_max_digits = 0; | 143 | 400 | UInt32 to_precision = 0; | 144 | 400 | UInt32 to_scale = 0; | 145 | | | 146 | 400 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 400 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 400 | const auto* to_decimal_type = | 150 | 400 | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 400 | to_precision = to_decimal_type->get_precision(); | 152 | 400 | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 400 | to_scale = to_decimal_type->get_scale(); | 155 | 400 | ToDataType::check_type_scale(to_scale); | 156 | 400 | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | 400 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 400 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 400 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 400 | if (to_scale > from_scale) { | 167 | 81 | multiply_may_overflow &= | 168 | 81 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 81 | } | 170 | 400 | return narrow_integral || multiply_may_overflow; | 171 | 400 | } | 172 | 0 | return false; | 173 | 400 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE28EEEvEEEEbRKT_ENKUlSI_E_clINSB_INSC_ILSD_29EEESE_EEEEbSI_ Line | Count | Source | 120 | 620 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 620 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 620 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 620 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 620 | using FromFieldType = typename FromDataType::FieldType; | 130 | 620 | using ToFieldType = typename ToDataType::FieldType; | 131 | 620 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 620 | UInt32 from_scale = 0; | 133 | | | 134 | 620 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 620 | const auto* from_decimal_type = | 136 | 620 | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 620 | from_precision = | 138 | 620 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 620 | from_scale = from_decimal_type->get_scale(); | 140 | 620 | } | 141 | | | 142 | 620 | UInt32 to_max_digits = 0; | 143 | 620 | UInt32 to_precision = 0; | 144 | 620 | UInt32 to_scale = 0; | 145 | | | 146 | 620 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 620 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 620 | const auto* to_decimal_type = | 150 | 620 | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 620 | to_precision = to_decimal_type->get_precision(); | 152 | 620 | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 620 | to_scale = to_decimal_type->get_scale(); | 155 | 620 | ToDataType::check_type_scale(to_scale); | 156 | 620 | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | 620 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 620 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 620 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 620 | if (to_scale > from_scale) { | 167 | 198 | multiply_may_overflow &= | 168 | 198 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 198 | } | 170 | 620 | return narrow_integral || multiply_may_overflow; | 171 | 620 | } | 172 | 0 | return false; | 173 | 620 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE28EEEvEEEEbRKT_ENKUlSI_E_clINSB_INSC_ILSD_20EEESE_EEEEbSI_ Line | Count | Source | 120 | 238 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 238 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 238 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 238 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 238 | using FromFieldType = typename FromDataType::FieldType; | 130 | 238 | using ToFieldType = typename ToDataType::FieldType; | 131 | 238 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 238 | UInt32 from_scale = 0; | 133 | | | 134 | 238 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 238 | const auto* from_decimal_type = | 136 | 238 | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 238 | from_precision = | 138 | 238 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 238 | from_scale = from_decimal_type->get_scale(); | 140 | 238 | } | 141 | | | 142 | 238 | UInt32 to_max_digits = 0; | 143 | 238 | UInt32 to_precision = 0; | 144 | 238 | UInt32 to_scale = 0; | 145 | | | 146 | 238 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 238 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 238 | const auto* to_decimal_type = | 150 | 238 | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 238 | to_precision = to_decimal_type->get_precision(); | 152 | 238 | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 238 | to_scale = to_decimal_type->get_scale(); | 155 | 238 | ToDataType::check_type_scale(to_scale); | 156 | 238 | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | 238 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 238 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 238 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 238 | if (to_scale > from_scale) { | 167 | 0 | multiply_may_overflow &= | 168 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 0 | } | 170 | 238 | return narrow_integral || multiply_may_overflow; | 171 | 238 | } | 172 | 0 | return false; | 173 | 238 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE28EEEvEEEEbRKT_ENKUlSI_E_clINSB_INSC_ILSD_30EEESE_EEEEbSI_ Line | Count | Source | 120 | 434 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 434 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 434 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 434 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 434 | using FromFieldType = typename FromDataType::FieldType; | 130 | 434 | using ToFieldType = typename ToDataType::FieldType; | 131 | 434 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 434 | UInt32 from_scale = 0; | 133 | | | 134 | 434 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 434 | const auto* from_decimal_type = | 136 | 434 | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 434 | from_precision = | 138 | 434 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 434 | from_scale = from_decimal_type->get_scale(); | 140 | 434 | } | 141 | | | 142 | 434 | UInt32 to_max_digits = 0; | 143 | 434 | UInt32 to_precision = 0; | 144 | 434 | UInt32 to_scale = 0; | 145 | | | 146 | 434 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 434 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 434 | const auto* to_decimal_type = | 150 | 434 | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 434 | to_precision = to_decimal_type->get_precision(); | 152 | 434 | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 434 | to_scale = to_decimal_type->get_scale(); | 155 | 434 | ToDataType::check_type_scale(to_scale); | 156 | 434 | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | 434 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 434 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 434 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 434 | if (to_scale > from_scale) { | 167 | 140 | multiply_may_overflow &= | 168 | 140 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 140 | } | 170 | 434 | return narrow_integral || multiply_may_overflow; | 171 | 434 | } | 172 | 0 | return false; | 173 | 434 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE28EEEvEEEEbRKT_ENKUlSI_E_clINSB_INSC_ILSD_35EEESE_EEEEbSI_ Line | Count | Source | 120 | 303 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 303 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 303 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 303 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 303 | using FromFieldType = typename FromDataType::FieldType; | 130 | 303 | using ToFieldType = typename ToDataType::FieldType; | 131 | 303 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 303 | UInt32 from_scale = 0; | 133 | | | 134 | 303 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 303 | const auto* from_decimal_type = | 136 | 303 | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 303 | from_precision = | 138 | 303 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 303 | from_scale = from_decimal_type->get_scale(); | 140 | 303 | } | 141 | | | 142 | 303 | UInt32 to_max_digits = 0; | 143 | 303 | UInt32 to_precision = 0; | 144 | 303 | UInt32 to_scale = 0; | 145 | | | 146 | 303 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 303 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 303 | const auto* to_decimal_type = | 150 | 303 | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 303 | to_precision = to_decimal_type->get_precision(); | 152 | 303 | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 303 | to_scale = to_decimal_type->get_scale(); | 155 | 303 | ToDataType::check_type_scale(to_scale); | 156 | 303 | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | 303 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 303 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 303 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 303 | if (to_scale > from_scale) { | 167 | 79 | multiply_may_overflow &= | 168 | 79 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 79 | } | 170 | 303 | return narrow_integral || multiply_may_overflow; | 171 | 303 | } | 172 | 0 | return false; | 173 | 303 | }); |
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE28EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_12DataTypeDateESE_EEEEbSI_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE28EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeDateV2ESE_EEEEbSI_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE28EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_18DataTypeDateTimeV2ESE_EEEEbSI_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE28EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_16DataTypeDateTimeESE_EEEEbSI_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE28EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeTimeV2ESE_EEEEbSI_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE28EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_19DataTypeTimeStampTzESE_EEEEbSI_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE28EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_12DataTypeIPv4ESE_EEEEbSI_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE28EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_12DataTypeIPv6ESE_EEEEbSI_ function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE28EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeStringESE_EEEEbSI_ Line | Count | Source | 120 | 2.91k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 2.91k | using Types2 = std::decay_t<decltype(types2)>; | 122 | 2.91k | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | 2.91k | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | 2.91k | return false; | 127 | 2.91k | } | 128 | 2.91k | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 2.91k | using FromFieldType = typename FromDataType::FieldType; | 130 | 2.91k | using ToFieldType = typename ToDataType::FieldType; | 131 | 2.91k | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 2.91k | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | 2.91k | UInt32 to_max_digits = 0; | 143 | 2.91k | UInt32 to_precision = 0; | 144 | 2.91k | UInt32 to_scale = 0; | 145 | | | 146 | 2.91k | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 2.91k | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 2.91k | const auto* to_decimal_type = | 150 | 2.91k | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 2.91k | to_precision = to_decimal_type->get_precision(); | 152 | 2.91k | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 2.91k | to_scale = to_decimal_type->get_scale(); | 155 | 2.91k | ToDataType::check_type_scale(to_scale); | 156 | 2.91k | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | 2.91k | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 2.91k | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 2.91k | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 2.91k | if (to_scale > from_scale) { | 167 | 0 | multiply_may_overflow &= | 168 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 0 | } | 170 | 2.91k | return narrow_integral || multiply_may_overflow; | 171 | 2.91k | } | 172 | 0 | return false; | 173 | 2.91k | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE29EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeNumberILSD_2EEESE_EEEEbSI_ Line | Count | Source | 120 | 17 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 17 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 17 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 17 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 17 | using FromFieldType = typename FromDataType::FieldType; | 130 | 17 | using ToFieldType = typename ToDataType::FieldType; | 131 | 17 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 17 | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | 17 | UInt32 to_max_digits = 0; | 143 | 17 | UInt32 to_precision = 0; | 144 | 17 | UInt32 to_scale = 0; | 145 | | | 146 | 17 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 17 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 17 | const auto* to_decimal_type = | 150 | 17 | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 17 | to_precision = to_decimal_type->get_precision(); | 152 | 17 | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 17 | to_scale = to_decimal_type->get_scale(); | 155 | 17 | ToDataType::check_type_scale(to_scale); | 156 | 17 | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | 17 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 17 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 17 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 17 | if (to_scale > from_scale) { | 167 | 16 | multiply_may_overflow &= | 168 | 16 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 16 | } | 170 | 17 | return narrow_integral || multiply_may_overflow; | 171 | 17 | } | 172 | 0 | return false; | 173 | 17 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE29EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeNumberILSD_3EEESE_EEEEbSI_ Line | Count | Source | 120 | 74 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 74 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 74 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 74 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 74 | using FromFieldType = typename FromDataType::FieldType; | 130 | 74 | using ToFieldType = typename ToDataType::FieldType; | 131 | 74 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 74 | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | 74 | UInt32 to_max_digits = 0; | 143 | 74 | UInt32 to_precision = 0; | 144 | 74 | UInt32 to_scale = 0; | 145 | | | 146 | 74 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 74 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 74 | const auto* to_decimal_type = | 150 | 74 | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 74 | to_precision = to_decimal_type->get_precision(); | 152 | 74 | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 74 | to_scale = to_decimal_type->get_scale(); | 155 | 74 | ToDataType::check_type_scale(to_scale); | 156 | 74 | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | 74 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 74 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 74 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 74 | if (to_scale > from_scale) { | 167 | 59 | multiply_may_overflow &= | 168 | 59 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 59 | } | 170 | 74 | return narrow_integral || multiply_may_overflow; | 171 | 74 | } | 172 | 0 | return false; | 173 | 74 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE29EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeNumberILSD_4EEESE_EEEEbSI_ Line | Count | Source | 120 | 49 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 49 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 49 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 49 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 49 | using FromFieldType = typename FromDataType::FieldType; | 130 | 49 | using ToFieldType = typename ToDataType::FieldType; | 131 | 49 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 49 | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | 49 | UInt32 to_max_digits = 0; | 143 | 49 | UInt32 to_precision = 0; | 144 | 49 | UInt32 to_scale = 0; | 145 | | | 146 | 49 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 49 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 49 | const auto* to_decimal_type = | 150 | 49 | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 49 | to_precision = to_decimal_type->get_precision(); | 152 | 49 | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 49 | to_scale = to_decimal_type->get_scale(); | 155 | 49 | ToDataType::check_type_scale(to_scale); | 156 | 49 | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | 49 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 49 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 49 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 49 | if (to_scale > from_scale) { | 167 | 38 | multiply_may_overflow &= | 168 | 38 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 38 | } | 170 | 49 | return narrow_integral || multiply_may_overflow; | 171 | 49 | } | 172 | 0 | return false; | 173 | 49 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE29EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeNumberILSD_5EEESE_EEEEbSI_ Line | Count | Source | 120 | 467 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 467 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 467 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 467 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 467 | using FromFieldType = typename FromDataType::FieldType; | 130 | 467 | using ToFieldType = typename ToDataType::FieldType; | 131 | 467 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 467 | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | 467 | UInt32 to_max_digits = 0; | 143 | 467 | UInt32 to_precision = 0; | 144 | 467 | UInt32 to_scale = 0; | 145 | | | 146 | 467 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 467 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 467 | const auto* to_decimal_type = | 150 | 467 | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 467 | to_precision = to_decimal_type->get_precision(); | 152 | 467 | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 467 | to_scale = to_decimal_type->get_scale(); | 155 | 467 | ToDataType::check_type_scale(to_scale); | 156 | 467 | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | 467 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 467 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 467 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 467 | if (to_scale > from_scale) { | 167 | 316 | multiply_may_overflow &= | 168 | 316 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 316 | } | 170 | 467 | return narrow_integral || multiply_may_overflow; | 171 | 467 | } | 172 | 0 | return false; | 173 | 467 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE29EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeNumberILSD_6EEESE_EEEEbSI_ Line | Count | Source | 120 | 50 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 50 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 50 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 50 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 50 | using FromFieldType = typename FromDataType::FieldType; | 130 | 50 | using ToFieldType = typename ToDataType::FieldType; | 131 | 50 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 50 | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | 50 | UInt32 to_max_digits = 0; | 143 | 50 | UInt32 to_precision = 0; | 144 | 50 | UInt32 to_scale = 0; | 145 | | | 146 | 50 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 50 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 50 | const auto* to_decimal_type = | 150 | 50 | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 50 | to_precision = to_decimal_type->get_precision(); | 152 | 50 | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 50 | to_scale = to_decimal_type->get_scale(); | 155 | 50 | ToDataType::check_type_scale(to_scale); | 156 | 50 | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | 50 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 50 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 50 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 50 | if (to_scale > from_scale) { | 167 | 29 | multiply_may_overflow &= | 168 | 29 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 29 | } | 170 | 50 | return narrow_integral || multiply_may_overflow; | 171 | 50 | } | 172 | 0 | return false; | 173 | 50 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE29EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeNumberILSD_7EEESE_EEEEbSI_ Line | Count | Source | 120 | 65 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 65 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 65 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 65 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 65 | using FromFieldType = typename FromDataType::FieldType; | 130 | 65 | using ToFieldType = typename ToDataType::FieldType; | 131 | 65 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 65 | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | 65 | UInt32 to_max_digits = 0; | 143 | 65 | UInt32 to_precision = 0; | 144 | 65 | UInt32 to_scale = 0; | 145 | | | 146 | 65 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 65 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 65 | const auto* to_decimal_type = | 150 | 65 | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 65 | to_precision = to_decimal_type->get_precision(); | 152 | 65 | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 65 | to_scale = to_decimal_type->get_scale(); | 155 | 65 | ToDataType::check_type_scale(to_scale); | 156 | 65 | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | 65 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 65 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 65 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 65 | if (to_scale > from_scale) { | 167 | 39 | multiply_may_overflow &= | 168 | 39 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 39 | } | 170 | 65 | return narrow_integral || multiply_may_overflow; | 171 | 65 | } | 172 | 0 | return false; | 173 | 65 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE29EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeNumberILSD_8EEESE_EEEEbSI_ Line | Count | Source | 120 | 107 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 107 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 107 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 107 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 107 | using FromFieldType = typename FromDataType::FieldType; | 130 | 107 | using ToFieldType = typename ToDataType::FieldType; | 131 | 107 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 107 | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | 107 | UInt32 to_max_digits = 0; | 143 | 107 | UInt32 to_precision = 0; | 144 | 107 | UInt32 to_scale = 0; | 145 | | | 146 | 107 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 107 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 107 | const auto* to_decimal_type = | 150 | 107 | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 107 | to_precision = to_decimal_type->get_precision(); | 152 | 107 | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 107 | to_scale = to_decimal_type->get_scale(); | 155 | 107 | ToDataType::check_type_scale(to_scale); | 156 | 107 | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | 107 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 107 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 107 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 107 | if (to_scale > from_scale) { | 167 | 65 | multiply_may_overflow &= | 168 | 65 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 65 | } | 170 | 107 | return narrow_integral || multiply_may_overflow; | 171 | 107 | } | 172 | 0 | return false; | 173 | 107 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE29EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeNumberILSD_9EEESE_EEEEbSI_ Line | Count | Source | 120 | 210 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 210 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 210 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 210 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 210 | using FromFieldType = typename FromDataType::FieldType; | 130 | 210 | using ToFieldType = typename ToDataType::FieldType; | 131 | 210 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 210 | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | 210 | UInt32 to_max_digits = 0; | 143 | 210 | UInt32 to_precision = 0; | 144 | 210 | UInt32 to_scale = 0; | 145 | | | 146 | 210 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 210 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 210 | const auto* to_decimal_type = | 150 | 210 | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 210 | to_precision = to_decimal_type->get_precision(); | 152 | 210 | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 210 | to_scale = to_decimal_type->get_scale(); | 155 | 210 | ToDataType::check_type_scale(to_scale); | 156 | 210 | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | 210 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 210 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 210 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 210 | if (to_scale > from_scale) { | 167 | 177 | multiply_may_overflow &= | 168 | 177 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 177 | } | 170 | 210 | return narrow_integral || multiply_may_overflow; | 171 | 210 | } | 172 | 0 | return false; | 173 | 210 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE29EEEvEEEEbRKT_ENKUlSI_E_clINSB_INSC_ILSD_28EEESE_EEEEbSI_ Line | Count | Source | 120 | 1.10k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 1.10k | using Types2 = std::decay_t<decltype(types2)>; | 122 | 1.10k | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 1.10k | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 1.10k | using FromFieldType = typename FromDataType::FieldType; | 130 | 1.10k | using ToFieldType = typename ToDataType::FieldType; | 131 | 1.10k | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 1.10k | UInt32 from_scale = 0; | 133 | | | 134 | 1.10k | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 1.10k | const auto* from_decimal_type = | 136 | 1.10k | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 1.10k | from_precision = | 138 | 1.10k | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 1.10k | from_scale = from_decimal_type->get_scale(); | 140 | 1.10k | } | 141 | | | 142 | 1.10k | UInt32 to_max_digits = 0; | 143 | 1.10k | UInt32 to_precision = 0; | 144 | 1.10k | UInt32 to_scale = 0; | 145 | | | 146 | 1.10k | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 1.10k | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 1.10k | const auto* to_decimal_type = | 150 | 1.10k | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 1.10k | to_precision = to_decimal_type->get_precision(); | 152 | 1.10k | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 1.10k | to_scale = to_decimal_type->get_scale(); | 155 | 1.10k | ToDataType::check_type_scale(to_scale); | 156 | 1.10k | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | 1.10k | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 1.10k | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 1.10k | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 1.10k | if (to_scale > from_scale) { | 167 | 767 | multiply_may_overflow &= | 168 | 767 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 767 | } | 170 | 1.10k | return narrow_integral || multiply_may_overflow; | 171 | 1.10k | } | 172 | 0 | return false; | 173 | 1.10k | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE29EEEvEEEEbRKT_ENKUlSI_E_clINSB_ISE_SE_EEEEbSI_ Line | Count | Source | 120 | 10.0k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 10.0k | using Types2 = std::decay_t<decltype(types2)>; | 122 | 10.0k | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 10.0k | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 10.0k | using FromFieldType = typename FromDataType::FieldType; | 130 | 10.0k | using ToFieldType = typename ToDataType::FieldType; | 131 | 10.0k | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 10.0k | UInt32 from_scale = 0; | 133 | | | 134 | 10.0k | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 10.0k | const auto* from_decimal_type = | 136 | 10.0k | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 10.0k | from_precision = | 138 | 10.0k | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 10.0k | from_scale = from_decimal_type->get_scale(); | 140 | 10.0k | } | 141 | | | 142 | 10.0k | UInt32 to_max_digits = 0; | 143 | 10.0k | UInt32 to_precision = 0; | 144 | 10.0k | UInt32 to_scale = 0; | 145 | | | 146 | 10.0k | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 10.0k | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 10.0k | const auto* to_decimal_type = | 150 | 10.0k | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 10.0k | to_precision = to_decimal_type->get_precision(); | 152 | 10.0k | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 10.0k | to_scale = to_decimal_type->get_scale(); | 155 | 10.0k | ToDataType::check_type_scale(to_scale); | 156 | 10.0k | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | 10.0k | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 10.0k | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 10.0k | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 10.0k | if (to_scale > from_scale) { | 167 | 158 | multiply_may_overflow &= | 168 | 158 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 158 | } | 170 | 10.0k | return narrow_integral || multiply_may_overflow; | 171 | 10.0k | } | 172 | 0 | return false; | 173 | 10.0k | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE29EEEvEEEEbRKT_ENKUlSI_E_clINSB_INSC_ILSD_20EEESE_EEEEbSI_ Line | Count | Source | 120 | 320 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 320 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 320 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 320 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 320 | using FromFieldType = typename FromDataType::FieldType; | 130 | 320 | using ToFieldType = typename ToDataType::FieldType; | 131 | 320 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 320 | UInt32 from_scale = 0; | 133 | | | 134 | 320 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 320 | const auto* from_decimal_type = | 136 | 320 | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 320 | from_precision = | 138 | 320 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 320 | from_scale = from_decimal_type->get_scale(); | 140 | 320 | } | 141 | | | 142 | 320 | UInt32 to_max_digits = 0; | 143 | 320 | UInt32 to_precision = 0; | 144 | 320 | UInt32 to_scale = 0; | 145 | | | 146 | 320 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 320 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 320 | const auto* to_decimal_type = | 150 | 320 | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 320 | to_precision = to_decimal_type->get_precision(); | 152 | 320 | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 320 | to_scale = to_decimal_type->get_scale(); | 155 | 320 | ToDataType::check_type_scale(to_scale); | 156 | 320 | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | 320 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 320 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 320 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 320 | if (to_scale > from_scale) { | 167 | 50 | multiply_may_overflow &= | 168 | 50 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 50 | } | 170 | 320 | return narrow_integral || multiply_may_overflow; | 171 | 320 | } | 172 | 0 | return false; | 173 | 320 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE29EEEvEEEEbRKT_ENKUlSI_E_clINSB_INSC_ILSD_30EEESE_EEEEbSI_ Line | Count | Source | 120 | 429 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 429 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 429 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 429 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 429 | using FromFieldType = typename FromDataType::FieldType; | 130 | 429 | using ToFieldType = typename ToDataType::FieldType; | 131 | 429 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 429 | UInt32 from_scale = 0; | 133 | | | 134 | 429 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 429 | const auto* from_decimal_type = | 136 | 429 | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 429 | from_precision = | 138 | 429 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 429 | from_scale = from_decimal_type->get_scale(); | 140 | 429 | } | 141 | | | 142 | 429 | UInt32 to_max_digits = 0; | 143 | 429 | UInt32 to_precision = 0; | 144 | 429 | UInt32 to_scale = 0; | 145 | | | 146 | 429 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 429 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 429 | const auto* to_decimal_type = | 150 | 429 | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 429 | to_precision = to_decimal_type->get_precision(); | 152 | 429 | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 429 | to_scale = to_decimal_type->get_scale(); | 155 | 429 | ToDataType::check_type_scale(to_scale); | 156 | 429 | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | 429 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 429 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 429 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 429 | if (to_scale > from_scale) { | 167 | 144 | multiply_may_overflow &= | 168 | 144 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 144 | } | 170 | 429 | return narrow_integral || multiply_may_overflow; | 171 | 429 | } | 172 | 0 | return false; | 173 | 429 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE29EEEvEEEEbRKT_ENKUlSI_E_clINSB_INSC_ILSD_35EEESE_EEEEbSI_ Line | Count | Source | 120 | 401 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 401 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 401 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 401 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 401 | using FromFieldType = typename FromDataType::FieldType; | 130 | 401 | using ToFieldType = typename ToDataType::FieldType; | 131 | 401 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 401 | UInt32 from_scale = 0; | 133 | | | 134 | 401 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 401 | const auto* from_decimal_type = | 136 | 401 | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 401 | from_precision = | 138 | 401 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 401 | from_scale = from_decimal_type->get_scale(); | 140 | 401 | } | 141 | | | 142 | 401 | UInt32 to_max_digits = 0; | 143 | 401 | UInt32 to_precision = 0; | 144 | 401 | UInt32 to_scale = 0; | 145 | | | 146 | 401 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 401 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 401 | const auto* to_decimal_type = | 150 | 401 | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 401 | to_precision = to_decimal_type->get_precision(); | 152 | 401 | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 401 | to_scale = to_decimal_type->get_scale(); | 155 | 401 | ToDataType::check_type_scale(to_scale); | 156 | 401 | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | 401 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 401 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 401 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 401 | if (to_scale > from_scale) { | 167 | 137 | multiply_may_overflow &= | 168 | 137 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 137 | } | 170 | 401 | return narrow_integral || multiply_may_overflow; | 171 | 401 | } | 172 | 0 | return false; | 173 | 401 | }); |
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE29EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_12DataTypeDateESE_EEEEbSI_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE29EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeDateV2ESE_EEEEbSI_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE29EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_18DataTypeDateTimeV2ESE_EEEEbSI_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE29EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_16DataTypeDateTimeESE_EEEEbSI_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE29EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeTimeV2ESE_EEEEbSI_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE29EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_19DataTypeTimeStampTzESE_EEEEbSI_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE29EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_12DataTypeIPv4ESE_EEEEbSI_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE29EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_12DataTypeIPv6ESE_EEEEbSI_ function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE29EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeStringESE_EEEEbSI_ Line | Count | Source | 120 | 7.93k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 7.93k | using Types2 = std::decay_t<decltype(types2)>; | 122 | 7.93k | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | 7.93k | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | 7.93k | return false; | 127 | 7.93k | } | 128 | 7.93k | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 7.93k | using FromFieldType = typename FromDataType::FieldType; | 130 | 7.93k | using ToFieldType = typename ToDataType::FieldType; | 131 | 7.93k | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 7.93k | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | 7.93k | UInt32 to_max_digits = 0; | 143 | 7.93k | UInt32 to_precision = 0; | 144 | 7.93k | UInt32 to_scale = 0; | 145 | | | 146 | 7.93k | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 7.93k | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 7.93k | const auto* to_decimal_type = | 150 | 7.93k | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 7.93k | to_precision = to_decimal_type->get_precision(); | 152 | 7.93k | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 7.93k | to_scale = to_decimal_type->get_scale(); | 155 | 7.93k | ToDataType::check_type_scale(to_scale); | 156 | 7.93k | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | 7.93k | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 7.93k | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 7.93k | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 7.93k | if (to_scale > from_scale) { | 167 | 0 | multiply_may_overflow &= | 168 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 0 | } | 170 | 7.93k | return narrow_integral || multiply_may_overflow; | 171 | 7.93k | } | 172 | 0 | return false; | 173 | 7.93k | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE20EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeNumberILSD_2EEESE_EEEEbSI_ Line | Count | Source | 120 | 20 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 20 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 20 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 20 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 20 | using FromFieldType = typename FromDataType::FieldType; | 130 | 20 | using ToFieldType = typename ToDataType::FieldType; | 131 | 20 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 20 | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | 20 | UInt32 to_max_digits = 0; | 143 | 20 | UInt32 to_precision = 0; | 144 | 20 | UInt32 to_scale = 0; | 145 | | | 146 | 20 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 20 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 20 | const auto* to_decimal_type = | 150 | 20 | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 20 | to_precision = to_decimal_type->get_precision(); | 152 | 20 | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 20 | to_scale = to_decimal_type->get_scale(); | 155 | 20 | ToDataType::check_type_scale(to_scale); | 156 | 20 | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | 20 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 20 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 20 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 20 | if (to_scale > from_scale) { | 167 | 20 | multiply_may_overflow &= | 168 | 20 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 20 | } | 170 | 20 | return narrow_integral || multiply_may_overflow; | 171 | 20 | } | 172 | 0 | return false; | 173 | 20 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE20EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeNumberILSD_3EEESE_EEEEbSI_ Line | Count | Source | 120 | 16 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 16 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 16 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 16 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 16 | using FromFieldType = typename FromDataType::FieldType; | 130 | 16 | using ToFieldType = typename ToDataType::FieldType; | 131 | 16 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 16 | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | 16 | UInt32 to_max_digits = 0; | 143 | 16 | UInt32 to_precision = 0; | 144 | 16 | UInt32 to_scale = 0; | 145 | | | 146 | 16 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 16 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 16 | const auto* to_decimal_type = | 150 | 16 | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 16 | to_precision = to_decimal_type->get_precision(); | 152 | 16 | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 16 | to_scale = to_decimal_type->get_scale(); | 155 | 16 | ToDataType::check_type_scale(to_scale); | 156 | 16 | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | 16 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 16 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 16 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 16 | if (to_scale > from_scale) { | 167 | 16 | multiply_may_overflow &= | 168 | 16 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 16 | } | 170 | 16 | return narrow_integral || multiply_may_overflow; | 171 | 16 | } | 172 | 0 | return false; | 173 | 16 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE20EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeNumberILSD_4EEESE_EEEEbSI_ Line | Count | Source | 120 | 16 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 16 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 16 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 16 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 16 | using FromFieldType = typename FromDataType::FieldType; | 130 | 16 | using ToFieldType = typename ToDataType::FieldType; | 131 | 16 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 16 | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | 16 | UInt32 to_max_digits = 0; | 143 | 16 | UInt32 to_precision = 0; | 144 | 16 | UInt32 to_scale = 0; | 145 | | | 146 | 16 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 16 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 16 | const auto* to_decimal_type = | 150 | 16 | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 16 | to_precision = to_decimal_type->get_precision(); | 152 | 16 | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 16 | to_scale = to_decimal_type->get_scale(); | 155 | 16 | ToDataType::check_type_scale(to_scale); | 156 | 16 | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | 16 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 16 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 16 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 16 | if (to_scale > from_scale) { | 167 | 16 | multiply_may_overflow &= | 168 | 16 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 16 | } | 170 | 16 | return narrow_integral || multiply_may_overflow; | 171 | 16 | } | 172 | 0 | return false; | 173 | 16 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE20EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeNumberILSD_5EEESE_EEEEbSI_ Line | Count | Source | 120 | 16 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 16 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 16 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 16 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 16 | using FromFieldType = typename FromDataType::FieldType; | 130 | 16 | using ToFieldType = typename ToDataType::FieldType; | 131 | 16 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 16 | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | 16 | UInt32 to_max_digits = 0; | 143 | 16 | UInt32 to_precision = 0; | 144 | 16 | UInt32 to_scale = 0; | 145 | | | 146 | 16 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 16 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 16 | const auto* to_decimal_type = | 150 | 16 | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 16 | to_precision = to_decimal_type->get_precision(); | 152 | 16 | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 16 | to_scale = to_decimal_type->get_scale(); | 155 | 16 | ToDataType::check_type_scale(to_scale); | 156 | 16 | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | 16 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 16 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 16 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 16 | if (to_scale > from_scale) { | 167 | 16 | multiply_may_overflow &= | 168 | 16 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 16 | } | 170 | 16 | return narrow_integral || multiply_may_overflow; | 171 | 16 | } | 172 | 0 | return false; | 173 | 16 | }); |
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE20EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeNumberILSD_6EEESE_EEEEbSI_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE20EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeNumberILSD_7EEESE_EEEEbSI_ function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE20EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeNumberILSD_8EEESE_EEEEbSI_ Line | Count | Source | 120 | 32 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 32 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 32 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 32 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 32 | using FromFieldType = typename FromDataType::FieldType; | 130 | 32 | using ToFieldType = typename ToDataType::FieldType; | 131 | 32 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 32 | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | 32 | UInt32 to_max_digits = 0; | 143 | 32 | UInt32 to_precision = 0; | 144 | 32 | UInt32 to_scale = 0; | 145 | | | 146 | 32 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 32 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 32 | const auto* to_decimal_type = | 150 | 32 | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 32 | to_precision = to_decimal_type->get_precision(); | 152 | 32 | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 32 | to_scale = to_decimal_type->get_scale(); | 155 | 32 | ToDataType::check_type_scale(to_scale); | 156 | 32 | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | 32 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 32 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 32 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 32 | if (to_scale > from_scale) { | 167 | 32 | multiply_may_overflow &= | 168 | 32 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 32 | } | 170 | 32 | return narrow_integral || multiply_may_overflow; | 171 | 32 | } | 172 | 0 | return false; | 173 | 32 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE20EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeNumberILSD_9EEESE_EEEEbSI_ Line | Count | Source | 120 | 128 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 128 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 128 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 128 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 128 | using FromFieldType = typename FromDataType::FieldType; | 130 | 128 | using ToFieldType = typename ToDataType::FieldType; | 131 | 128 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 128 | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | 128 | UInt32 to_max_digits = 0; | 143 | 128 | UInt32 to_precision = 0; | 144 | 128 | UInt32 to_scale = 0; | 145 | | | 146 | 128 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 128 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 128 | const auto* to_decimal_type = | 150 | 128 | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 128 | to_precision = to_decimal_type->get_precision(); | 152 | 128 | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 128 | to_scale = to_decimal_type->get_scale(); | 155 | 128 | ToDataType::check_type_scale(to_scale); | 156 | 128 | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | 128 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 128 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 128 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 128 | if (to_scale > from_scale) { | 167 | 128 | multiply_may_overflow &= | 168 | 128 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 128 | } | 170 | 128 | return narrow_integral || multiply_may_overflow; | 171 | 128 | } | 172 | 0 | return false; | 173 | 128 | }); |
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE20EEEvEEEEbRKT_ENKUlSI_E_clINSB_INSC_ILSD_28EEESE_EEEEbSI_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE20EEEvEEEEbRKT_ENKUlSI_E_clINSB_INSC_ILSD_29EEESE_EEEEbSI_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE20EEEvEEEEbRKT_ENKUlSI_E_clINSB_ISE_SE_EEEEbSI_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE20EEEvEEEEbRKT_ENKUlSI_E_clINSB_INSC_ILSD_30EEESE_EEEEbSI_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE20EEEvEEEEbRKT_ENKUlSI_E_clINSB_INSC_ILSD_35EEESE_EEEEbSI_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE20EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_12DataTypeDateESE_EEEEbSI_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE20EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeDateV2ESE_EEEEbSI_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE20EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_18DataTypeDateTimeV2ESE_EEEEbSI_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE20EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_16DataTypeDateTimeESE_EEEEbSI_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE20EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeTimeV2ESE_EEEEbSI_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE20EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_19DataTypeTimeStampTzESE_EEEEbSI_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE20EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_12DataTypeIPv4ESE_EEEEbSI_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE20EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_12DataTypeIPv6ESE_EEEEbSI_ function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE20EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeStringESE_EEEEbSI_ Line | Count | Source | 120 | 1 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 1 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 1 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | 1 | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | 1 | return false; | 127 | 1 | } | 128 | 1 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 1 | using FromFieldType = typename FromDataType::FieldType; | 130 | 1 | using ToFieldType = typename ToDataType::FieldType; | 131 | 1 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 1 | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | 1 | UInt32 to_max_digits = 0; | 143 | 1 | UInt32 to_precision = 0; | 144 | 1 | UInt32 to_scale = 0; | 145 | | | 146 | 1 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 1 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 1 | const auto* to_decimal_type = | 150 | 1 | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 1 | to_precision = to_decimal_type->get_precision(); | 152 | 1 | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 1 | to_scale = to_decimal_type->get_scale(); | 155 | 1 | ToDataType::check_type_scale(to_scale); | 156 | 1 | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | 1 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 1 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 1 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 1 | if (to_scale > from_scale) { | 167 | 0 | multiply_may_overflow &= | 168 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 0 | } | 170 | 1 | return narrow_integral || multiply_may_overflow; | 171 | 1 | } | 172 | 0 | return false; | 173 | 1 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE30EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeNumberILSD_2EEESE_EEEEbSI_ Line | Count | Source | 120 | 21 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 21 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 21 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 21 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 21 | using FromFieldType = typename FromDataType::FieldType; | 130 | 21 | using ToFieldType = typename ToDataType::FieldType; | 131 | 21 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 21 | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | 21 | UInt32 to_max_digits = 0; | 143 | 21 | UInt32 to_precision = 0; | 144 | 21 | UInt32 to_scale = 0; | 145 | | | 146 | 21 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 21 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 21 | const auto* to_decimal_type = | 150 | 21 | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 21 | to_precision = to_decimal_type->get_precision(); | 152 | 21 | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 21 | to_scale = to_decimal_type->get_scale(); | 155 | 21 | ToDataType::check_type_scale(to_scale); | 156 | 21 | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | 21 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 21 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 21 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 21 | if (to_scale > from_scale) { | 167 | 20 | multiply_may_overflow &= | 168 | 20 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 20 | } | 170 | 21 | return narrow_integral || multiply_may_overflow; | 171 | 21 | } | 172 | 0 | return false; | 173 | 21 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE30EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeNumberILSD_3EEESE_EEEEbSI_ Line | Count | Source | 120 | 179 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 179 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 179 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 179 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 179 | using FromFieldType = typename FromDataType::FieldType; | 130 | 179 | using ToFieldType = typename ToDataType::FieldType; | 131 | 179 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 179 | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | 179 | UInt32 to_max_digits = 0; | 143 | 179 | UInt32 to_precision = 0; | 144 | 179 | UInt32 to_scale = 0; | 145 | | | 146 | 179 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 179 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 179 | const auto* to_decimal_type = | 150 | 179 | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 179 | to_precision = to_decimal_type->get_precision(); | 152 | 179 | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 179 | to_scale = to_decimal_type->get_scale(); | 155 | 179 | ToDataType::check_type_scale(to_scale); | 156 | 179 | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | 179 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 179 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 179 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 179 | if (to_scale > from_scale) { | 167 | 128 | multiply_may_overflow &= | 168 | 128 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 128 | } | 170 | 179 | return narrow_integral || multiply_may_overflow; | 171 | 179 | } | 172 | 0 | return false; | 173 | 179 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE30EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeNumberILSD_4EEESE_EEEEbSI_ Line | Count | Source | 120 | 166 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 166 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 166 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 166 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 166 | using FromFieldType = typename FromDataType::FieldType; | 130 | 166 | using ToFieldType = typename ToDataType::FieldType; | 131 | 166 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 166 | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | 166 | UInt32 to_max_digits = 0; | 143 | 166 | UInt32 to_precision = 0; | 144 | 166 | UInt32 to_scale = 0; | 145 | | | 146 | 166 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 166 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 166 | const auto* to_decimal_type = | 150 | 166 | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 166 | to_precision = to_decimal_type->get_precision(); | 152 | 166 | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 166 | to_scale = to_decimal_type->get_scale(); | 155 | 166 | ToDataType::check_type_scale(to_scale); | 156 | 166 | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | 166 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 166 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 166 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 166 | if (to_scale > from_scale) { | 167 | 115 | multiply_may_overflow &= | 168 | 115 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 115 | } | 170 | 166 | return narrow_integral || multiply_may_overflow; | 171 | 166 | } | 172 | 0 | return false; | 173 | 166 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE30EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeNumberILSD_5EEESE_EEEEbSI_ Line | Count | Source | 120 | 443 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 443 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 443 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 443 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 443 | using FromFieldType = typename FromDataType::FieldType; | 130 | 443 | using ToFieldType = typename ToDataType::FieldType; | 131 | 443 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 443 | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | 443 | UInt32 to_max_digits = 0; | 143 | 443 | UInt32 to_precision = 0; | 144 | 443 | UInt32 to_scale = 0; | 145 | | | 146 | 443 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 443 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 443 | const auto* to_decimal_type = | 150 | 443 | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 443 | to_precision = to_decimal_type->get_precision(); | 152 | 443 | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 443 | to_scale = to_decimal_type->get_scale(); | 155 | 443 | ToDataType::check_type_scale(to_scale); | 156 | 443 | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | 443 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 443 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 443 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 443 | if (to_scale > from_scale) { | 167 | 387 | multiply_may_overflow &= | 168 | 387 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 387 | } | 170 | 443 | return narrow_integral || multiply_may_overflow; | 171 | 443 | } | 172 | 0 | return false; | 173 | 443 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE30EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeNumberILSD_6EEESE_EEEEbSI_ Line | Count | Source | 120 | 2.37k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 2.37k | using Types2 = std::decay_t<decltype(types2)>; | 122 | 2.37k | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 2.37k | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 2.37k | using FromFieldType = typename FromDataType::FieldType; | 130 | 2.37k | using ToFieldType = typename ToDataType::FieldType; | 131 | 2.37k | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 2.37k | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | 2.37k | UInt32 to_max_digits = 0; | 143 | 2.37k | UInt32 to_precision = 0; | 144 | 2.37k | UInt32 to_scale = 0; | 145 | | | 146 | 2.37k | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 2.37k | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 2.37k | const auto* to_decimal_type = | 150 | 2.37k | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 2.37k | to_precision = to_decimal_type->get_precision(); | 152 | 2.37k | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 2.37k | to_scale = to_decimal_type->get_scale(); | 155 | 2.37k | ToDataType::check_type_scale(to_scale); | 156 | 2.37k | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | 2.37k | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 2.37k | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 2.37k | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 2.37k | if (to_scale > from_scale) { | 167 | 518 | multiply_may_overflow &= | 168 | 518 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 518 | } | 170 | 2.37k | return narrow_integral || multiply_may_overflow; | 171 | 2.37k | } | 172 | 0 | return false; | 173 | 2.37k | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE30EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeNumberILSD_7EEESE_EEEEbSI_ Line | Count | Source | 120 | 367 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 367 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 367 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 367 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 367 | using FromFieldType = typename FromDataType::FieldType; | 130 | 367 | using ToFieldType = typename ToDataType::FieldType; | 131 | 367 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 367 | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | 367 | UInt32 to_max_digits = 0; | 143 | 367 | UInt32 to_precision = 0; | 144 | 367 | UInt32 to_scale = 0; | 145 | | | 146 | 367 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 367 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 367 | const auto* to_decimal_type = | 150 | 367 | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 367 | to_precision = to_decimal_type->get_precision(); | 152 | 367 | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 367 | to_scale = to_decimal_type->get_scale(); | 155 | 367 | ToDataType::check_type_scale(to_scale); | 156 | 367 | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | 367 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 367 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 367 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 367 | if (to_scale > from_scale) { | 167 | 196 | multiply_may_overflow &= | 168 | 196 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 196 | } | 170 | 367 | return narrow_integral || multiply_may_overflow; | 171 | 367 | } | 172 | 0 | return false; | 173 | 367 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE30EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeNumberILSD_8EEESE_EEEEbSI_ Line | Count | Source | 120 | 248 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 248 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 248 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 248 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 248 | using FromFieldType = typename FromDataType::FieldType; | 130 | 248 | using ToFieldType = typename ToDataType::FieldType; | 131 | 248 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 248 | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | 248 | UInt32 to_max_digits = 0; | 143 | 248 | UInt32 to_precision = 0; | 144 | 248 | UInt32 to_scale = 0; | 145 | | | 146 | 248 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 248 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 248 | const auto* to_decimal_type = | 150 | 248 | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 248 | to_precision = to_decimal_type->get_precision(); | 152 | 248 | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 248 | to_scale = to_decimal_type->get_scale(); | 155 | 248 | ToDataType::check_type_scale(to_scale); | 156 | 248 | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | 248 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 248 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 248 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 248 | if (to_scale > from_scale) { | 167 | 130 | multiply_may_overflow &= | 168 | 130 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 130 | } | 170 | 248 | return narrow_integral || multiply_may_overflow; | 171 | 248 | } | 172 | 0 | return false; | 173 | 248 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE30EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeNumberILSD_9EEESE_EEEEbSI_ Line | Count | Source | 120 | 490 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 490 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 490 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 490 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 490 | using FromFieldType = typename FromDataType::FieldType; | 130 | 490 | using ToFieldType = typename ToDataType::FieldType; | 131 | 490 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 490 | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | 490 | UInt32 to_max_digits = 0; | 143 | 490 | UInt32 to_precision = 0; | 144 | 490 | UInt32 to_scale = 0; | 145 | | | 146 | 490 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 490 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 490 | const auto* to_decimal_type = | 150 | 490 | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 490 | to_precision = to_decimal_type->get_precision(); | 152 | 490 | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 490 | to_scale = to_decimal_type->get_scale(); | 155 | 490 | ToDataType::check_type_scale(to_scale); | 156 | 490 | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | 490 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 490 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 490 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 490 | if (to_scale > from_scale) { | 167 | 380 | multiply_may_overflow &= | 168 | 380 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 380 | } | 170 | 490 | return narrow_integral || multiply_may_overflow; | 171 | 490 | } | 172 | 0 | return false; | 173 | 490 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE30EEEvEEEEbRKT_ENKUlSI_E_clINSB_INSC_ILSD_28EEESE_EEEEbSI_ Line | Count | Source | 120 | 742 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 742 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 742 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 742 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 742 | using FromFieldType = typename FromDataType::FieldType; | 130 | 742 | using ToFieldType = typename ToDataType::FieldType; | 131 | 742 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 742 | UInt32 from_scale = 0; | 133 | | | 134 | 742 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 742 | const auto* from_decimal_type = | 136 | 742 | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 742 | from_precision = | 138 | 742 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 742 | from_scale = from_decimal_type->get_scale(); | 140 | 742 | } | 141 | | | 142 | 742 | UInt32 to_max_digits = 0; | 143 | 742 | UInt32 to_precision = 0; | 144 | 742 | UInt32 to_scale = 0; | 145 | | | 146 | 742 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 742 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 742 | const auto* to_decimal_type = | 150 | 742 | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 742 | to_precision = to_decimal_type->get_precision(); | 152 | 742 | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 742 | to_scale = to_decimal_type->get_scale(); | 155 | 742 | ToDataType::check_type_scale(to_scale); | 156 | 742 | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | 742 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 742 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 742 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 742 | if (to_scale > from_scale) { | 167 | 602 | multiply_may_overflow &= | 168 | 602 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 602 | } | 170 | 742 | return narrow_integral || multiply_may_overflow; | 171 | 742 | } | 172 | 0 | return false; | 173 | 742 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE30EEEvEEEEbRKT_ENKUlSI_E_clINSB_INSC_ILSD_29EEESE_EEEEbSI_ Line | Count | Source | 120 | 1.04k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 1.04k | using Types2 = std::decay_t<decltype(types2)>; | 122 | 1.04k | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 1.04k | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 1.04k | using FromFieldType = typename FromDataType::FieldType; | 130 | 1.04k | using ToFieldType = typename ToDataType::FieldType; | 131 | 1.04k | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 1.04k | UInt32 from_scale = 0; | 133 | | | 134 | 1.04k | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 1.04k | const auto* from_decimal_type = | 136 | 1.04k | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 1.04k | from_precision = | 138 | 1.04k | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 1.04k | from_scale = from_decimal_type->get_scale(); | 140 | 1.04k | } | 141 | | | 142 | 1.04k | UInt32 to_max_digits = 0; | 143 | 1.04k | UInt32 to_precision = 0; | 144 | 1.04k | UInt32 to_scale = 0; | 145 | | | 146 | 1.04k | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 1.04k | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 1.04k | const auto* to_decimal_type = | 150 | 1.04k | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 1.04k | to_precision = to_decimal_type->get_precision(); | 152 | 1.04k | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 1.04k | to_scale = to_decimal_type->get_scale(); | 155 | 1.04k | ToDataType::check_type_scale(to_scale); | 156 | 1.04k | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | 1.04k | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 1.04k | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 1.04k | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 1.04k | if (to_scale > from_scale) { | 167 | 717 | multiply_may_overflow &= | 168 | 717 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 717 | } | 170 | 1.04k | return narrow_integral || multiply_may_overflow; | 171 | 1.04k | } | 172 | 0 | return false; | 173 | 1.04k | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE30EEEvEEEEbRKT_ENKUlSI_E_clINSB_INSC_ILSD_20EEESE_EEEEbSI_ Line | Count | Source | 120 | 333 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 333 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 333 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 333 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 333 | using FromFieldType = typename FromDataType::FieldType; | 130 | 333 | using ToFieldType = typename ToDataType::FieldType; | 131 | 333 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 333 | UInt32 from_scale = 0; | 133 | | | 134 | 333 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 333 | const auto* from_decimal_type = | 136 | 333 | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 333 | from_precision = | 138 | 333 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 333 | from_scale = from_decimal_type->get_scale(); | 140 | 333 | } | 141 | | | 142 | 333 | UInt32 to_max_digits = 0; | 143 | 333 | UInt32 to_precision = 0; | 144 | 333 | UInt32 to_scale = 0; | 145 | | | 146 | 333 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 333 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 333 | const auto* to_decimal_type = | 150 | 333 | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 333 | to_precision = to_decimal_type->get_precision(); | 152 | 333 | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 333 | to_scale = to_decimal_type->get_scale(); | 155 | 333 | ToDataType::check_type_scale(to_scale); | 156 | 333 | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | 333 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 333 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 333 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 333 | if (to_scale > from_scale) { | 167 | 71 | multiply_may_overflow &= | 168 | 71 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 71 | } | 170 | 333 | return narrow_integral || multiply_may_overflow; | 171 | 333 | } | 172 | 0 | return false; | 173 | 333 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE30EEEvEEEEbRKT_ENKUlSI_E_clINSB_ISE_SE_EEEEbSI_ Line | Count | Source | 120 | 2.17k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 2.17k | using Types2 = std::decay_t<decltype(types2)>; | 122 | 2.17k | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 2.17k | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 2.17k | using FromFieldType = typename FromDataType::FieldType; | 130 | 2.17k | using ToFieldType = typename ToDataType::FieldType; | 131 | 2.17k | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 2.17k | UInt32 from_scale = 0; | 133 | | | 134 | 2.17k | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 2.17k | const auto* from_decimal_type = | 136 | 2.17k | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 2.17k | from_precision = | 138 | 2.17k | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 2.17k | from_scale = from_decimal_type->get_scale(); | 140 | 2.17k | } | 141 | | | 142 | 2.17k | UInt32 to_max_digits = 0; | 143 | 2.17k | UInt32 to_precision = 0; | 144 | 2.17k | UInt32 to_scale = 0; | 145 | | | 146 | 2.17k | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 2.17k | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 2.17k | const auto* to_decimal_type = | 150 | 2.17k | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 2.17k | to_precision = to_decimal_type->get_precision(); | 152 | 2.17k | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 2.17k | to_scale = to_decimal_type->get_scale(); | 155 | 2.17k | ToDataType::check_type_scale(to_scale); | 156 | 2.17k | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | 2.17k | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 2.17k | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 2.17k | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 2.17k | if (to_scale > from_scale) { | 167 | 710 | multiply_may_overflow &= | 168 | 710 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 710 | } | 170 | 2.17k | return narrow_integral || multiply_may_overflow; | 171 | 2.17k | } | 172 | 0 | return false; | 173 | 2.17k | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE30EEEvEEEEbRKT_ENKUlSI_E_clINSB_INSC_ILSD_35EEESE_EEEEbSI_ Line | Count | Source | 120 | 948 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 948 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 948 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 948 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 948 | using FromFieldType = typename FromDataType::FieldType; | 130 | 948 | using ToFieldType = typename ToDataType::FieldType; | 131 | 948 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 948 | UInt32 from_scale = 0; | 133 | | | 134 | 948 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 948 | const auto* from_decimal_type = | 136 | 948 | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 948 | from_precision = | 138 | 948 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 948 | from_scale = from_decimal_type->get_scale(); | 140 | 948 | } | 141 | | | 142 | 948 | UInt32 to_max_digits = 0; | 143 | 948 | UInt32 to_precision = 0; | 144 | 948 | UInt32 to_scale = 0; | 145 | | | 146 | 948 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 948 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 948 | const auto* to_decimal_type = | 150 | 948 | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 948 | to_precision = to_decimal_type->get_precision(); | 152 | 948 | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 948 | to_scale = to_decimal_type->get_scale(); | 155 | 948 | ToDataType::check_type_scale(to_scale); | 156 | 948 | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | 948 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 948 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 948 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 948 | if (to_scale > from_scale) { | 167 | 394 | multiply_may_overflow &= | 168 | 394 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 394 | } | 170 | 948 | return narrow_integral || multiply_may_overflow; | 171 | 948 | } | 172 | 0 | return false; | 173 | 948 | }); |
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE30EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_12DataTypeDateESE_EEEEbSI_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE30EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeDateV2ESE_EEEEbSI_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE30EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_18DataTypeDateTimeV2ESE_EEEEbSI_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE30EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_16DataTypeDateTimeESE_EEEEbSI_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE30EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeTimeV2ESE_EEEEbSI_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE30EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_19DataTypeTimeStampTzESE_EEEEbSI_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE30EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_12DataTypeIPv4ESE_EEEEbSI_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE30EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_12DataTypeIPv6ESE_EEEEbSI_ function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE30EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeStringESE_EEEEbSI_ Line | Count | Source | 120 | 5.20k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 5.20k | using Types2 = std::decay_t<decltype(types2)>; | 122 | 5.20k | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | 5.20k | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | 5.20k | return false; | 127 | 5.20k | } | 128 | 5.20k | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 5.20k | using FromFieldType = typename FromDataType::FieldType; | 130 | 5.20k | using ToFieldType = typename ToDataType::FieldType; | 131 | 5.20k | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 5.20k | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | 5.20k | UInt32 to_max_digits = 0; | 143 | 5.20k | UInt32 to_precision = 0; | 144 | 5.20k | UInt32 to_scale = 0; | 145 | | | 146 | 5.20k | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 5.20k | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 5.20k | const auto* to_decimal_type = | 150 | 5.20k | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 5.20k | to_precision = to_decimal_type->get_precision(); | 152 | 5.20k | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 5.20k | to_scale = to_decimal_type->get_scale(); | 155 | 5.20k | ToDataType::check_type_scale(to_scale); | 156 | 5.20k | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | 5.20k | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 5.20k | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 5.20k | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 5.20k | if (to_scale > from_scale) { | 167 | 0 | multiply_may_overflow &= | 168 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 0 | } | 170 | 5.20k | return narrow_integral || multiply_may_overflow; | 171 | 5.20k | } | 172 | 0 | return false; | 173 | 5.20k | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE35EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeNumberILSD_2EEESE_EEEEbSI_ Line | Count | Source | 120 | 7 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 7 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 7 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 7 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 7 | using FromFieldType = typename FromDataType::FieldType; | 130 | 7 | using ToFieldType = typename ToDataType::FieldType; | 131 | 7 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 7 | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | 7 | UInt32 to_max_digits = 0; | 143 | 7 | UInt32 to_precision = 0; | 144 | 7 | UInt32 to_scale = 0; | 145 | | | 146 | 7 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 7 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 7 | const auto* to_decimal_type = | 150 | 7 | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 7 | to_precision = to_decimal_type->get_precision(); | 152 | 7 | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 7 | to_scale = to_decimal_type->get_scale(); | 155 | 7 | ToDataType::check_type_scale(to_scale); | 156 | 7 | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | 7 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 7 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 7 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 7 | if (to_scale > from_scale) { | 167 | 6 | multiply_may_overflow &= | 168 | 6 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 6 | } | 170 | 7 | return narrow_integral || multiply_may_overflow; | 171 | 7 | } | 172 | 0 | return false; | 173 | 7 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE35EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeNumberILSD_3EEESE_EEEEbSI_ Line | Count | Source | 120 | 162 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 162 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 162 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 162 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 162 | using FromFieldType = typename FromDataType::FieldType; | 130 | 162 | using ToFieldType = typename ToDataType::FieldType; | 131 | 162 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 162 | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | 162 | UInt32 to_max_digits = 0; | 143 | 162 | UInt32 to_precision = 0; | 144 | 162 | UInt32 to_scale = 0; | 145 | | | 146 | 162 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 162 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 162 | const auto* to_decimal_type = | 150 | 162 | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 162 | to_precision = to_decimal_type->get_precision(); | 152 | 162 | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 162 | to_scale = to_decimal_type->get_scale(); | 155 | 162 | ToDataType::check_type_scale(to_scale); | 156 | 162 | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | 162 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 162 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 162 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 162 | if (to_scale > from_scale) { | 167 | 111 | multiply_may_overflow &= | 168 | 111 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 111 | } | 170 | 162 | return narrow_integral || multiply_may_overflow; | 171 | 162 | } | 172 | 0 | return false; | 173 | 162 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE35EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeNumberILSD_4EEESE_EEEEbSI_ Line | Count | Source | 120 | 158 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 158 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 158 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 158 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 158 | using FromFieldType = typename FromDataType::FieldType; | 130 | 158 | using ToFieldType = typename ToDataType::FieldType; | 131 | 158 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 158 | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | 158 | UInt32 to_max_digits = 0; | 143 | 158 | UInt32 to_precision = 0; | 144 | 158 | UInt32 to_scale = 0; | 145 | | | 146 | 158 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 158 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 158 | const auto* to_decimal_type = | 150 | 158 | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 158 | to_precision = to_decimal_type->get_precision(); | 152 | 158 | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 158 | to_scale = to_decimal_type->get_scale(); | 155 | 158 | ToDataType::check_type_scale(to_scale); | 156 | 158 | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | 158 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 158 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 158 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 158 | if (to_scale > from_scale) { | 167 | 107 | multiply_may_overflow &= | 168 | 107 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 107 | } | 170 | 158 | return narrow_integral || multiply_may_overflow; | 171 | 158 | } | 172 | 0 | return false; | 173 | 158 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE35EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeNumberILSD_5EEESE_EEEEbSI_ Line | Count | Source | 120 | 176 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 176 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 176 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 176 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 176 | using FromFieldType = typename FromDataType::FieldType; | 130 | 176 | using ToFieldType = typename ToDataType::FieldType; | 131 | 176 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 176 | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | 176 | UInt32 to_max_digits = 0; | 143 | 176 | UInt32 to_precision = 0; | 144 | 176 | UInt32 to_scale = 0; | 145 | | | 146 | 176 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 176 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 176 | const auto* to_decimal_type = | 150 | 176 | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 176 | to_precision = to_decimal_type->get_precision(); | 152 | 176 | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 176 | to_scale = to_decimal_type->get_scale(); | 155 | 176 | ToDataType::check_type_scale(to_scale); | 156 | 176 | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | 176 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 176 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 176 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 176 | if (to_scale > from_scale) { | 167 | 120 | multiply_may_overflow &= | 168 | 120 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 120 | } | 170 | 176 | return narrow_integral || multiply_may_overflow; | 171 | 176 | } | 172 | 0 | return false; | 173 | 176 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE35EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeNumberILSD_6EEESE_EEEEbSI_ Line | Count | Source | 120 | 158 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 158 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 158 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 158 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 158 | using FromFieldType = typename FromDataType::FieldType; | 130 | 158 | using ToFieldType = typename ToDataType::FieldType; | 131 | 158 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 158 | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | 158 | UInt32 to_max_digits = 0; | 143 | 158 | UInt32 to_precision = 0; | 144 | 158 | UInt32 to_scale = 0; | 145 | | | 146 | 158 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 158 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 158 | const auto* to_decimal_type = | 150 | 158 | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 158 | to_precision = to_decimal_type->get_precision(); | 152 | 158 | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 158 | to_scale = to_decimal_type->get_scale(); | 155 | 158 | ToDataType::check_type_scale(to_scale); | 156 | 158 | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | 158 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 158 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 158 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 158 | if (to_scale > from_scale) { | 167 | 107 | multiply_may_overflow &= | 168 | 107 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 107 | } | 170 | 158 | return narrow_integral || multiply_may_overflow; | 171 | 158 | } | 172 | 0 | return false; | 173 | 158 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE35EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeNumberILSD_7EEESE_EEEEbSI_ Line | Count | Source | 120 | 232 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 232 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 232 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 232 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 232 | using FromFieldType = typename FromDataType::FieldType; | 130 | 232 | using ToFieldType = typename ToDataType::FieldType; | 131 | 232 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 232 | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | 232 | UInt32 to_max_digits = 0; | 143 | 232 | UInt32 to_precision = 0; | 144 | 232 | UInt32 to_scale = 0; | 145 | | | 146 | 232 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 232 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 232 | const auto* to_decimal_type = | 150 | 232 | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 232 | to_precision = to_decimal_type->get_precision(); | 152 | 232 | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 232 | to_scale = to_decimal_type->get_scale(); | 155 | 232 | ToDataType::check_type_scale(to_scale); | 156 | 232 | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | 232 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 232 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 232 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 232 | if (to_scale > from_scale) { | 167 | 170 | multiply_may_overflow &= | 168 | 170 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 170 | } | 170 | 232 | return narrow_integral || multiply_may_overflow; | 171 | 232 | } | 172 | 0 | return false; | 173 | 232 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE35EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeNumberILSD_8EEESE_EEEEbSI_ Line | Count | Source | 120 | 224 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 224 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 224 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 224 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 224 | using FromFieldType = typename FromDataType::FieldType; | 130 | 224 | using ToFieldType = typename ToDataType::FieldType; | 131 | 224 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 224 | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | 224 | UInt32 to_max_digits = 0; | 143 | 224 | UInt32 to_precision = 0; | 144 | 224 | UInt32 to_scale = 0; | 145 | | | 146 | 224 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 224 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 224 | const auto* to_decimal_type = | 150 | 224 | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 224 | to_precision = to_decimal_type->get_precision(); | 152 | 224 | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 224 | to_scale = to_decimal_type->get_scale(); | 155 | 224 | ToDataType::check_type_scale(to_scale); | 156 | 224 | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | 224 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 224 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 224 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 224 | if (to_scale > from_scale) { | 167 | 126 | multiply_may_overflow &= | 168 | 126 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 126 | } | 170 | 224 | return narrow_integral || multiply_may_overflow; | 171 | 224 | } | 172 | 0 | return false; | 173 | 224 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE35EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeNumberILSD_9EEESE_EEEEbSI_ Line | Count | Source | 120 | 318 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 318 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 318 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 318 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 318 | using FromFieldType = typename FromDataType::FieldType; | 130 | 318 | using ToFieldType = typename ToDataType::FieldType; | 131 | 318 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 318 | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | 318 | UInt32 to_max_digits = 0; | 143 | 318 | UInt32 to_precision = 0; | 144 | 318 | UInt32 to_scale = 0; | 145 | | | 146 | 318 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 318 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 318 | const auto* to_decimal_type = | 150 | 318 | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 318 | to_precision = to_decimal_type->get_precision(); | 152 | 318 | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 318 | to_scale = to_decimal_type->get_scale(); | 155 | 318 | ToDataType::check_type_scale(to_scale); | 156 | 318 | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | 318 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 318 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 318 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 318 | if (to_scale > from_scale) { | 167 | 208 | multiply_may_overflow &= | 168 | 208 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 208 | } | 170 | 318 | return narrow_integral || multiply_may_overflow; | 171 | 318 | } | 172 | 0 | return false; | 173 | 318 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE35EEEvEEEEbRKT_ENKUlSI_E_clINSB_INSC_ILSD_28EEESE_EEEEbSI_ Line | Count | Source | 120 | 567 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 567 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 567 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 567 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 567 | using FromFieldType = typename FromDataType::FieldType; | 130 | 567 | using ToFieldType = typename ToDataType::FieldType; | 131 | 567 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 567 | UInt32 from_scale = 0; | 133 | | | 134 | 567 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 567 | const auto* from_decimal_type = | 136 | 567 | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 567 | from_precision = | 138 | 567 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 567 | from_scale = from_decimal_type->get_scale(); | 140 | 567 | } | 141 | | | 142 | 567 | UInt32 to_max_digits = 0; | 143 | 567 | UInt32 to_precision = 0; | 144 | 567 | UInt32 to_scale = 0; | 145 | | | 146 | 567 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 567 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 567 | const auto* to_decimal_type = | 150 | 567 | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 567 | to_precision = to_decimal_type->get_precision(); | 152 | 567 | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 567 | to_scale = to_decimal_type->get_scale(); | 155 | 567 | ToDataType::check_type_scale(to_scale); | 156 | 567 | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | 567 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 567 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 567 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 567 | if (to_scale > from_scale) { | 167 | 499 | multiply_may_overflow &= | 168 | 499 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 499 | } | 170 | 567 | return narrow_integral || multiply_may_overflow; | 171 | 567 | } | 172 | 0 | return false; | 173 | 567 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE35EEEvEEEEbRKT_ENKUlSI_E_clINSB_INSC_ILSD_29EEESE_EEEEbSI_ Line | Count | Source | 120 | 921 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 921 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 921 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 921 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 921 | using FromFieldType = typename FromDataType::FieldType; | 130 | 921 | using ToFieldType = typename ToDataType::FieldType; | 131 | 921 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 921 | UInt32 from_scale = 0; | 133 | | | 134 | 921 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 921 | const auto* from_decimal_type = | 136 | 921 | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 921 | from_precision = | 138 | 921 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 921 | from_scale = from_decimal_type->get_scale(); | 140 | 921 | } | 141 | | | 142 | 921 | UInt32 to_max_digits = 0; | 143 | 921 | UInt32 to_precision = 0; | 144 | 921 | UInt32 to_scale = 0; | 145 | | | 146 | 921 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 921 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 921 | const auto* to_decimal_type = | 150 | 921 | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 921 | to_precision = to_decimal_type->get_precision(); | 152 | 921 | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 921 | to_scale = to_decimal_type->get_scale(); | 155 | 921 | ToDataType::check_type_scale(to_scale); | 156 | 921 | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | 921 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 921 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 921 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 921 | if (to_scale > from_scale) { | 167 | 794 | multiply_may_overflow &= | 168 | 794 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 794 | } | 170 | 921 | return narrow_integral || multiply_may_overflow; | 171 | 921 | } | 172 | 0 | return false; | 173 | 921 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE35EEEvEEEEbRKT_ENKUlSI_E_clINSB_INSC_ILSD_20EEESE_EEEEbSI_ Line | Count | Source | 120 | 148 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 148 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 148 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 148 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 148 | using FromFieldType = typename FromDataType::FieldType; | 130 | 148 | using ToFieldType = typename ToDataType::FieldType; | 131 | 148 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 148 | UInt32 from_scale = 0; | 133 | | | 134 | 148 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 148 | const auto* from_decimal_type = | 136 | 148 | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 148 | from_precision = | 138 | 148 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 148 | from_scale = from_decimal_type->get_scale(); | 140 | 148 | } | 141 | | | 142 | 148 | UInt32 to_max_digits = 0; | 143 | 148 | UInt32 to_precision = 0; | 144 | 148 | UInt32 to_scale = 0; | 145 | | | 146 | 148 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 148 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 148 | const auto* to_decimal_type = | 150 | 148 | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 148 | to_precision = to_decimal_type->get_precision(); | 152 | 148 | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 148 | to_scale = to_decimal_type->get_scale(); | 155 | 148 | ToDataType::check_type_scale(to_scale); | 156 | 148 | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | 148 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 148 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 148 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 148 | if (to_scale > from_scale) { | 167 | 84 | multiply_may_overflow &= | 168 | 84 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 84 | } | 170 | 148 | return narrow_integral || multiply_may_overflow; | 171 | 148 | } | 172 | 0 | return false; | 173 | 148 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE35EEEvEEEEbRKT_ENKUlSI_E_clINSB_INSC_ILSD_30EEESE_EEEEbSI_ Line | Count | Source | 120 | 1.22k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 1.22k | using Types2 = std::decay_t<decltype(types2)>; | 122 | 1.22k | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 1.22k | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 1.22k | using FromFieldType = typename FromDataType::FieldType; | 130 | 1.22k | using ToFieldType = typename ToDataType::FieldType; | 131 | 1.22k | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 1.22k | UInt32 from_scale = 0; | 133 | | | 134 | 1.22k | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 1.22k | const auto* from_decimal_type = | 136 | 1.22k | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 1.22k | from_precision = | 138 | 1.22k | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 1.22k | from_scale = from_decimal_type->get_scale(); | 140 | 1.22k | } | 141 | | | 142 | 1.22k | UInt32 to_max_digits = 0; | 143 | 1.22k | UInt32 to_precision = 0; | 144 | 1.22k | UInt32 to_scale = 0; | 145 | | | 146 | 1.22k | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 1.22k | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 1.22k | const auto* to_decimal_type = | 150 | 1.22k | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 1.22k | to_precision = to_decimal_type->get_precision(); | 152 | 1.22k | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 1.22k | to_scale = to_decimal_type->get_scale(); | 155 | 1.22k | ToDataType::check_type_scale(to_scale); | 156 | 1.22k | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | 1.22k | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 1.22k | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 1.22k | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 1.22k | if (to_scale > from_scale) { | 167 | 739 | multiply_may_overflow &= | 168 | 739 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 739 | } | 170 | 1.22k | return narrow_integral || multiply_may_overflow; | 171 | 1.22k | } | 172 | 0 | return false; | 173 | 1.22k | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE35EEEvEEEEbRKT_ENKUlSI_E_clINSB_ISE_SE_EEEEbSI_ Line | Count | Source | 120 | 927 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 927 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 927 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 927 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 927 | using FromFieldType = typename FromDataType::FieldType; | 130 | 927 | using ToFieldType = typename ToDataType::FieldType; | 131 | 927 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 927 | UInt32 from_scale = 0; | 133 | | | 134 | 927 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 927 | const auto* from_decimal_type = | 136 | 927 | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 927 | from_precision = | 138 | 927 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 927 | from_scale = from_decimal_type->get_scale(); | 140 | 927 | } | 141 | | | 142 | 927 | UInt32 to_max_digits = 0; | 143 | 927 | UInt32 to_precision = 0; | 144 | 927 | UInt32 to_scale = 0; | 145 | | | 146 | 927 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 927 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 927 | const auto* to_decimal_type = | 150 | 927 | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 927 | to_precision = to_decimal_type->get_precision(); | 152 | 927 | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 927 | to_scale = to_decimal_type->get_scale(); | 155 | 927 | ToDataType::check_type_scale(to_scale); | 156 | 927 | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | 927 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 927 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 927 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 927 | if (to_scale > from_scale) { | 167 | 453 | multiply_may_overflow &= | 168 | 453 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 453 | } | 170 | 927 | return narrow_integral || multiply_may_overflow; | 171 | 927 | } | 172 | 0 | return false; | 173 | 927 | }); |
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE35EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_12DataTypeDateESE_EEEEbSI_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE35EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeDateV2ESE_EEEEbSI_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE35EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_18DataTypeDateTimeV2ESE_EEEEbSI_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE35EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_16DataTypeDateTimeESE_EEEEbSI_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE35EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeTimeV2ESE_EEEEbSI_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE35EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_19DataTypeTimeStampTzESE_EEEEbSI_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE35EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_12DataTypeIPv4ESE_EEEEbSI_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE35EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_12DataTypeIPv6ESE_EEEEbSI_ function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE35EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeStringESE_EEEEbSI_ Line | Count | Source | 120 | 5.67k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 5.67k | using Types2 = std::decay_t<decltype(types2)>; | 122 | 5.67k | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | 5.67k | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | 5.67k | return false; | 127 | 5.67k | } | 128 | 5.67k | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 5.67k | using FromFieldType = typename FromDataType::FieldType; | 130 | 5.67k | using ToFieldType = typename ToDataType::FieldType; | 131 | 5.67k | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 5.67k | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | 5.67k | UInt32 to_max_digits = 0; | 143 | 5.67k | UInt32 to_precision = 0; | 144 | 5.67k | UInt32 to_scale = 0; | 145 | | | 146 | 5.67k | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 5.67k | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 5.67k | const auto* to_decimal_type = | 150 | 5.67k | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 5.67k | to_precision = to_decimal_type->get_precision(); | 152 | 5.67k | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 5.67k | to_scale = to_decimal_type->get_scale(); | 155 | 5.67k | ToDataType::check_type_scale(to_scale); | 156 | 5.67k | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | 5.67k | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 5.67k | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 5.67k | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 5.67k | if (to_scale > from_scale) { | 167 | 0 | multiply_may_overflow &= | 168 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 0 | } | 170 | 5.67k | return narrow_integral || multiply_may_overflow; | 171 | 5.67k | } | 172 | 0 | return false; | 173 | 5.67k | }); |
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_12DataTypeDateEvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeNumberILNS_13PrimitiveTypeE2EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_12DataTypeDateEvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeNumberILNS_13PrimitiveTypeE3EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_12DataTypeDateEvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeNumberILNS_13PrimitiveTypeE4EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_12DataTypeDateEvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeNumberILNS_13PrimitiveTypeE5EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_12DataTypeDateEvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeNumberILNS_13PrimitiveTypeE6EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_12DataTypeDateEvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeNumberILNS_13PrimitiveTypeE7EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_12DataTypeDateEvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeNumberILNS_13PrimitiveTypeE8EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_12DataTypeDateEvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeNumberILNS_13PrimitiveTypeE9EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_12DataTypeDateEvEEEEbRKT_ENKUlSG_E_clINSB_INS_15DataTypeDecimalILNS_13PrimitiveTypeE28EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_12DataTypeDateEvEEEEbRKT_ENKUlSG_E_clINSB_INS_15DataTypeDecimalILNS_13PrimitiveTypeE29EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_12DataTypeDateEvEEEEbRKT_ENKUlSG_E_clINSB_INS_15DataTypeDecimalILNS_13PrimitiveTypeE20EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_12DataTypeDateEvEEEEbRKT_ENKUlSG_E_clINSB_INS_15DataTypeDecimalILNS_13PrimitiveTypeE30EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_12DataTypeDateEvEEEEbRKT_ENKUlSG_E_clINSB_INS_15DataTypeDecimalILNS_13PrimitiveTypeE35EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_12DataTypeDateEvEEEEbRKT_ENKUlSG_E_clINSB_ISC_SC_EEEEbSG_ function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_12DataTypeDateEvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeDateV2ESC_EEEEbSG_ Line | Count | Source | 120 | 1 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 1 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 1 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 1 | return false; | 173 | 1 | }); |
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_12DataTypeDateEvEEEEbRKT_ENKUlSG_E_clINSB_INS_18DataTypeDateTimeV2ESC_EEEEbSG_ function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_12DataTypeDateEvEEEEbRKT_ENKUlSG_E_clINSB_INS_16DataTypeDateTimeESC_EEEEbSG_ Line | Count | Source | 120 | 3 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 3 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 3 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 3 | return false; | 173 | 3 | }); |
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_12DataTypeDateEvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeTimeV2ESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_12DataTypeDateEvEEEEbRKT_ENKUlSG_E_clINSB_INS_19DataTypeTimeStampTzESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_12DataTypeDateEvEEEEbRKT_ENKUlSG_E_clINSB_INS_12DataTypeIPv4ESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_12DataTypeDateEvEEEEbRKT_ENKUlSG_E_clINSB_INS_12DataTypeIPv6ESC_EEEEbSG_ function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_12DataTypeDateEvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeStringESC_EEEEbSG_ Line | Count | Source | 120 | 27 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 27 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 27 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | 27 | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | 27 | return false; | 127 | 27 | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 27 | return false; | 173 | 27 | }); |
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeDateV2EvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeNumberILNS_13PrimitiveTypeE2EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeDateV2EvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeNumberILNS_13PrimitiveTypeE3EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeDateV2EvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeNumberILNS_13PrimitiveTypeE4EEESC_EEEEbSG_ function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeDateV2EvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeNumberILNS_13PrimitiveTypeE5EEESC_EEEEbSG_ Line | Count | Source | 120 | 10 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 10 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 10 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 10 | return false; | 173 | 10 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeDateV2EvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeNumberILNS_13PrimitiveTypeE6EEESC_EEEEbSG_ Line | Count | Source | 120 | 7 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 7 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 7 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 7 | return false; | 173 | 7 | }); |
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeDateV2EvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeNumberILNS_13PrimitiveTypeE7EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeDateV2EvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeNumberILNS_13PrimitiveTypeE8EEESC_EEEEbSG_ function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeDateV2EvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeNumberILNS_13PrimitiveTypeE9EEESC_EEEEbSG_ Line | Count | Source | 120 | 7 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 7 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 7 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 7 | return false; | 173 | 7 | }); |
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeDateV2EvEEEEbRKT_ENKUlSG_E_clINSB_INS_15DataTypeDecimalILNS_13PrimitiveTypeE28EEESC_EEEEbSG_ function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeDateV2EvEEEEbRKT_ENKUlSG_E_clINSB_INS_15DataTypeDecimalILNS_13PrimitiveTypeE29EEESC_EEEEbSG_ Line | Count | Source | 120 | 2 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 2 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 2 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 2 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 2 | using FromFieldType = typename FromDataType::FieldType; | 130 | 2 | using ToFieldType = typename ToDataType::FieldType; | 131 | 2 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 2 | UInt32 from_scale = 0; | 133 | | | 134 | 2 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 2 | const auto* from_decimal_type = | 136 | 2 | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 2 | from_precision = | 138 | 2 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 2 | from_scale = from_decimal_type->get_scale(); | 140 | 2 | } | 141 | | | 142 | 2 | UInt32 to_max_digits = 0; | 143 | 2 | UInt32 to_precision = 0; | 144 | 2 | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | 2 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 2 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 2 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 2 | if (to_scale > from_scale) { | 167 | 0 | multiply_may_overflow &= | 168 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 0 | } | 170 | 2 | return narrow_integral || multiply_may_overflow; | 171 | 2 | } | 172 | 0 | return false; | 173 | 2 | }); |
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeDateV2EvEEEEbRKT_ENKUlSG_E_clINSB_INS_15DataTypeDecimalILNS_13PrimitiveTypeE20EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeDateV2EvEEEEbRKT_ENKUlSG_E_clINSB_INS_15DataTypeDecimalILNS_13PrimitiveTypeE30EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeDateV2EvEEEEbRKT_ENKUlSG_E_clINSB_INS_15DataTypeDecimalILNS_13PrimitiveTypeE35EEESC_EEEEbSG_ function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeDateV2EvEEEEbRKT_ENKUlSG_E_clINSB_INS_12DataTypeDateESC_EEEEbSG_ Line | Count | Source | 120 | 421 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 421 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 421 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 421 | return false; | 173 | 421 | }); |
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeDateV2EvEEEEbRKT_ENKUlSG_E_clINSB_ISC_SC_EEEEbSG_ function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeDateV2EvEEEEbRKT_ENKUlSG_E_clINSB_INS_18DataTypeDateTimeV2ESC_EEEEbSG_ Line | Count | Source | 120 | 220 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 220 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 220 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 220 | return false; | 173 | 220 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeDateV2EvEEEEbRKT_ENKUlSG_E_clINSB_INS_16DataTypeDateTimeESC_EEEEbSG_ Line | Count | Source | 120 | 1 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 1 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 1 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 1 | return false; | 173 | 1 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeDateV2EvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeTimeV2ESC_EEEEbSG_ Line | Count | Source | 120 | 2 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 2 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 2 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 2 | return false; | 173 | 2 | }); |
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeDateV2EvEEEEbRKT_ENKUlSG_E_clINSB_INS_19DataTypeTimeStampTzESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeDateV2EvEEEEbRKT_ENKUlSG_E_clINSB_INS_12DataTypeIPv4ESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeDateV2EvEEEEbRKT_ENKUlSG_E_clINSB_INS_12DataTypeIPv6ESC_EEEEbSG_ function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeDateV2EvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeStringESC_EEEEbSG_ Line | Count | Source | 120 | 6.70k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 6.70k | using Types2 = std::decay_t<decltype(types2)>; | 122 | 6.70k | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | 6.70k | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | 6.70k | return false; | 127 | 6.70k | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 6.70k | return false; | 173 | 6.70k | }); |
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_18DataTypeDateTimeV2EvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeNumberILNS_13PrimitiveTypeE2EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_18DataTypeDateTimeV2EvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeNumberILNS_13PrimitiveTypeE3EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_18DataTypeDateTimeV2EvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeNumberILNS_13PrimitiveTypeE4EEESC_EEEEbSG_ function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_18DataTypeDateTimeV2EvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeNumberILNS_13PrimitiveTypeE5EEESC_EEEEbSG_ Line | Count | Source | 120 | 13 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 13 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 13 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 13 | return false; | 173 | 13 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_18DataTypeDateTimeV2EvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeNumberILNS_13PrimitiveTypeE6EEESC_EEEEbSG_ Line | Count | Source | 120 | 33 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 33 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 33 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 33 | return false; | 173 | 33 | }); |
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_18DataTypeDateTimeV2EvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeNumberILNS_13PrimitiveTypeE7EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_18DataTypeDateTimeV2EvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeNumberILNS_13PrimitiveTypeE8EEESC_EEEEbSG_ function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_18DataTypeDateTimeV2EvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeNumberILNS_13PrimitiveTypeE9EEESC_EEEEbSG_ Line | Count | Source | 120 | 12 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 12 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 12 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 12 | return false; | 173 | 12 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_18DataTypeDateTimeV2EvEEEEbRKT_ENKUlSG_E_clINSB_INS_15DataTypeDecimalILNS_13PrimitiveTypeE28EEESC_EEEEbSG_ Line | Count | Source | 120 | 12 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 12 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 12 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 12 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 12 | using FromFieldType = typename FromDataType::FieldType; | 130 | 12 | using ToFieldType = typename ToDataType::FieldType; | 131 | 12 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 12 | UInt32 from_scale = 0; | 133 | | | 134 | 12 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 12 | const auto* from_decimal_type = | 136 | 12 | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 12 | from_precision = | 138 | 12 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 12 | from_scale = from_decimal_type->get_scale(); | 140 | 12 | } | 141 | | | 142 | 12 | UInt32 to_max_digits = 0; | 143 | 12 | UInt32 to_precision = 0; | 144 | 12 | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | 12 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 12 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 12 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 12 | if (to_scale > from_scale) { | 167 | 0 | multiply_may_overflow &= | 168 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 0 | } | 170 | 12 | return narrow_integral || multiply_may_overflow; | 171 | 12 | } | 172 | 0 | return false; | 173 | 12 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_18DataTypeDateTimeV2EvEEEEbRKT_ENKUlSG_E_clINSB_INS_15DataTypeDecimalILNS_13PrimitiveTypeE29EEESC_EEEEbSG_ Line | Count | Source | 120 | 4 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 4 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 4 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 4 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 4 | using FromFieldType = typename FromDataType::FieldType; | 130 | 4 | using ToFieldType = typename ToDataType::FieldType; | 131 | 4 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 4 | UInt32 from_scale = 0; | 133 | | | 134 | 4 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 4 | const auto* from_decimal_type = | 136 | 4 | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 4 | from_precision = | 138 | 4 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 4 | from_scale = from_decimal_type->get_scale(); | 140 | 4 | } | 141 | | | 142 | 4 | UInt32 to_max_digits = 0; | 143 | 4 | UInt32 to_precision = 0; | 144 | 4 | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | 4 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 4 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 4 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 4 | if (to_scale > from_scale) { | 167 | 0 | multiply_may_overflow &= | 168 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 0 | } | 170 | 4 | return narrow_integral || multiply_may_overflow; | 171 | 4 | } | 172 | 0 | return false; | 173 | 4 | }); |
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_18DataTypeDateTimeV2EvEEEEbRKT_ENKUlSG_E_clINSB_INS_15DataTypeDecimalILNS_13PrimitiveTypeE20EEESC_EEEEbSG_ function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_18DataTypeDateTimeV2EvEEEEbRKT_ENKUlSG_E_clINSB_INS_15DataTypeDecimalILNS_13PrimitiveTypeE30EEESC_EEEEbSG_ Line | Count | Source | 120 | 5 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 5 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 5 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 5 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 5 | using FromFieldType = typename FromDataType::FieldType; | 130 | 5 | using ToFieldType = typename ToDataType::FieldType; | 131 | 5 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 5 | UInt32 from_scale = 0; | 133 | | | 134 | 5 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 5 | const auto* from_decimal_type = | 136 | 5 | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 5 | from_precision = | 138 | 5 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 5 | from_scale = from_decimal_type->get_scale(); | 140 | 5 | } | 141 | | | 142 | 5 | UInt32 to_max_digits = 0; | 143 | 5 | UInt32 to_precision = 0; | 144 | 5 | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | 5 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 5 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 5 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 5 | if (to_scale > from_scale) { | 167 | 0 | multiply_may_overflow &= | 168 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 0 | } | 170 | 5 | return narrow_integral || multiply_may_overflow; | 171 | 5 | } | 172 | 0 | return false; | 173 | 5 | }); |
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_18DataTypeDateTimeV2EvEEEEbRKT_ENKUlSG_E_clINSB_INS_15DataTypeDecimalILNS_13PrimitiveTypeE35EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_18DataTypeDateTimeV2EvEEEEbRKT_ENKUlSG_E_clINSB_INS_12DataTypeDateESC_EEEEbSG_ function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_18DataTypeDateTimeV2EvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeDateV2ESC_EEEEbSG_ Line | Count | Source | 120 | 377 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 377 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 377 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 377 | return false; | 173 | 377 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_18DataTypeDateTimeV2EvEEEEbRKT_ENKUlSG_E_clINSB_ISC_SC_EEEEbSG_ Line | Count | Source | 120 | 212 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 212 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 212 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 212 | return false; | 173 | 212 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_18DataTypeDateTimeV2EvEEEEbRKT_ENKUlSG_E_clINSB_INS_16DataTypeDateTimeESC_EEEEbSG_ Line | Count | Source | 120 | 178 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 178 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 178 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 178 | return false; | 173 | 178 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_18DataTypeDateTimeV2EvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeTimeV2ESC_EEEEbSG_ Line | Count | Source | 120 | 4 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 4 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 4 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 4 | return false; | 173 | 4 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_18DataTypeDateTimeV2EvEEEEbRKT_ENKUlSG_E_clINSB_INS_19DataTypeTimeStampTzESC_EEEEbSG_ Line | Count | Source | 120 | 20 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 20 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 20 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | 20 | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | 20 | return false; | 127 | 20 | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 20 | return false; | 173 | 20 | }); |
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_18DataTypeDateTimeV2EvEEEEbRKT_ENKUlSG_E_clINSB_INS_12DataTypeIPv4ESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_18DataTypeDateTimeV2EvEEEEbRKT_ENKUlSG_E_clINSB_INS_12DataTypeIPv6ESC_EEEEbSG_ function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_18DataTypeDateTimeV2EvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeStringESC_EEEEbSG_ Line | Count | Source | 120 | 4.27k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 4.27k | using Types2 = std::decay_t<decltype(types2)>; | 122 | 4.27k | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | 4.27k | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | 4.27k | return false; | 127 | 4.27k | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 4.27k | return false; | 173 | 4.27k | }); |
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_16DataTypeDateTimeEvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeNumberILNS_13PrimitiveTypeE2EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_16DataTypeDateTimeEvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeNumberILNS_13PrimitiveTypeE3EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_16DataTypeDateTimeEvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeNumberILNS_13PrimitiveTypeE4EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_16DataTypeDateTimeEvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeNumberILNS_13PrimitiveTypeE5EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_16DataTypeDateTimeEvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeNumberILNS_13PrimitiveTypeE6EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_16DataTypeDateTimeEvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeNumberILNS_13PrimitiveTypeE7EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_16DataTypeDateTimeEvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeNumberILNS_13PrimitiveTypeE8EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_16DataTypeDateTimeEvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeNumberILNS_13PrimitiveTypeE9EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_16DataTypeDateTimeEvEEEEbRKT_ENKUlSG_E_clINSB_INS_15DataTypeDecimalILNS_13PrimitiveTypeE28EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_16DataTypeDateTimeEvEEEEbRKT_ENKUlSG_E_clINSB_INS_15DataTypeDecimalILNS_13PrimitiveTypeE29EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_16DataTypeDateTimeEvEEEEbRKT_ENKUlSG_E_clINSB_INS_15DataTypeDecimalILNS_13PrimitiveTypeE20EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_16DataTypeDateTimeEvEEEEbRKT_ENKUlSG_E_clINSB_INS_15DataTypeDecimalILNS_13PrimitiveTypeE30EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_16DataTypeDateTimeEvEEEEbRKT_ENKUlSG_E_clINSB_INS_15DataTypeDecimalILNS_13PrimitiveTypeE35EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_16DataTypeDateTimeEvEEEEbRKT_ENKUlSG_E_clINSB_INS_12DataTypeDateESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_16DataTypeDateTimeEvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeDateV2ESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_16DataTypeDateTimeEvEEEEbRKT_ENKUlSG_E_clINSB_INS_18DataTypeDateTimeV2ESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_16DataTypeDateTimeEvEEEEbRKT_ENKUlSG_E_clINSB_ISC_SC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_16DataTypeDateTimeEvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeTimeV2ESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_16DataTypeDateTimeEvEEEEbRKT_ENKUlSG_E_clINSB_INS_19DataTypeTimeStampTzESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_16DataTypeDateTimeEvEEEEbRKT_ENKUlSG_E_clINSB_INS_12DataTypeIPv4ESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_16DataTypeDateTimeEvEEEEbRKT_ENKUlSG_E_clINSB_INS_12DataTypeIPv6ESC_EEEEbSG_ function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_16DataTypeDateTimeEvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeStringESC_EEEEbSG_ Line | Count | Source | 120 | 26 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 26 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 26 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | 26 | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | 26 | return false; | 127 | 26 | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 26 | return false; | 173 | 26 | }); |
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeTimeV2EvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeNumberILNS_13PrimitiveTypeE2EEESC_EEEEbSG_ function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeTimeV2EvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeNumberILNS_13PrimitiveTypeE3EEESC_EEEEbSG_ Line | Count | Source | 120 | 28 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 28 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 28 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 28 | return false; | 173 | 28 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeTimeV2EvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeNumberILNS_13PrimitiveTypeE4EEESC_EEEEbSG_ Line | Count | Source | 120 | 21 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 21 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 21 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 21 | return false; | 173 | 21 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeTimeV2EvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeNumberILNS_13PrimitiveTypeE5EEESC_EEEEbSG_ Line | Count | Source | 120 | 33 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 33 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 33 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 33 | return false; | 173 | 33 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeTimeV2EvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeNumberILNS_13PrimitiveTypeE6EEESC_EEEEbSG_ Line | Count | Source | 120 | 9 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 9 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 9 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 9 | return false; | 173 | 9 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeTimeV2EvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeNumberILNS_13PrimitiveTypeE7EEESC_EEEEbSG_ Line | Count | Source | 120 | 3 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 3 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 3 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 3 | return false; | 173 | 3 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeTimeV2EvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeNumberILNS_13PrimitiveTypeE8EEESC_EEEEbSG_ Line | Count | Source | 120 | 7 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 7 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 7 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 7 | return false; | 173 | 7 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeTimeV2EvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeNumberILNS_13PrimitiveTypeE9EEESC_EEEEbSG_ Line | Count | Source | 120 | 18 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 18 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 18 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 18 | return false; | 173 | 18 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeTimeV2EvEEEEbRKT_ENKUlSG_E_clINSB_INS_15DataTypeDecimalILNS_13PrimitiveTypeE28EEESC_EEEEbSG_ Line | Count | Source | 120 | 2 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 2 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 2 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 2 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 2 | using FromFieldType = typename FromDataType::FieldType; | 130 | 2 | using ToFieldType = typename ToDataType::FieldType; | 131 | 2 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 2 | UInt32 from_scale = 0; | 133 | | | 134 | 2 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 2 | const auto* from_decimal_type = | 136 | 2 | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 2 | from_precision = | 138 | 2 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 2 | from_scale = from_decimal_type->get_scale(); | 140 | 2 | } | 141 | | | 142 | 2 | UInt32 to_max_digits = 0; | 143 | 2 | UInt32 to_precision = 0; | 144 | 2 | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | 2 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | 2 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | 2 | to_precision = to_max_digits; | 160 | 2 | } | 161 | | | 162 | 2 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 2 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 2 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 2 | if (to_scale > from_scale) { | 167 | 0 | multiply_may_overflow &= | 168 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 0 | } | 170 | 2 | return narrow_integral || multiply_may_overflow; | 171 | 2 | } | 172 | 0 | return false; | 173 | 2 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeTimeV2EvEEEEbRKT_ENKUlSG_E_clINSB_INS_15DataTypeDecimalILNS_13PrimitiveTypeE29EEESC_EEEEbSG_ Line | Count | Source | 120 | 1 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 1 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 1 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 1 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 1 | using FromFieldType = typename FromDataType::FieldType; | 130 | 1 | using ToFieldType = typename ToDataType::FieldType; | 131 | 1 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 1 | UInt32 from_scale = 0; | 133 | | | 134 | 1 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 1 | const auto* from_decimal_type = | 136 | 1 | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 1 | from_precision = | 138 | 1 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 1 | from_scale = from_decimal_type->get_scale(); | 140 | 1 | } | 141 | | | 142 | 1 | UInt32 to_max_digits = 0; | 143 | 1 | UInt32 to_precision = 0; | 144 | 1 | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | 1 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | 1 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | 1 | to_precision = to_max_digits; | 160 | 1 | } | 161 | | | 162 | 1 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 1 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 1 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 1 | if (to_scale > from_scale) { | 167 | 0 | multiply_may_overflow &= | 168 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 0 | } | 170 | 1 | return narrow_integral || multiply_may_overflow; | 171 | 1 | } | 172 | 0 | return false; | 173 | 1 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeTimeV2EvEEEEbRKT_ENKUlSG_E_clINSB_INS_15DataTypeDecimalILNS_13PrimitiveTypeE20EEESC_EEEEbSG_ Line | Count | Source | 120 | 1 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 1 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 1 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 1 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 1 | using FromFieldType = typename FromDataType::FieldType; | 130 | 1 | using ToFieldType = typename ToDataType::FieldType; | 131 | 1 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 1 | UInt32 from_scale = 0; | 133 | | | 134 | 1 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 1 | const auto* from_decimal_type = | 136 | 1 | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 1 | from_precision = | 138 | 1 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 1 | from_scale = from_decimal_type->get_scale(); | 140 | 1 | } | 141 | | | 142 | 1 | UInt32 to_max_digits = 0; | 143 | 1 | UInt32 to_precision = 0; | 144 | 1 | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | 1 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | 1 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | 1 | to_precision = to_max_digits; | 160 | 1 | } | 161 | | | 162 | 1 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 1 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 1 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 1 | if (to_scale > from_scale) { | 167 | 0 | multiply_may_overflow &= | 168 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 0 | } | 170 | 1 | return narrow_integral || multiply_may_overflow; | 171 | 1 | } | 172 | 0 | return false; | 173 | 1 | }); |
function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeTimeV2EvEEEEbRKT_ENKUlSG_E_clINSB_INS_15DataTypeDecimalILNS_13PrimitiveTypeE30EEESC_EEEEbSG_ Line | Count | Source | 120 | 11 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 11 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 11 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | 11 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 11 | using FromFieldType = typename FromDataType::FieldType; | 130 | 11 | using ToFieldType = typename ToDataType::FieldType; | 131 | 11 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 11 | UInt32 from_scale = 0; | 133 | | | 134 | 11 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 11 | const auto* from_decimal_type = | 136 | 11 | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 11 | from_precision = | 138 | 11 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 11 | from_scale = from_decimal_type->get_scale(); | 140 | 11 | } | 141 | | | 142 | 11 | UInt32 to_max_digits = 0; | 143 | 11 | UInt32 to_precision = 0; | 144 | 11 | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | 11 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | 11 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | 11 | to_precision = to_max_digits; | 160 | 11 | } | 161 | | | 162 | 11 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 11 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 11 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 11 | if (to_scale > from_scale) { | 167 | 0 | multiply_may_overflow &= | 168 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 0 | } | 170 | 11 | return narrow_integral || multiply_may_overflow; | 171 | 11 | } | 172 | 0 | return false; | 173 | 11 | }); |
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeTimeV2EvEEEEbRKT_ENKUlSG_E_clINSB_INS_15DataTypeDecimalILNS_13PrimitiveTypeE35EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeTimeV2EvEEEEbRKT_ENKUlSG_E_clINSB_INS_12DataTypeDateESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeTimeV2EvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeDateV2ESC_EEEEbSG_ function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeTimeV2EvEEEEbRKT_ENKUlSG_E_clINSB_INS_18DataTypeDateTimeV2ESC_EEEEbSG_ Line | Count | Source | 120 | 8 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 8 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 8 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 8 | return false; | 173 | 8 | }); |
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeTimeV2EvEEEEbRKT_ENKUlSG_E_clINSB_INS_16DataTypeDateTimeESC_EEEEbSG_ function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeTimeV2EvEEEEbRKT_ENKUlSG_E_clINSB_ISC_SC_EEEEbSG_ Line | Count | Source | 120 | 19 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 19 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 19 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | | return false; | 127 | | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 19 | return false; | 173 | 19 | }); |
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeTimeV2EvEEEEbRKT_ENKUlSG_E_clINSB_INS_19DataTypeTimeStampTzESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeTimeV2EvEEEEbRKT_ENKUlSG_E_clINSB_INS_12DataTypeIPv4ESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeTimeV2EvEEEEbRKT_ENKUlSG_E_clINSB_INS_12DataTypeIPv6ESC_EEEEbSG_ function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeTimeV2EvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeStringESC_EEEEbSG_ Line | Count | Source | 120 | 299 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 299 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 299 | using FromDataType = typename Types2::LeftType; | 123 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | 299 | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | 299 | return false; | 127 | 299 | } | 128 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | | using FromFieldType = typename FromDataType::FieldType; | 130 | | using ToFieldType = typename ToDataType::FieldType; | 131 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | | UInt32 from_scale = 0; | 133 | | | 134 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | | const auto* from_decimal_type = | 136 | | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | | from_precision = | 138 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | | from_scale = from_decimal_type->get_scale(); | 140 | | } | 141 | | | 142 | | UInt32 to_max_digits = 0; | 143 | | UInt32 to_precision = 0; | 144 | | UInt32 to_scale = 0; | 145 | | | 146 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | | const auto* to_decimal_type = | 150 | | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | | to_precision = to_decimal_type->get_precision(); | 152 | | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | | to_scale = to_decimal_type->get_scale(); | 155 | | ToDataType::check_type_scale(to_scale); | 156 | | } | 157 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | | to_precision = to_max_digits; | 160 | | } | 161 | | | 162 | | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | | if (to_scale > from_scale) { | 167 | | multiply_may_overflow &= | 168 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | | } | 170 | | return narrow_integral || multiply_may_overflow; | 171 | | } | 172 | 299 | return false; | 173 | 299 | }); |
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_19DataTypeTimeStampTzEvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeNumberILNS_13PrimitiveTypeE2EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_19DataTypeTimeStampTzEvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeNumberILNS_13PrimitiveTypeE3EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_19DataTypeTimeStampTzEvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeNumberILNS_13PrimitiveTypeE4EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_19DataTypeTimeStampTzEvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeNumberILNS_13PrimitiveTypeE5EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_19DataTypeTimeStampTzEvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeNumberILNS_13PrimitiveTypeE6EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_19DataTypeTimeStampTzEvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeNumberILNS_13PrimitiveTypeE7EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_19DataTypeTimeStampTzEvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeNumberILNS_13PrimitiveTypeE8EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_19DataTypeTimeStampTzEvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeNumberILNS_13PrimitiveTypeE9EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_19DataTypeTimeStampTzEvEEEEbRKT_ENKUlSG_E_clINSB_INS_15DataTypeDecimalILNS_13PrimitiveTypeE28EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_19DataTypeTimeStampTzEvEEEEbRKT_ENKUlSG_E_clINSB_INS_15DataTypeDecimalILNS_13PrimitiveTypeE29EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_19DataTypeTimeStampTzEvEEEEbRKT_ENKUlSG_E_clINSB_INS_15DataTypeDecimalILNS_13PrimitiveTypeE20EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_19DataTypeTimeStampTzEvEEEEbRKT_ENKUlSG_E_clINSB_INS_15DataTypeDecimalILNS_13PrimitiveTypeE30EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_19DataTypeTimeStampTzEvEEEEbRKT_ENKUlSG_E_clINSB_INS_15DataTypeDecimalILNS_13PrimitiveTypeE35EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_19DataTypeTimeStampTzEvEEEEbRKT_ENKUlSG_E_clINSB_INS_12DataTypeDateESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_19DataTypeTimeStampTzEvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeDateV2ESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_19DataTypeTimeStampTzEvEEEEbRKT_ENKUlSG_E_clINSB_INS_18DataTypeDateTimeV2ESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_19DataTypeTimeStampTzEvEEEEbRKT_ENKUlSG_E_clINSB_INS_16DataTypeDateTimeESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_19DataTypeTimeStampTzEvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeTimeV2ESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_19DataTypeTimeStampTzEvEEEEbRKT_ENKUlSG_E_clINSB_ISC_SC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_19DataTypeTimeStampTzEvEEEEbRKT_ENKUlSG_E_clINSB_INS_12DataTypeIPv4ESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_19DataTypeTimeStampTzEvEEEEbRKT_ENKUlSG_E_clINSB_INS_12DataTypeIPv6ESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_19DataTypeTimeStampTzEvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeStringESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_12DataTypeIPv4EvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeNumberILNS_13PrimitiveTypeE2EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_12DataTypeIPv4EvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeNumberILNS_13PrimitiveTypeE3EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_12DataTypeIPv4EvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeNumberILNS_13PrimitiveTypeE4EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_12DataTypeIPv4EvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeNumberILNS_13PrimitiveTypeE5EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_12DataTypeIPv4EvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeNumberILNS_13PrimitiveTypeE6EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_12DataTypeIPv4EvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeNumberILNS_13PrimitiveTypeE7EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_12DataTypeIPv4EvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeNumberILNS_13PrimitiveTypeE8EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_12DataTypeIPv4EvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeNumberILNS_13PrimitiveTypeE9EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_12DataTypeIPv4EvEEEEbRKT_ENKUlSG_E_clINSB_INS_15DataTypeDecimalILNS_13PrimitiveTypeE28EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_12DataTypeIPv4EvEEEEbRKT_ENKUlSG_E_clINSB_INS_15DataTypeDecimalILNS_13PrimitiveTypeE29EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_12DataTypeIPv4EvEEEEbRKT_ENKUlSG_E_clINSB_INS_15DataTypeDecimalILNS_13PrimitiveTypeE20EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_12DataTypeIPv4EvEEEEbRKT_ENKUlSG_E_clINSB_INS_15DataTypeDecimalILNS_13PrimitiveTypeE30EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_12DataTypeIPv4EvEEEEbRKT_ENKUlSG_E_clINSB_INS_15DataTypeDecimalILNS_13PrimitiveTypeE35EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_12DataTypeIPv4EvEEEEbRKT_ENKUlSG_E_clINSB_INS_12DataTypeDateESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_12DataTypeIPv4EvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeDateV2ESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_12DataTypeIPv4EvEEEEbRKT_ENKUlSG_E_clINSB_INS_18DataTypeDateTimeV2ESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_12DataTypeIPv4EvEEEEbRKT_ENKUlSG_E_clINSB_INS_16DataTypeDateTimeESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_12DataTypeIPv4EvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeTimeV2ESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_12DataTypeIPv4EvEEEEbRKT_ENKUlSG_E_clINSB_INS_19DataTypeTimeStampTzESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_12DataTypeIPv4EvEEEEbRKT_ENKUlSG_E_clINSB_ISC_SC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_12DataTypeIPv4EvEEEEbRKT_ENKUlSG_E_clINSB_INS_12DataTypeIPv6ESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_12DataTypeIPv4EvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeStringESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_12DataTypeIPv6EvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeNumberILNS_13PrimitiveTypeE2EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_12DataTypeIPv6EvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeNumberILNS_13PrimitiveTypeE3EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_12DataTypeIPv6EvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeNumberILNS_13PrimitiveTypeE4EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_12DataTypeIPv6EvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeNumberILNS_13PrimitiveTypeE5EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_12DataTypeIPv6EvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeNumberILNS_13PrimitiveTypeE6EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_12DataTypeIPv6EvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeNumberILNS_13PrimitiveTypeE7EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_12DataTypeIPv6EvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeNumberILNS_13PrimitiveTypeE8EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_12DataTypeIPv6EvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeNumberILNS_13PrimitiveTypeE9EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_12DataTypeIPv6EvEEEEbRKT_ENKUlSG_E_clINSB_INS_15DataTypeDecimalILNS_13PrimitiveTypeE28EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_12DataTypeIPv6EvEEEEbRKT_ENKUlSG_E_clINSB_INS_15DataTypeDecimalILNS_13PrimitiveTypeE29EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_12DataTypeIPv6EvEEEEbRKT_ENKUlSG_E_clINSB_INS_15DataTypeDecimalILNS_13PrimitiveTypeE20EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_12DataTypeIPv6EvEEEEbRKT_ENKUlSG_E_clINSB_INS_15DataTypeDecimalILNS_13PrimitiveTypeE30EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_12DataTypeIPv6EvEEEEbRKT_ENKUlSG_E_clINSB_INS_15DataTypeDecimalILNS_13PrimitiveTypeE35EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_12DataTypeIPv6EvEEEEbRKT_ENKUlSG_E_clINSB_INS_12DataTypeDateESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_12DataTypeIPv6EvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeDateV2ESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_12DataTypeIPv6EvEEEEbRKT_ENKUlSG_E_clINSB_INS_18DataTypeDateTimeV2ESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_12DataTypeIPv6EvEEEEbRKT_ENKUlSG_E_clINSB_INS_16DataTypeDateTimeESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_12DataTypeIPv6EvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeTimeV2ESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_12DataTypeIPv6EvEEEEbRKT_ENKUlSG_E_clINSB_INS_19DataTypeTimeStampTzESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_12DataTypeIPv6EvEEEEbRKT_ENKUlSG_E_clINSB_INS_12DataTypeIPv4ESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_12DataTypeIPv6EvEEEEbRKT_ENKUlSG_E_clINSB_ISC_SC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_12DataTypeIPv6EvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeStringESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeStringEvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeNumberILNS_13PrimitiveTypeE2EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeStringEvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeNumberILNS_13PrimitiveTypeE3EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeStringEvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeNumberILNS_13PrimitiveTypeE4EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeStringEvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeNumberILNS_13PrimitiveTypeE5EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeStringEvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeNumberILNS_13PrimitiveTypeE6EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeStringEvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeNumberILNS_13PrimitiveTypeE7EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeStringEvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeNumberILNS_13PrimitiveTypeE8EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeStringEvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeNumberILNS_13PrimitiveTypeE9EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeStringEvEEEEbRKT_ENKUlSG_E_clINSB_INS_15DataTypeDecimalILNS_13PrimitiveTypeE28EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeStringEvEEEEbRKT_ENKUlSG_E_clINSB_INS_15DataTypeDecimalILNS_13PrimitiveTypeE29EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeStringEvEEEEbRKT_ENKUlSG_E_clINSB_INS_15DataTypeDecimalILNS_13PrimitiveTypeE20EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeStringEvEEEEbRKT_ENKUlSG_E_clINSB_INS_15DataTypeDecimalILNS_13PrimitiveTypeE30EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeStringEvEEEEbRKT_ENKUlSG_E_clINSB_INS_15DataTypeDecimalILNS_13PrimitiveTypeE35EEESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeStringEvEEEEbRKT_ENKUlSG_E_clINSB_INS_12DataTypeDateESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeStringEvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeDateV2ESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeStringEvEEEEbRKT_ENKUlSG_E_clINSB_INS_18DataTypeDateTimeV2ESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeStringEvEEEEbRKT_ENKUlSG_E_clINSB_INS_16DataTypeDateTimeESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeStringEvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeTimeV2ESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeStringEvEEEEbRKT_ENKUlSG_E_clINSB_INS_19DataTypeTimeStampTzESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeStringEvEEEEbRKT_ENKUlSG_E_clINSB_INS_12DataTypeIPv4ESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeStringEvEEEEbRKT_ENKUlSG_E_clINSB_INS_12DataTypeIPv6ESC_EEEEbSG_ Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeStringEvEEEEbRKT_ENKUlSG_E_clINSB_ISC_SC_EEEEbSG_ |
174 | 248k | }; function_cast.cpp:_ZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE2EEEvEEEEbRKT_ Line | Count | Source | 110 | 2.48k | auto make_default_wrapper = [&](const auto& types) -> bool { | 111 | 2.48k | using Types = std::decay_t<decltype(types)>; | 112 | 2.48k | using ToDataType = typename Types::LeftType; | 113 | | | 114 | | if constexpr (!(IsDataTypeDecimalOrNumber<ToDataType> || IsDatelikeV1Types<ToDataType> || | 115 | | IsDatelikeV2Types<ToDataType> || | 116 | | std::is_same_v<ToDataType, DataTypeTimeV2>)) { | 117 | | return false; | 118 | | } | 119 | 2.48k | return call_on_index_and_data_type< | 120 | 2.48k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 2.48k | using Types2 = std::decay_t<decltype(types2)>; | 122 | 2.48k | using FromDataType = typename Types2::LeftType; | 123 | 2.48k | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | 2.48k | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | 2.48k | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | 2.48k | return false; | 127 | 2.48k | } | 128 | 2.48k | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 2.48k | using FromFieldType = typename FromDataType::FieldType; | 130 | 2.48k | using ToFieldType = typename ToDataType::FieldType; | 131 | 2.48k | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 2.48k | UInt32 from_scale = 0; | 133 | | | 134 | 2.48k | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 2.48k | const auto* from_decimal_type = | 136 | 2.48k | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 2.48k | from_precision = | 138 | 2.48k | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 2.48k | from_scale = from_decimal_type->get_scale(); | 140 | 2.48k | } | 141 | | | 142 | 2.48k | UInt32 to_max_digits = 0; | 143 | 2.48k | UInt32 to_precision = 0; | 144 | 2.48k | UInt32 to_scale = 0; | 145 | | | 146 | 2.48k | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 2.48k | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 2.48k | const auto* to_decimal_type = | 150 | 2.48k | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 2.48k | to_precision = to_decimal_type->get_precision(); | 152 | 2.48k | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 2.48k | to_scale = to_decimal_type->get_scale(); | 155 | 2.48k | ToDataType::check_type_scale(to_scale); | 156 | 2.48k | } | 157 | 2.48k | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | 2.48k | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | 2.48k | to_precision = to_max_digits; | 160 | 2.48k | } | 161 | | | 162 | 2.48k | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 2.48k | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 2.48k | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 2.48k | if (to_scale > from_scale) { | 167 | 2.48k | multiply_may_overflow &= | 168 | 2.48k | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 2.48k | } | 170 | 2.48k | return narrow_integral || multiply_may_overflow; | 171 | 2.48k | } | 172 | 2.48k | return false; | 173 | 2.48k | }); | 174 | 2.48k | }; |
function_cast.cpp:_ZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE3EEEvEEEEbRKT_ Line | Count | Source | 110 | 7.65k | auto make_default_wrapper = [&](const auto& types) -> bool { | 111 | 7.65k | using Types = std::decay_t<decltype(types)>; | 112 | 7.65k | using ToDataType = typename Types::LeftType; | 113 | | | 114 | | if constexpr (!(IsDataTypeDecimalOrNumber<ToDataType> || IsDatelikeV1Types<ToDataType> || | 115 | | IsDatelikeV2Types<ToDataType> || | 116 | | std::is_same_v<ToDataType, DataTypeTimeV2>)) { | 117 | | return false; | 118 | | } | 119 | 7.65k | return call_on_index_and_data_type< | 120 | 7.65k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 7.65k | using Types2 = std::decay_t<decltype(types2)>; | 122 | 7.65k | using FromDataType = typename Types2::LeftType; | 123 | 7.65k | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | 7.65k | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | 7.65k | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | 7.65k | return false; | 127 | 7.65k | } | 128 | 7.65k | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 7.65k | using FromFieldType = typename FromDataType::FieldType; | 130 | 7.65k | using ToFieldType = typename ToDataType::FieldType; | 131 | 7.65k | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 7.65k | UInt32 from_scale = 0; | 133 | | | 134 | 7.65k | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 7.65k | const auto* from_decimal_type = | 136 | 7.65k | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 7.65k | from_precision = | 138 | 7.65k | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 7.65k | from_scale = from_decimal_type->get_scale(); | 140 | 7.65k | } | 141 | | | 142 | 7.65k | UInt32 to_max_digits = 0; | 143 | 7.65k | UInt32 to_precision = 0; | 144 | 7.65k | UInt32 to_scale = 0; | 145 | | | 146 | 7.65k | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 7.65k | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 7.65k | const auto* to_decimal_type = | 150 | 7.65k | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 7.65k | to_precision = to_decimal_type->get_precision(); | 152 | 7.65k | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 7.65k | to_scale = to_decimal_type->get_scale(); | 155 | 7.65k | ToDataType::check_type_scale(to_scale); | 156 | 7.65k | } | 157 | 7.65k | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | 7.65k | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | 7.65k | to_precision = to_max_digits; | 160 | 7.65k | } | 161 | | | 162 | 7.65k | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 7.65k | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 7.65k | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 7.65k | if (to_scale > from_scale) { | 167 | 7.65k | multiply_may_overflow &= | 168 | 7.65k | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 7.65k | } | 170 | 7.65k | return narrow_integral || multiply_may_overflow; | 171 | 7.65k | } | 172 | 7.65k | return false; | 173 | 7.65k | }); | 174 | 7.65k | }; |
function_cast.cpp:_ZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE4EEEvEEEEbRKT_ Line | Count | Source | 110 | 5.73k | auto make_default_wrapper = [&](const auto& types) -> bool { | 111 | 5.73k | using Types = std::decay_t<decltype(types)>; | 112 | 5.73k | using ToDataType = typename Types::LeftType; | 113 | | | 114 | | if constexpr (!(IsDataTypeDecimalOrNumber<ToDataType> || IsDatelikeV1Types<ToDataType> || | 115 | | IsDatelikeV2Types<ToDataType> || | 116 | | std::is_same_v<ToDataType, DataTypeTimeV2>)) { | 117 | | return false; | 118 | | } | 119 | 5.73k | return call_on_index_and_data_type< | 120 | 5.73k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 5.73k | using Types2 = std::decay_t<decltype(types2)>; | 122 | 5.73k | using FromDataType = typename Types2::LeftType; | 123 | 5.73k | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | 5.73k | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | 5.73k | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | 5.73k | return false; | 127 | 5.73k | } | 128 | 5.73k | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 5.73k | using FromFieldType = typename FromDataType::FieldType; | 130 | 5.73k | using ToFieldType = typename ToDataType::FieldType; | 131 | 5.73k | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 5.73k | UInt32 from_scale = 0; | 133 | | | 134 | 5.73k | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 5.73k | const auto* from_decimal_type = | 136 | 5.73k | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 5.73k | from_precision = | 138 | 5.73k | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 5.73k | from_scale = from_decimal_type->get_scale(); | 140 | 5.73k | } | 141 | | | 142 | 5.73k | UInt32 to_max_digits = 0; | 143 | 5.73k | UInt32 to_precision = 0; | 144 | 5.73k | UInt32 to_scale = 0; | 145 | | | 146 | 5.73k | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 5.73k | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 5.73k | const auto* to_decimal_type = | 150 | 5.73k | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 5.73k | to_precision = to_decimal_type->get_precision(); | 152 | 5.73k | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 5.73k | to_scale = to_decimal_type->get_scale(); | 155 | 5.73k | ToDataType::check_type_scale(to_scale); | 156 | 5.73k | } | 157 | 5.73k | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | 5.73k | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | 5.73k | to_precision = to_max_digits; | 160 | 5.73k | } | 161 | | | 162 | 5.73k | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 5.73k | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 5.73k | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 5.73k | if (to_scale > from_scale) { | 167 | 5.73k | multiply_may_overflow &= | 168 | 5.73k | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 5.73k | } | 170 | 5.73k | return narrow_integral || multiply_may_overflow; | 171 | 5.73k | } | 172 | 5.73k | return false; | 173 | 5.73k | }); | 174 | 5.73k | }; |
function_cast.cpp:_ZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE5EEEvEEEEbRKT_ Line | Count | Source | 110 | 36.3k | auto make_default_wrapper = [&](const auto& types) -> bool { | 111 | 36.3k | using Types = std::decay_t<decltype(types)>; | 112 | 36.3k | using ToDataType = typename Types::LeftType; | 113 | | | 114 | | if constexpr (!(IsDataTypeDecimalOrNumber<ToDataType> || IsDatelikeV1Types<ToDataType> || | 115 | | IsDatelikeV2Types<ToDataType> || | 116 | | std::is_same_v<ToDataType, DataTypeTimeV2>)) { | 117 | | return false; | 118 | | } | 119 | 36.3k | return call_on_index_and_data_type< | 120 | 36.3k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 36.3k | using Types2 = std::decay_t<decltype(types2)>; | 122 | 36.3k | using FromDataType = typename Types2::LeftType; | 123 | 36.3k | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | 36.3k | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | 36.3k | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | 36.3k | return false; | 127 | 36.3k | } | 128 | 36.3k | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 36.3k | using FromFieldType = typename FromDataType::FieldType; | 130 | 36.3k | using ToFieldType = typename ToDataType::FieldType; | 131 | 36.3k | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 36.3k | UInt32 from_scale = 0; | 133 | | | 134 | 36.3k | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 36.3k | const auto* from_decimal_type = | 136 | 36.3k | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 36.3k | from_precision = | 138 | 36.3k | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 36.3k | from_scale = from_decimal_type->get_scale(); | 140 | 36.3k | } | 141 | | | 142 | 36.3k | UInt32 to_max_digits = 0; | 143 | 36.3k | UInt32 to_precision = 0; | 144 | 36.3k | UInt32 to_scale = 0; | 145 | | | 146 | 36.3k | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 36.3k | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 36.3k | const auto* to_decimal_type = | 150 | 36.3k | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 36.3k | to_precision = to_decimal_type->get_precision(); | 152 | 36.3k | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 36.3k | to_scale = to_decimal_type->get_scale(); | 155 | 36.3k | ToDataType::check_type_scale(to_scale); | 156 | 36.3k | } | 157 | 36.3k | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | 36.3k | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | 36.3k | to_precision = to_max_digits; | 160 | 36.3k | } | 161 | | | 162 | 36.3k | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 36.3k | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 36.3k | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 36.3k | if (to_scale > from_scale) { | 167 | 36.3k | multiply_may_overflow &= | 168 | 36.3k | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 36.3k | } | 170 | 36.3k | return narrow_integral || multiply_may_overflow; | 171 | 36.3k | } | 172 | 36.3k | return false; | 173 | 36.3k | }); | 174 | 36.3k | }; |
function_cast.cpp:_ZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE6EEEvEEEEbRKT_ Line | Count | Source | 110 | 42.0k | auto make_default_wrapper = [&](const auto& types) -> bool { | 111 | 42.0k | using Types = std::decay_t<decltype(types)>; | 112 | 42.0k | using ToDataType = typename Types::LeftType; | 113 | | | 114 | | if constexpr (!(IsDataTypeDecimalOrNumber<ToDataType> || IsDatelikeV1Types<ToDataType> || | 115 | | IsDatelikeV2Types<ToDataType> || | 116 | | std::is_same_v<ToDataType, DataTypeTimeV2>)) { | 117 | | return false; | 118 | | } | 119 | 42.0k | return call_on_index_and_data_type< | 120 | 42.0k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 42.0k | using Types2 = std::decay_t<decltype(types2)>; | 122 | 42.0k | using FromDataType = typename Types2::LeftType; | 123 | 42.0k | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | 42.0k | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | 42.0k | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | 42.0k | return false; | 127 | 42.0k | } | 128 | 42.0k | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 42.0k | using FromFieldType = typename FromDataType::FieldType; | 130 | 42.0k | using ToFieldType = typename ToDataType::FieldType; | 131 | 42.0k | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 42.0k | UInt32 from_scale = 0; | 133 | | | 134 | 42.0k | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 42.0k | const auto* from_decimal_type = | 136 | 42.0k | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 42.0k | from_precision = | 138 | 42.0k | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 42.0k | from_scale = from_decimal_type->get_scale(); | 140 | 42.0k | } | 141 | | | 142 | 42.0k | UInt32 to_max_digits = 0; | 143 | 42.0k | UInt32 to_precision = 0; | 144 | 42.0k | UInt32 to_scale = 0; | 145 | | | 146 | 42.0k | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 42.0k | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 42.0k | const auto* to_decimal_type = | 150 | 42.0k | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 42.0k | to_precision = to_decimal_type->get_precision(); | 152 | 42.0k | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 42.0k | to_scale = to_decimal_type->get_scale(); | 155 | 42.0k | ToDataType::check_type_scale(to_scale); | 156 | 42.0k | } | 157 | 42.0k | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | 42.0k | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | 42.0k | to_precision = to_max_digits; | 160 | 42.0k | } | 161 | | | 162 | 42.0k | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 42.0k | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 42.0k | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 42.0k | if (to_scale > from_scale) { | 167 | 42.0k | multiply_may_overflow &= | 168 | 42.0k | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 42.0k | } | 170 | 42.0k | return narrow_integral || multiply_may_overflow; | 171 | 42.0k | } | 172 | 42.0k | return false; | 173 | 42.0k | }); | 174 | 42.0k | }; |
function_cast.cpp:_ZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE7EEEvEEEEbRKT_ Line | Count | Source | 110 | 5.61k | auto make_default_wrapper = [&](const auto& types) -> bool { | 111 | 5.61k | using Types = std::decay_t<decltype(types)>; | 112 | 5.61k | using ToDataType = typename Types::LeftType; | 113 | | | 114 | | if constexpr (!(IsDataTypeDecimalOrNumber<ToDataType> || IsDatelikeV1Types<ToDataType> || | 115 | | IsDatelikeV2Types<ToDataType> || | 116 | | std::is_same_v<ToDataType, DataTypeTimeV2>)) { | 117 | | return false; | 118 | | } | 119 | 5.61k | return call_on_index_and_data_type< | 120 | 5.61k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 5.61k | using Types2 = std::decay_t<decltype(types2)>; | 122 | 5.61k | using FromDataType = typename Types2::LeftType; | 123 | 5.61k | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | 5.61k | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | 5.61k | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | 5.61k | return false; | 127 | 5.61k | } | 128 | 5.61k | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 5.61k | using FromFieldType = typename FromDataType::FieldType; | 130 | 5.61k | using ToFieldType = typename ToDataType::FieldType; | 131 | 5.61k | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 5.61k | UInt32 from_scale = 0; | 133 | | | 134 | 5.61k | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 5.61k | const auto* from_decimal_type = | 136 | 5.61k | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 5.61k | from_precision = | 138 | 5.61k | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 5.61k | from_scale = from_decimal_type->get_scale(); | 140 | 5.61k | } | 141 | | | 142 | 5.61k | UInt32 to_max_digits = 0; | 143 | 5.61k | UInt32 to_precision = 0; | 144 | 5.61k | UInt32 to_scale = 0; | 145 | | | 146 | 5.61k | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 5.61k | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 5.61k | const auto* to_decimal_type = | 150 | 5.61k | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 5.61k | to_precision = to_decimal_type->get_precision(); | 152 | 5.61k | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 5.61k | to_scale = to_decimal_type->get_scale(); | 155 | 5.61k | ToDataType::check_type_scale(to_scale); | 156 | 5.61k | } | 157 | 5.61k | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | 5.61k | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | 5.61k | to_precision = to_max_digits; | 160 | 5.61k | } | 161 | | | 162 | 5.61k | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 5.61k | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 5.61k | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 5.61k | if (to_scale > from_scale) { | 167 | 5.61k | multiply_may_overflow &= | 168 | 5.61k | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 5.61k | } | 170 | 5.61k | return narrow_integral || multiply_may_overflow; | 171 | 5.61k | } | 172 | 5.61k | return false; | 173 | 5.61k | }); | 174 | 5.61k | }; |
function_cast.cpp:_ZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE8EEEvEEEEbRKT_ Line | Count | Source | 110 | 10.8k | auto make_default_wrapper = [&](const auto& types) -> bool { | 111 | 10.8k | using Types = std::decay_t<decltype(types)>; | 112 | 10.8k | using ToDataType = typename Types::LeftType; | 113 | | | 114 | | if constexpr (!(IsDataTypeDecimalOrNumber<ToDataType> || IsDatelikeV1Types<ToDataType> || | 115 | | IsDatelikeV2Types<ToDataType> || | 116 | | std::is_same_v<ToDataType, DataTypeTimeV2>)) { | 117 | | return false; | 118 | | } | 119 | 10.8k | return call_on_index_and_data_type< | 120 | 10.8k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 10.8k | using Types2 = std::decay_t<decltype(types2)>; | 122 | 10.8k | using FromDataType = typename Types2::LeftType; | 123 | 10.8k | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | 10.8k | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | 10.8k | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | 10.8k | return false; | 127 | 10.8k | } | 128 | 10.8k | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 10.8k | using FromFieldType = typename FromDataType::FieldType; | 130 | 10.8k | using ToFieldType = typename ToDataType::FieldType; | 131 | 10.8k | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 10.8k | UInt32 from_scale = 0; | 133 | | | 134 | 10.8k | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 10.8k | const auto* from_decimal_type = | 136 | 10.8k | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 10.8k | from_precision = | 138 | 10.8k | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 10.8k | from_scale = from_decimal_type->get_scale(); | 140 | 10.8k | } | 141 | | | 142 | 10.8k | UInt32 to_max_digits = 0; | 143 | 10.8k | UInt32 to_precision = 0; | 144 | 10.8k | UInt32 to_scale = 0; | 145 | | | 146 | 10.8k | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 10.8k | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 10.8k | const auto* to_decimal_type = | 150 | 10.8k | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 10.8k | to_precision = to_decimal_type->get_precision(); | 152 | 10.8k | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 10.8k | to_scale = to_decimal_type->get_scale(); | 155 | 10.8k | ToDataType::check_type_scale(to_scale); | 156 | 10.8k | } | 157 | 10.8k | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | 10.8k | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | 10.8k | to_precision = to_max_digits; | 160 | 10.8k | } | 161 | | | 162 | 10.8k | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 10.8k | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 10.8k | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 10.8k | if (to_scale > from_scale) { | 167 | 10.8k | multiply_may_overflow &= | 168 | 10.8k | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 10.8k | } | 170 | 10.8k | return narrow_integral || multiply_may_overflow; | 171 | 10.8k | } | 172 | 10.8k | return false; | 173 | 10.8k | }); | 174 | 10.8k | }; |
function_cast.cpp:_ZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE9EEEvEEEEbRKT_ Line | Count | Source | 110 | 31.1k | auto make_default_wrapper = [&](const auto& types) -> bool { | 111 | 31.1k | using Types = std::decay_t<decltype(types)>; | 112 | 31.1k | using ToDataType = typename Types::LeftType; | 113 | | | 114 | | if constexpr (!(IsDataTypeDecimalOrNumber<ToDataType> || IsDatelikeV1Types<ToDataType> || | 115 | | IsDatelikeV2Types<ToDataType> || | 116 | | std::is_same_v<ToDataType, DataTypeTimeV2>)) { | 117 | | return false; | 118 | | } | 119 | 31.1k | return call_on_index_and_data_type< | 120 | 31.1k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 31.1k | using Types2 = std::decay_t<decltype(types2)>; | 122 | 31.1k | using FromDataType = typename Types2::LeftType; | 123 | 31.1k | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | 31.1k | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | 31.1k | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | 31.1k | return false; | 127 | 31.1k | } | 128 | 31.1k | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 31.1k | using FromFieldType = typename FromDataType::FieldType; | 130 | 31.1k | using ToFieldType = typename ToDataType::FieldType; | 131 | 31.1k | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 31.1k | UInt32 from_scale = 0; | 133 | | | 134 | 31.1k | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 31.1k | const auto* from_decimal_type = | 136 | 31.1k | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 31.1k | from_precision = | 138 | 31.1k | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 31.1k | from_scale = from_decimal_type->get_scale(); | 140 | 31.1k | } | 141 | | | 142 | 31.1k | UInt32 to_max_digits = 0; | 143 | 31.1k | UInt32 to_precision = 0; | 144 | 31.1k | UInt32 to_scale = 0; | 145 | | | 146 | 31.1k | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 31.1k | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 31.1k | const auto* to_decimal_type = | 150 | 31.1k | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 31.1k | to_precision = to_decimal_type->get_precision(); | 152 | 31.1k | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 31.1k | to_scale = to_decimal_type->get_scale(); | 155 | 31.1k | ToDataType::check_type_scale(to_scale); | 156 | 31.1k | } | 157 | 31.1k | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | 31.1k | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | 31.1k | to_precision = to_max_digits; | 160 | 31.1k | } | 161 | | | 162 | 31.1k | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 31.1k | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 31.1k | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 31.1k | if (to_scale > from_scale) { | 167 | 31.1k | multiply_may_overflow &= | 168 | 31.1k | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 31.1k | } | 170 | 31.1k | return narrow_integral || multiply_may_overflow; | 171 | 31.1k | } | 172 | 31.1k | return false; | 173 | 31.1k | }); | 174 | 31.1k | }; |
function_cast.cpp:_ZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE28EEEvEEEEbRKT_ Line | Count | Source | 110 | 8.04k | auto make_default_wrapper = [&](const auto& types) -> bool { | 111 | 8.04k | using Types = std::decay_t<decltype(types)>; | 112 | 8.04k | using ToDataType = typename Types::LeftType; | 113 | | | 114 | | if constexpr (!(IsDataTypeDecimalOrNumber<ToDataType> || IsDatelikeV1Types<ToDataType> || | 115 | | IsDatelikeV2Types<ToDataType> || | 116 | | std::is_same_v<ToDataType, DataTypeTimeV2>)) { | 117 | | return false; | 118 | | } | 119 | 8.04k | return call_on_index_and_data_type< | 120 | 8.04k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 8.04k | using Types2 = std::decay_t<decltype(types2)>; | 122 | 8.04k | using FromDataType = typename Types2::LeftType; | 123 | 8.04k | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | 8.04k | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | 8.04k | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | 8.04k | return false; | 127 | 8.04k | } | 128 | 8.04k | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 8.04k | using FromFieldType = typename FromDataType::FieldType; | 130 | 8.04k | using ToFieldType = typename ToDataType::FieldType; | 131 | 8.04k | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 8.04k | UInt32 from_scale = 0; | 133 | | | 134 | 8.04k | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 8.04k | const auto* from_decimal_type = | 136 | 8.04k | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 8.04k | from_precision = | 138 | 8.04k | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 8.04k | from_scale = from_decimal_type->get_scale(); | 140 | 8.04k | } | 141 | | | 142 | 8.04k | UInt32 to_max_digits = 0; | 143 | 8.04k | UInt32 to_precision = 0; | 144 | 8.04k | UInt32 to_scale = 0; | 145 | | | 146 | 8.04k | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 8.04k | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 8.04k | const auto* to_decimal_type = | 150 | 8.04k | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 8.04k | to_precision = to_decimal_type->get_precision(); | 152 | 8.04k | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 8.04k | to_scale = to_decimal_type->get_scale(); | 155 | 8.04k | ToDataType::check_type_scale(to_scale); | 156 | 8.04k | } | 157 | 8.04k | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | 8.04k | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | 8.04k | to_precision = to_max_digits; | 160 | 8.04k | } | 161 | | | 162 | 8.04k | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 8.04k | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 8.04k | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 8.04k | if (to_scale > from_scale) { | 167 | 8.04k | multiply_may_overflow &= | 168 | 8.04k | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 8.04k | } | 170 | 8.04k | return narrow_integral || multiply_may_overflow; | 171 | 8.04k | } | 172 | 8.04k | return false; | 173 | 8.04k | }); | 174 | 8.04k | }; |
function_cast.cpp:_ZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE29EEEvEEEEbRKT_ Line | Count | Source | 110 | 21.2k | auto make_default_wrapper = [&](const auto& types) -> bool { | 111 | 21.2k | using Types = std::decay_t<decltype(types)>; | 112 | 21.2k | using ToDataType = typename Types::LeftType; | 113 | | | 114 | | if constexpr (!(IsDataTypeDecimalOrNumber<ToDataType> || IsDatelikeV1Types<ToDataType> || | 115 | | IsDatelikeV2Types<ToDataType> || | 116 | | std::is_same_v<ToDataType, DataTypeTimeV2>)) { | 117 | | return false; | 118 | | } | 119 | 21.2k | return call_on_index_and_data_type< | 120 | 21.2k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 21.2k | using Types2 = std::decay_t<decltype(types2)>; | 122 | 21.2k | using FromDataType = typename Types2::LeftType; | 123 | 21.2k | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | 21.2k | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | 21.2k | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | 21.2k | return false; | 127 | 21.2k | } | 128 | 21.2k | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 21.2k | using FromFieldType = typename FromDataType::FieldType; | 130 | 21.2k | using ToFieldType = typename ToDataType::FieldType; | 131 | 21.2k | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 21.2k | UInt32 from_scale = 0; | 133 | | | 134 | 21.2k | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 21.2k | const auto* from_decimal_type = | 136 | 21.2k | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 21.2k | from_precision = | 138 | 21.2k | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 21.2k | from_scale = from_decimal_type->get_scale(); | 140 | 21.2k | } | 141 | | | 142 | 21.2k | UInt32 to_max_digits = 0; | 143 | 21.2k | UInt32 to_precision = 0; | 144 | 21.2k | UInt32 to_scale = 0; | 145 | | | 146 | 21.2k | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 21.2k | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 21.2k | const auto* to_decimal_type = | 150 | 21.2k | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 21.2k | to_precision = to_decimal_type->get_precision(); | 152 | 21.2k | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 21.2k | to_scale = to_decimal_type->get_scale(); | 155 | 21.2k | ToDataType::check_type_scale(to_scale); | 156 | 21.2k | } | 157 | 21.2k | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | 21.2k | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | 21.2k | to_precision = to_max_digits; | 160 | 21.2k | } | 161 | | | 162 | 21.2k | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 21.2k | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 21.2k | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 21.2k | if (to_scale > from_scale) { | 167 | 21.2k | multiply_may_overflow &= | 168 | 21.2k | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 21.2k | } | 170 | 21.2k | return narrow_integral || multiply_may_overflow; | 171 | 21.2k | } | 172 | 21.2k | return false; | 173 | 21.2k | }); | 174 | 21.2k | }; |
function_cast.cpp:_ZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE20EEEvEEEEbRKT_ Line | Count | Source | 110 | 229 | auto make_default_wrapper = [&](const auto& types) -> bool { | 111 | 229 | using Types = std::decay_t<decltype(types)>; | 112 | 229 | using ToDataType = typename Types::LeftType; | 113 | | | 114 | | if constexpr (!(IsDataTypeDecimalOrNumber<ToDataType> || IsDatelikeV1Types<ToDataType> || | 115 | | IsDatelikeV2Types<ToDataType> || | 116 | | std::is_same_v<ToDataType, DataTypeTimeV2>)) { | 117 | | return false; | 118 | | } | 119 | 229 | return call_on_index_and_data_type< | 120 | 229 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 229 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 229 | using FromDataType = typename Types2::LeftType; | 123 | 229 | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | 229 | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | 229 | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | 229 | return false; | 127 | 229 | } | 128 | 229 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 229 | using FromFieldType = typename FromDataType::FieldType; | 130 | 229 | using ToFieldType = typename ToDataType::FieldType; | 131 | 229 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 229 | UInt32 from_scale = 0; | 133 | | | 134 | 229 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 229 | const auto* from_decimal_type = | 136 | 229 | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 229 | from_precision = | 138 | 229 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 229 | from_scale = from_decimal_type->get_scale(); | 140 | 229 | } | 141 | | | 142 | 229 | UInt32 to_max_digits = 0; | 143 | 229 | UInt32 to_precision = 0; | 144 | 229 | UInt32 to_scale = 0; | 145 | | | 146 | 229 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 229 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 229 | const auto* to_decimal_type = | 150 | 229 | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 229 | to_precision = to_decimal_type->get_precision(); | 152 | 229 | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 229 | to_scale = to_decimal_type->get_scale(); | 155 | 229 | ToDataType::check_type_scale(to_scale); | 156 | 229 | } | 157 | 229 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | 229 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | 229 | to_precision = to_max_digits; | 160 | 229 | } | 161 | | | 162 | 229 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 229 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 229 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 229 | if (to_scale > from_scale) { | 167 | 229 | multiply_may_overflow &= | 168 | 229 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 229 | } | 170 | 229 | return narrow_integral || multiply_may_overflow; | 171 | 229 | } | 172 | 229 | return false; | 173 | 229 | }); | 174 | 229 | }; |
function_cast.cpp:_ZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE30EEEvEEEEbRKT_ Line | Count | Source | 110 | 14.9k | auto make_default_wrapper = [&](const auto& types) -> bool { | 111 | 14.9k | using Types = std::decay_t<decltype(types)>; | 112 | 14.9k | using ToDataType = typename Types::LeftType; | 113 | | | 114 | | if constexpr (!(IsDataTypeDecimalOrNumber<ToDataType> || IsDatelikeV1Types<ToDataType> || | 115 | | IsDatelikeV2Types<ToDataType> || | 116 | | std::is_same_v<ToDataType, DataTypeTimeV2>)) { | 117 | | return false; | 118 | | } | 119 | 14.9k | return call_on_index_and_data_type< | 120 | 14.9k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 14.9k | using Types2 = std::decay_t<decltype(types2)>; | 122 | 14.9k | using FromDataType = typename Types2::LeftType; | 123 | 14.9k | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | 14.9k | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | 14.9k | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | 14.9k | return false; | 127 | 14.9k | } | 128 | 14.9k | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 14.9k | using FromFieldType = typename FromDataType::FieldType; | 130 | 14.9k | using ToFieldType = typename ToDataType::FieldType; | 131 | 14.9k | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 14.9k | UInt32 from_scale = 0; | 133 | | | 134 | 14.9k | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 14.9k | const auto* from_decimal_type = | 136 | 14.9k | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 14.9k | from_precision = | 138 | 14.9k | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 14.9k | from_scale = from_decimal_type->get_scale(); | 140 | 14.9k | } | 141 | | | 142 | 14.9k | UInt32 to_max_digits = 0; | 143 | 14.9k | UInt32 to_precision = 0; | 144 | 14.9k | UInt32 to_scale = 0; | 145 | | | 146 | 14.9k | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 14.9k | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 14.9k | const auto* to_decimal_type = | 150 | 14.9k | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 14.9k | to_precision = to_decimal_type->get_precision(); | 152 | 14.9k | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 14.9k | to_scale = to_decimal_type->get_scale(); | 155 | 14.9k | ToDataType::check_type_scale(to_scale); | 156 | 14.9k | } | 157 | 14.9k | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | 14.9k | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | 14.9k | to_precision = to_max_digits; | 160 | 14.9k | } | 161 | | | 162 | 14.9k | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 14.9k | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 14.9k | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 14.9k | if (to_scale > from_scale) { | 167 | 14.9k | multiply_may_overflow &= | 168 | 14.9k | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 14.9k | } | 170 | 14.9k | return narrow_integral || multiply_may_overflow; | 171 | 14.9k | } | 172 | 14.9k | return false; | 173 | 14.9k | }); | 174 | 14.9k | }; |
function_cast.cpp:_ZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE35EEEvEEEEbRKT_ Line | Count | Source | 110 | 10.9k | auto make_default_wrapper = [&](const auto& types) -> bool { | 111 | 10.9k | using Types = std::decay_t<decltype(types)>; | 112 | 10.9k | using ToDataType = typename Types::LeftType; | 113 | | | 114 | | if constexpr (!(IsDataTypeDecimalOrNumber<ToDataType> || IsDatelikeV1Types<ToDataType> || | 115 | | IsDatelikeV2Types<ToDataType> || | 116 | | std::is_same_v<ToDataType, DataTypeTimeV2>)) { | 117 | | return false; | 118 | | } | 119 | 10.9k | return call_on_index_and_data_type< | 120 | 10.9k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 10.9k | using Types2 = std::decay_t<decltype(types2)>; | 122 | 10.9k | using FromDataType = typename Types2::LeftType; | 123 | 10.9k | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | 10.9k | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | 10.9k | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | 10.9k | return false; | 127 | 10.9k | } | 128 | 10.9k | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 10.9k | using FromFieldType = typename FromDataType::FieldType; | 130 | 10.9k | using ToFieldType = typename ToDataType::FieldType; | 131 | 10.9k | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 10.9k | UInt32 from_scale = 0; | 133 | | | 134 | 10.9k | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 10.9k | const auto* from_decimal_type = | 136 | 10.9k | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 10.9k | from_precision = | 138 | 10.9k | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 10.9k | from_scale = from_decimal_type->get_scale(); | 140 | 10.9k | } | 141 | | | 142 | 10.9k | UInt32 to_max_digits = 0; | 143 | 10.9k | UInt32 to_precision = 0; | 144 | 10.9k | UInt32 to_scale = 0; | 145 | | | 146 | 10.9k | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 10.9k | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 10.9k | const auto* to_decimal_type = | 150 | 10.9k | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 10.9k | to_precision = to_decimal_type->get_precision(); | 152 | 10.9k | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 10.9k | to_scale = to_decimal_type->get_scale(); | 155 | 10.9k | ToDataType::check_type_scale(to_scale); | 156 | 10.9k | } | 157 | 10.9k | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | 10.9k | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | 10.9k | to_precision = to_max_digits; | 160 | 10.9k | } | 161 | | | 162 | 10.9k | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 10.9k | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 10.9k | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 10.9k | if (to_scale > from_scale) { | 167 | 10.9k | multiply_may_overflow &= | 168 | 10.9k | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 10.9k | } | 170 | 10.9k | return narrow_integral || multiply_may_overflow; | 171 | 10.9k | } | 172 | 10.9k | return false; | 173 | 10.9k | }); | 174 | 10.9k | }; |
function_cast.cpp:_ZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_12DataTypeDateEvEEEEbRKT_ Line | Count | Source | 110 | 31 | auto make_default_wrapper = [&](const auto& types) -> bool { | 111 | 31 | using Types = std::decay_t<decltype(types)>; | 112 | 31 | using ToDataType = typename Types::LeftType; | 113 | | | 114 | | if constexpr (!(IsDataTypeDecimalOrNumber<ToDataType> || IsDatelikeV1Types<ToDataType> || | 115 | | IsDatelikeV2Types<ToDataType> || | 116 | | std::is_same_v<ToDataType, DataTypeTimeV2>)) { | 117 | | return false; | 118 | | } | 119 | 31 | return call_on_index_and_data_type< | 120 | 31 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 31 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 31 | using FromDataType = typename Types2::LeftType; | 123 | 31 | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | 31 | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | 31 | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | 31 | return false; | 127 | 31 | } | 128 | 31 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 31 | using FromFieldType = typename FromDataType::FieldType; | 130 | 31 | using ToFieldType = typename ToDataType::FieldType; | 131 | 31 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 31 | UInt32 from_scale = 0; | 133 | | | 134 | 31 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 31 | const auto* from_decimal_type = | 136 | 31 | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 31 | from_precision = | 138 | 31 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 31 | from_scale = from_decimal_type->get_scale(); | 140 | 31 | } | 141 | | | 142 | 31 | UInt32 to_max_digits = 0; | 143 | 31 | UInt32 to_precision = 0; | 144 | 31 | UInt32 to_scale = 0; | 145 | | | 146 | 31 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 31 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 31 | const auto* to_decimal_type = | 150 | 31 | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 31 | to_precision = to_decimal_type->get_precision(); | 152 | 31 | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 31 | to_scale = to_decimal_type->get_scale(); | 155 | 31 | ToDataType::check_type_scale(to_scale); | 156 | 31 | } | 157 | 31 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | 31 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | 31 | to_precision = to_max_digits; | 160 | 31 | } | 161 | | | 162 | 31 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 31 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 31 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 31 | if (to_scale > from_scale) { | 167 | 31 | multiply_may_overflow &= | 168 | 31 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 31 | } | 170 | 31 | return narrow_integral || multiply_may_overflow; | 171 | 31 | } | 172 | 31 | return false; | 173 | 31 | }); | 174 | 31 | }; |
function_cast.cpp:_ZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeDateV2EvEEEEbRKT_ Line | Count | Source | 110 | 8.88k | auto make_default_wrapper = [&](const auto& types) -> bool { | 111 | 8.88k | using Types = std::decay_t<decltype(types)>; | 112 | 8.88k | using ToDataType = typename Types::LeftType; | 113 | | | 114 | | if constexpr (!(IsDataTypeDecimalOrNumber<ToDataType> || IsDatelikeV1Types<ToDataType> || | 115 | | IsDatelikeV2Types<ToDataType> || | 116 | | std::is_same_v<ToDataType, DataTypeTimeV2>)) { | 117 | | return false; | 118 | | } | 119 | 8.88k | return call_on_index_and_data_type< | 120 | 8.88k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 8.88k | using Types2 = std::decay_t<decltype(types2)>; | 122 | 8.88k | using FromDataType = typename Types2::LeftType; | 123 | 8.88k | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | 8.88k | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | 8.88k | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | 8.88k | return false; | 127 | 8.88k | } | 128 | 8.88k | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 8.88k | using FromFieldType = typename FromDataType::FieldType; | 130 | 8.88k | using ToFieldType = typename ToDataType::FieldType; | 131 | 8.88k | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 8.88k | UInt32 from_scale = 0; | 133 | | | 134 | 8.88k | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 8.88k | const auto* from_decimal_type = | 136 | 8.88k | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 8.88k | from_precision = | 138 | 8.88k | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 8.88k | from_scale = from_decimal_type->get_scale(); | 140 | 8.88k | } | 141 | | | 142 | 8.88k | UInt32 to_max_digits = 0; | 143 | 8.88k | UInt32 to_precision = 0; | 144 | 8.88k | UInt32 to_scale = 0; | 145 | | | 146 | 8.88k | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 8.88k | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 8.88k | const auto* to_decimal_type = | 150 | 8.88k | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 8.88k | to_precision = to_decimal_type->get_precision(); | 152 | 8.88k | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 8.88k | to_scale = to_decimal_type->get_scale(); | 155 | 8.88k | ToDataType::check_type_scale(to_scale); | 156 | 8.88k | } | 157 | 8.88k | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | 8.88k | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | 8.88k | to_precision = to_max_digits; | 160 | 8.88k | } | 161 | | | 162 | 8.88k | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 8.88k | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 8.88k | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 8.88k | if (to_scale > from_scale) { | 167 | 8.88k | multiply_may_overflow &= | 168 | 8.88k | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 8.88k | } | 170 | 8.88k | return narrow_integral || multiply_may_overflow; | 171 | 8.88k | } | 172 | 8.88k | return false; | 173 | 8.88k | }); | 174 | 8.88k | }; |
function_cast.cpp:_ZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_18DataTypeDateTimeV2EvEEEEbRKT_ Line | Count | Source | 110 | 5.27k | auto make_default_wrapper = [&](const auto& types) -> bool { | 111 | 5.27k | using Types = std::decay_t<decltype(types)>; | 112 | 5.27k | using ToDataType = typename Types::LeftType; | 113 | | | 114 | | if constexpr (!(IsDataTypeDecimalOrNumber<ToDataType> || IsDatelikeV1Types<ToDataType> || | 115 | | IsDatelikeV2Types<ToDataType> || | 116 | | std::is_same_v<ToDataType, DataTypeTimeV2>)) { | 117 | | return false; | 118 | | } | 119 | 5.27k | return call_on_index_and_data_type< | 120 | 5.27k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 5.27k | using Types2 = std::decay_t<decltype(types2)>; | 122 | 5.27k | using FromDataType = typename Types2::LeftType; | 123 | 5.27k | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | 5.27k | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | 5.27k | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | 5.27k | return false; | 127 | 5.27k | } | 128 | 5.27k | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 5.27k | using FromFieldType = typename FromDataType::FieldType; | 130 | 5.27k | using ToFieldType = typename ToDataType::FieldType; | 131 | 5.27k | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 5.27k | UInt32 from_scale = 0; | 133 | | | 134 | 5.27k | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 5.27k | const auto* from_decimal_type = | 136 | 5.27k | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 5.27k | from_precision = | 138 | 5.27k | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 5.27k | from_scale = from_decimal_type->get_scale(); | 140 | 5.27k | } | 141 | | | 142 | 5.27k | UInt32 to_max_digits = 0; | 143 | 5.27k | UInt32 to_precision = 0; | 144 | 5.27k | UInt32 to_scale = 0; | 145 | | | 146 | 5.27k | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 5.27k | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 5.27k | const auto* to_decimal_type = | 150 | 5.27k | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 5.27k | to_precision = to_decimal_type->get_precision(); | 152 | 5.27k | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 5.27k | to_scale = to_decimal_type->get_scale(); | 155 | 5.27k | ToDataType::check_type_scale(to_scale); | 156 | 5.27k | } | 157 | 5.27k | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | 5.27k | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | 5.27k | to_precision = to_max_digits; | 160 | 5.27k | } | 161 | | | 162 | 5.27k | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 5.27k | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 5.27k | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 5.27k | if (to_scale > from_scale) { | 167 | 5.27k | multiply_may_overflow &= | 168 | 5.27k | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 5.27k | } | 170 | 5.27k | return narrow_integral || multiply_may_overflow; | 171 | 5.27k | } | 172 | 5.27k | return false; | 173 | 5.27k | }); | 174 | 5.27k | }; |
function_cast.cpp:_ZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_16DataTypeDateTimeEvEEEEbRKT_ Line | Count | Source | 110 | 26 | auto make_default_wrapper = [&](const auto& types) -> bool { | 111 | 26 | using Types = std::decay_t<decltype(types)>; | 112 | 26 | using ToDataType = typename Types::LeftType; | 113 | | | 114 | | if constexpr (!(IsDataTypeDecimalOrNumber<ToDataType> || IsDatelikeV1Types<ToDataType> || | 115 | | IsDatelikeV2Types<ToDataType> || | 116 | | std::is_same_v<ToDataType, DataTypeTimeV2>)) { | 117 | | return false; | 118 | | } | 119 | 26 | return call_on_index_and_data_type< | 120 | 26 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 26 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 26 | using FromDataType = typename Types2::LeftType; | 123 | 26 | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | 26 | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | 26 | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | 26 | return false; | 127 | 26 | } | 128 | 26 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 26 | using FromFieldType = typename FromDataType::FieldType; | 130 | 26 | using ToFieldType = typename ToDataType::FieldType; | 131 | 26 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 26 | UInt32 from_scale = 0; | 133 | | | 134 | 26 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 26 | const auto* from_decimal_type = | 136 | 26 | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 26 | from_precision = | 138 | 26 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 26 | from_scale = from_decimal_type->get_scale(); | 140 | 26 | } | 141 | | | 142 | 26 | UInt32 to_max_digits = 0; | 143 | 26 | UInt32 to_precision = 0; | 144 | 26 | UInt32 to_scale = 0; | 145 | | | 146 | 26 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 26 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 26 | const auto* to_decimal_type = | 150 | 26 | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 26 | to_precision = to_decimal_type->get_precision(); | 152 | 26 | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 26 | to_scale = to_decimal_type->get_scale(); | 155 | 26 | ToDataType::check_type_scale(to_scale); | 156 | 26 | } | 157 | 26 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | 26 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | 26 | to_precision = to_max_digits; | 160 | 26 | } | 161 | | | 162 | 26 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 26 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 26 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 26 | if (to_scale > from_scale) { | 167 | 26 | multiply_may_overflow &= | 168 | 26 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 26 | } | 170 | 26 | return narrow_integral || multiply_may_overflow; | 171 | 26 | } | 172 | 26 | return false; | 173 | 26 | }); | 174 | 26 | }; |
function_cast.cpp:_ZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeTimeV2EvEEEEbRKT_ Line | Count | Source | 110 | 460 | auto make_default_wrapper = [&](const auto& types) -> bool { | 111 | 460 | using Types = std::decay_t<decltype(types)>; | 112 | 460 | using ToDataType = typename Types::LeftType; | 113 | | | 114 | | if constexpr (!(IsDataTypeDecimalOrNumber<ToDataType> || IsDatelikeV1Types<ToDataType> || | 115 | | IsDatelikeV2Types<ToDataType> || | 116 | | std::is_same_v<ToDataType, DataTypeTimeV2>)) { | 117 | | return false; | 118 | | } | 119 | 460 | return call_on_index_and_data_type< | 120 | 460 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 460 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 460 | using FromDataType = typename Types2::LeftType; | 123 | 460 | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | 460 | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | 460 | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | 460 | return false; | 127 | 460 | } | 128 | 460 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 460 | using FromFieldType = typename FromDataType::FieldType; | 130 | 460 | using ToFieldType = typename ToDataType::FieldType; | 131 | 460 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 460 | UInt32 from_scale = 0; | 133 | | | 134 | 460 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 460 | const auto* from_decimal_type = | 136 | 460 | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 460 | from_precision = | 138 | 460 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 460 | from_scale = from_decimal_type->get_scale(); | 140 | 460 | } | 141 | | | 142 | 460 | UInt32 to_max_digits = 0; | 143 | 460 | UInt32 to_precision = 0; | 144 | 460 | UInt32 to_scale = 0; | 145 | | | 146 | 460 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 460 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 460 | const auto* to_decimal_type = | 150 | 460 | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 460 | to_precision = to_decimal_type->get_precision(); | 152 | 460 | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 460 | to_scale = to_decimal_type->get_scale(); | 155 | 460 | ToDataType::check_type_scale(to_scale); | 156 | 460 | } | 157 | 460 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | 460 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | 460 | to_precision = to_max_digits; | 160 | 460 | } | 161 | | | 162 | 460 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 460 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 460 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 460 | if (to_scale > from_scale) { | 167 | 460 | multiply_may_overflow &= | 168 | 460 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 460 | } | 170 | 460 | return narrow_integral || multiply_may_overflow; | 171 | 460 | } | 172 | 460 | return false; | 173 | 460 | }); | 174 | 460 | }; |
function_cast.cpp:_ZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_19DataTypeTimeStampTzEvEEEEbRKT_ Line | Count | Source | 110 | 509 | auto make_default_wrapper = [&](const auto& types) -> bool { | 111 | 509 | using Types = std::decay_t<decltype(types)>; | 112 | 509 | using ToDataType = typename Types::LeftType; | 113 | | | 114 | | if constexpr (!(IsDataTypeDecimalOrNumber<ToDataType> || IsDatelikeV1Types<ToDataType> || | 115 | | IsDatelikeV2Types<ToDataType> || | 116 | 509 | std::is_same_v<ToDataType, DataTypeTimeV2>)) { | 117 | 509 | return false; | 118 | 509 | } | 119 | 0 | return call_on_index_and_data_type< | 120 | 509 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 509 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 509 | using FromDataType = typename Types2::LeftType; | 123 | 509 | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | 509 | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | 509 | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | 509 | return false; | 127 | 509 | } | 128 | 509 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 509 | using FromFieldType = typename FromDataType::FieldType; | 130 | 509 | using ToFieldType = typename ToDataType::FieldType; | 131 | 509 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 509 | UInt32 from_scale = 0; | 133 | | | 134 | 509 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 509 | const auto* from_decimal_type = | 136 | 509 | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 509 | from_precision = | 138 | 509 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 509 | from_scale = from_decimal_type->get_scale(); | 140 | 509 | } | 141 | | | 142 | 509 | UInt32 to_max_digits = 0; | 143 | 509 | UInt32 to_precision = 0; | 144 | 509 | UInt32 to_scale = 0; | 145 | | | 146 | 509 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 509 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 509 | const auto* to_decimal_type = | 150 | 509 | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 509 | to_precision = to_decimal_type->get_precision(); | 152 | 509 | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 509 | to_scale = to_decimal_type->get_scale(); | 155 | 509 | ToDataType::check_type_scale(to_scale); | 156 | 509 | } | 157 | 509 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | 509 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | 509 | to_precision = to_max_digits; | 160 | 509 | } | 161 | | | 162 | 509 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 509 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 509 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 509 | if (to_scale > from_scale) { | 167 | 509 | multiply_may_overflow &= | 168 | 509 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 509 | } | 170 | 509 | return narrow_integral || multiply_may_overflow; | 171 | 509 | } | 172 | 509 | return false; | 173 | 509 | }); | 174 | 509 | }; |
function_cast.cpp:_ZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_12DataTypeIPv4EvEEEEbRKT_ Line | Count | Source | 110 | 656 | auto make_default_wrapper = [&](const auto& types) -> bool { | 111 | 656 | using Types = std::decay_t<decltype(types)>; | 112 | 656 | using ToDataType = typename Types::LeftType; | 113 | | | 114 | | if constexpr (!(IsDataTypeDecimalOrNumber<ToDataType> || IsDatelikeV1Types<ToDataType> || | 115 | | IsDatelikeV2Types<ToDataType> || | 116 | 656 | std::is_same_v<ToDataType, DataTypeTimeV2>)) { | 117 | 656 | return false; | 118 | 656 | } | 119 | 0 | return call_on_index_and_data_type< | 120 | 656 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 656 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 656 | using FromDataType = typename Types2::LeftType; | 123 | 656 | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | 656 | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | 656 | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | 656 | return false; | 127 | 656 | } | 128 | 656 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 656 | using FromFieldType = typename FromDataType::FieldType; | 130 | 656 | using ToFieldType = typename ToDataType::FieldType; | 131 | 656 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 656 | UInt32 from_scale = 0; | 133 | | | 134 | 656 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 656 | const auto* from_decimal_type = | 136 | 656 | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 656 | from_precision = | 138 | 656 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 656 | from_scale = from_decimal_type->get_scale(); | 140 | 656 | } | 141 | | | 142 | 656 | UInt32 to_max_digits = 0; | 143 | 656 | UInt32 to_precision = 0; | 144 | 656 | UInt32 to_scale = 0; | 145 | | | 146 | 656 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 656 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 656 | const auto* to_decimal_type = | 150 | 656 | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 656 | to_precision = to_decimal_type->get_precision(); | 152 | 656 | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 656 | to_scale = to_decimal_type->get_scale(); | 155 | 656 | ToDataType::check_type_scale(to_scale); | 156 | 656 | } | 157 | 656 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | 656 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | 656 | to_precision = to_max_digits; | 160 | 656 | } | 161 | | | 162 | 656 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 656 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 656 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 656 | if (to_scale > from_scale) { | 167 | 656 | multiply_may_overflow &= | 168 | 656 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 656 | } | 170 | 656 | return narrow_integral || multiply_may_overflow; | 171 | 656 | } | 172 | 656 | return false; | 173 | 656 | }); | 174 | 656 | }; |
function_cast.cpp:_ZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_12DataTypeIPv6EvEEEEbRKT_ Line | Count | Source | 110 | 300 | auto make_default_wrapper = [&](const auto& types) -> bool { | 111 | 300 | using Types = std::decay_t<decltype(types)>; | 112 | 300 | using ToDataType = typename Types::LeftType; | 113 | | | 114 | | if constexpr (!(IsDataTypeDecimalOrNumber<ToDataType> || IsDatelikeV1Types<ToDataType> || | 115 | | IsDatelikeV2Types<ToDataType> || | 116 | 300 | std::is_same_v<ToDataType, DataTypeTimeV2>)) { | 117 | 300 | return false; | 118 | 300 | } | 119 | 0 | return call_on_index_and_data_type< | 120 | 300 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 300 | using Types2 = std::decay_t<decltype(types2)>; | 122 | 300 | using FromDataType = typename Types2::LeftType; | 123 | 300 | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | 300 | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | 300 | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | 300 | return false; | 127 | 300 | } | 128 | 300 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 300 | using FromFieldType = typename FromDataType::FieldType; | 130 | 300 | using ToFieldType = typename ToDataType::FieldType; | 131 | 300 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 300 | UInt32 from_scale = 0; | 133 | | | 134 | 300 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 300 | const auto* from_decimal_type = | 136 | 300 | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 300 | from_precision = | 138 | 300 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 300 | from_scale = from_decimal_type->get_scale(); | 140 | 300 | } | 141 | | | 142 | 300 | UInt32 to_max_digits = 0; | 143 | 300 | UInt32 to_precision = 0; | 144 | 300 | UInt32 to_scale = 0; | 145 | | | 146 | 300 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 300 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 300 | const auto* to_decimal_type = | 150 | 300 | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 300 | to_precision = to_decimal_type->get_precision(); | 152 | 300 | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 300 | to_scale = to_decimal_type->get_scale(); | 155 | 300 | ToDataType::check_type_scale(to_scale); | 156 | 300 | } | 157 | 300 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | 300 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | 300 | to_precision = to_max_digits; | 160 | 300 | } | 161 | | | 162 | 300 | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 300 | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 300 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 300 | if (to_scale > from_scale) { | 167 | 300 | multiply_may_overflow &= | 168 | 300 | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 300 | } | 170 | 300 | return narrow_integral || multiply_may_overflow; | 171 | 300 | } | 172 | 300 | return false; | 173 | 300 | }); | 174 | 300 | }; |
function_cast.cpp:_ZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeStringEvEEEEbRKT_ Line | Count | Source | 110 | 35.1k | auto make_default_wrapper = [&](const auto& types) -> bool { | 111 | 35.1k | using Types = std::decay_t<decltype(types)>; | 112 | 35.1k | using ToDataType = typename Types::LeftType; | 113 | | | 114 | | if constexpr (!(IsDataTypeDecimalOrNumber<ToDataType> || IsDatelikeV1Types<ToDataType> || | 115 | | IsDatelikeV2Types<ToDataType> || | 116 | 35.1k | std::is_same_v<ToDataType, DataTypeTimeV2>)) { | 117 | 35.1k | return false; | 118 | 35.1k | } | 119 | 0 | return call_on_index_and_data_type< | 120 | 35.1k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 121 | 35.1k | using Types2 = std::decay_t<decltype(types2)>; | 122 | 35.1k | using FromDataType = typename Types2::LeftType; | 123 | 35.1k | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 124 | 35.1k | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 125 | 35.1k | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 126 | 35.1k | return false; | 127 | 35.1k | } | 128 | 35.1k | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 129 | 35.1k | using FromFieldType = typename FromDataType::FieldType; | 130 | 35.1k | using ToFieldType = typename ToDataType::FieldType; | 131 | 35.1k | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 132 | 35.1k | UInt32 from_scale = 0; | 133 | | | 134 | 35.1k | if constexpr (IsDataTypeDecimal<FromDataType>) { | 135 | 35.1k | const auto* from_decimal_type = | 136 | 35.1k | check_and_get_data_type<FromDataType>(from_type.get()); | 137 | 35.1k | from_precision = | 138 | 35.1k | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 139 | 35.1k | from_scale = from_decimal_type->get_scale(); | 140 | 35.1k | } | 141 | | | 142 | 35.1k | UInt32 to_max_digits = 0; | 143 | 35.1k | UInt32 to_precision = 0; | 144 | 35.1k | UInt32 to_scale = 0; | 145 | | | 146 | 35.1k | if constexpr (IsDataTypeDecimal<ToDataType>) { | 147 | 35.1k | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 148 | | | 149 | 35.1k | const auto* to_decimal_type = | 150 | 35.1k | check_and_get_data_type<ToDataType>(to_type.get()); | 151 | 35.1k | to_precision = to_decimal_type->get_precision(); | 152 | 35.1k | ToDataType::check_type_precision(to_precision); | 153 | | | 154 | 35.1k | to_scale = to_decimal_type->get_scale(); | 155 | 35.1k | ToDataType::check_type_scale(to_scale); | 156 | 35.1k | } | 157 | 35.1k | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 158 | 35.1k | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 159 | 35.1k | to_precision = to_max_digits; | 160 | 35.1k | } | 161 | | | 162 | 35.1k | bool narrow_integral = context->check_overflow_for_decimal() && | 163 | 35.1k | (to_precision - to_scale) <= (from_precision - from_scale); | 164 | | | 165 | 35.1k | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 166 | 35.1k | if (to_scale > from_scale) { | 167 | 35.1k | multiply_may_overflow &= | 168 | 35.1k | (from_precision + to_scale - from_scale) >= to_max_digits; | 169 | 35.1k | } | 170 | 35.1k | return narrow_integral || multiply_may_overflow; | 171 | 35.1k | } | 172 | 35.1k | return false; | 173 | 35.1k | }); | 174 | 35.1k | }; |
|
175 | | |
176 | 330k | return call_on_index_and_data_type<void>(to_type->get_primitive_type(), make_default_wrapper); |
177 | 410k | } |
178 | | |
179 | | WrapperType prepare_remove_nullable(FunctionContext* context, const DataTypePtr& from_type, |
180 | 440k | const DataTypePtr& to_type) { |
181 | | /// Determine whether pre-processing and/or post-processing must take place during conversion. |
182 | 440k | bool result_is_nullable = to_type->is_nullable(); |
183 | | |
184 | 440k | if (result_is_nullable) { |
185 | 410k | return [from_type, to_type](FunctionContext* context, Block& block, |
186 | 410k | const ColumnNumbers& arguments, uint32_t result, |
187 | 410k | size_t input_rows_count, |
188 | 410k | const NullMap::value_type* null_map = nullptr) { |
189 | 410k | auto from_type_not_nullable = remove_nullable(from_type); |
190 | 410k | auto to_type_not_nullable = remove_nullable(to_type); |
191 | | |
192 | 410k | bool replace_null_data_to_default = need_replace_null_data_to_default( |
193 | 410k | context, from_type_not_nullable, to_type_not_nullable); |
194 | | |
195 | 410k | auto nested_result_index = block.columns(); |
196 | 410k | block.insert(block.get_by_position(result).unnest_nullable()); |
197 | 410k | auto nested_source_index = block.columns(); |
198 | 410k | block.insert(block.get_by_position(arguments[0]) |
199 | 410k | .unnest_nullable(replace_null_data_to_default)); |
200 | | |
201 | 410k | const auto& arg_col = block.get_by_position(arguments[0]); |
202 | 410k | const NullMap::value_type* arg_null_map = nullptr; |
203 | 410k | if (const auto* nullable = check_and_get_column<ColumnNullable>(*arg_col.column)) { |
204 | 364k | arg_null_map = nullable->get_null_map_data().data(); |
205 | 364k | } |
206 | 410k | RETURN_IF_ERROR(prepare_impl(context, from_type_not_nullable, to_type_not_nullable)( |
207 | 410k | context, block, {nested_source_index}, nested_result_index, input_rows_count, |
208 | 410k | arg_null_map)); |
209 | | |
210 | 385k | block.get_by_position(result).column = |
211 | 385k | wrap_in_nullable(block.get_by_position(nested_result_index).column, block, |
212 | 385k | arguments, input_rows_count); |
213 | | |
214 | 385k | block.erase(nested_source_index); |
215 | 385k | block.erase(nested_result_index); |
216 | 385k | return Status::OK(); |
217 | 410k | }; |
218 | 410k | } else { |
219 | 29.8k | return prepare_impl(context, from_type, to_type); |
220 | 29.8k | } |
221 | 440k | } |
222 | | |
223 | | /// 'from_type' and 'to_type' are nested types in case of Nullable. |
224 | | /// 'requested_result_is_nullable' is true if CAST to Nullable type is requested. |
225 | | WrapperType prepare_impl(FunctionContext* context, const DataTypePtr& origin_from_type, |
226 | 463k | const DataTypePtr& origin_to_type) { |
227 | 463k | auto to_type = get_serialized_type(origin_to_type); |
228 | 463k | auto from_type = get_serialized_type(origin_from_type); |
229 | 463k | if (from_type->equals(*to_type)) { |
230 | 93.4k | return create_identity_wrapper(from_type); |
231 | 93.4k | } |
232 | | |
233 | | // variant needs to be judged first |
234 | 369k | if (to_type->get_primitive_type() == PrimitiveType::TYPE_VARIANT) { |
235 | 11.8k | return create_cast_to_variant_wrapper(from_type, |
236 | 11.8k | static_cast<const DataTypeVariant&>(*to_type)); |
237 | 11.8k | } |
238 | 358k | if (from_type->get_primitive_type() == PrimitiveType::TYPE_VARIANT) { |
239 | 24.6k | return create_cast_from_variant_wrapper(static_cast<const DataTypeVariant&>(*from_type), |
240 | 24.6k | to_type); |
241 | 24.6k | } |
242 | | |
243 | 333k | if (from_type->get_primitive_type() == PrimitiveType::TYPE_JSONB) { |
244 | 9.39k | return create_cast_from_jsonb_wrapper(static_cast<const DataTypeJsonb&>(*from_type), |
245 | 9.39k | to_type, |
246 | 18.4E | context ? context->jsonb_string_as_string() : false); |
247 | 9.39k | } |
248 | | |
249 | 324k | switch (to_type->get_primitive_type()) { |
250 | 1.09k | case PrimitiveType::TYPE_BOOLEAN: |
251 | 1.09k | return create_boolean_wrapper(context, from_type); |
252 | 7.74k | case PrimitiveType::TYPE_TINYINT: |
253 | 13.4k | case PrimitiveType::TYPE_SMALLINT: |
254 | 47.6k | case PrimitiveType::TYPE_INT: |
255 | 95.2k | case PrimitiveType::TYPE_BIGINT: |
256 | 100k | case PrimitiveType::TYPE_LARGEINT: |
257 | 100k | return create_int_wrapper(context, from_type, to_type->get_primitive_type()); |
258 | 11.0k | case PrimitiveType::TYPE_FLOAT: |
259 | 41.1k | case PrimitiveType::TYPE_DOUBLE: |
260 | 41.1k | return create_float_wrapper(context, from_type, to_type->get_primitive_type()); |
261 | 31 | case PrimitiveType::TYPE_DATE: |
262 | 57 | case PrimitiveType::TYPE_DATETIME: |
263 | 8.99k | case PrimitiveType::TYPE_DATEV2: |
264 | 14.6k | case PrimitiveType::TYPE_DATETIMEV2: |
265 | 15.0k | case PrimitiveType::TYPE_TIMEV2: |
266 | 15.0k | return create_datelike_wrapper(context, from_type, to_type->get_primitive_type()); |
267 | 509 | case PrimitiveType::TYPE_TIMESTAMPTZ: |
268 | 509 | return create_timestamptz_wrapper(context, from_type); |
269 | 490 | case PrimitiveType::TYPE_IPV4: |
270 | 791 | case PrimitiveType::TYPE_IPV6: |
271 | 791 | return create_ip_wrapper(context, from_type, to_type->get_primitive_type()); |
272 | 293 | case PrimitiveType::TYPE_DECIMALV2: |
273 | 8.43k | case PrimitiveType::TYPE_DECIMAL32: |
274 | 32.6k | case PrimitiveType::TYPE_DECIMAL64: |
275 | 50.8k | case PrimitiveType::TYPE_DECIMAL128I: |
276 | 61.9k | case PrimitiveType::TYPE_DECIMAL256: |
277 | 61.9k | return create_decimal_wrapper(context, from_type, to_type->get_primitive_type()); |
278 | 20 | case PrimitiveType::TYPE_CHAR: |
279 | 8.50k | case PrimitiveType::TYPE_VARCHAR: |
280 | 30.0k | case PrimitiveType::TYPE_STRING: |
281 | 30.0k | return create_string_wrapper(from_type); |
282 | 7.92k | case PrimitiveType::TYPE_ARRAY: |
283 | 7.92k | return create_array_wrapper(context, from_type, |
284 | 7.92k | static_cast<const DataTypeArray&>(*to_type)); |
285 | 3.14k | case PrimitiveType::TYPE_STRUCT: |
286 | 3.14k | return create_struct_wrapper(context, from_type, |
287 | 3.14k | static_cast<const DataTypeStruct&>(*to_type)); |
288 | 2.98k | case PrimitiveType::TYPE_MAP: |
289 | 2.98k | return create_map_wrapper(context, from_type, static_cast<const DataTypeMap&>(*to_type)); |
290 | 6 | case PrimitiveType::TYPE_HLL: |
291 | 6 | return create_hll_wrapper(context, from_type, static_cast<const DataTypeHLL&>(*to_type)); |
292 | 5 | case PrimitiveType::TYPE_BITMAP: |
293 | 5 | return create_bitmap_wrapper(context, from_type, |
294 | 5 | static_cast<const DataTypeBitMap&>(*to_type)); |
295 | 2 | case PrimitiveType::TYPE_QUANTILE_STATE: |
296 | 2 | return create_quantile_state_wrapper(context, from_type, |
297 | 2 | static_cast<const DataTypeQuantileState&>(*to_type)); |
298 | 59.1k | case PrimitiveType::TYPE_JSONB: |
299 | 59.1k | return create_cast_to_jsonb_wrapper(from_type, static_cast<const DataTypeJsonb&>(*to_type), |
300 | 59.1k | context ? context->string_as_jsonb_string() : false); |
301 | 2 | case PrimitiveType::TYPE_VARBINARY: |
302 | 2 | return create_varbinary_wrapper(from_type); |
303 | 0 | default: |
304 | 0 | break; |
305 | 324k | } |
306 | | |
307 | 0 | return create_unsupport_wrapper(from_type->get_name(), to_type->get_name()); |
308 | 324k | } |
309 | | |
310 | | } // namespace CastWrapper |
311 | | |
312 | | class PreparedFunctionCast : public PreparedFunctionImpl { |
313 | | public: |
314 | | explicit PreparedFunctionCast(CastWrapper::WrapperType&& wrapper_function_, const char* name_) |
315 | 426k | : wrapper_function(std::move(wrapper_function_)), name(name_) {} |
316 | | |
317 | 0 | String get_name() const override { return name; } |
318 | | |
319 | | protected: |
320 | | Status execute_impl(FunctionContext* context, Block& block, const ColumnNumbers& arguments, |
321 | 425k | uint32_t result, size_t input_rows_count) const override { |
322 | 425k | return wrapper_function(context, block, arguments, result, input_rows_count, nullptr); |
323 | 425k | } |
324 | | |
325 | 426k | bool use_default_implementation_for_nulls() const override { return false; } |
326 | 426k | ColumnNumbers get_arguments_that_are_always_constant() const override { return {1}; } |
327 | | |
328 | | private: |
329 | | CastWrapper::WrapperType wrapper_function; |
330 | | const char* name; |
331 | | }; |
332 | | |
333 | | class FunctionCast final : public IFunctionBase { |
334 | | public: |
335 | | FunctionCast(const char* name_, DataTypes argument_types_, DataTypePtr return_type_) |
336 | 306k | : name(name_), |
337 | 306k | argument_types(std::move(argument_types_)), |
338 | 306k | return_type(std::move(return_type_)) {} |
339 | | |
340 | 426k | const DataTypes& get_argument_types() const override { return argument_types; } |
341 | 426k | const DataTypePtr& get_return_type() const override { return return_type; } |
342 | | |
343 | | PreparedFunctionPtr prepare(FunctionContext* context, const Block& /*sample_block*/, |
344 | | const ColumnNumbers& /*arguments*/, |
345 | 426k | uint32_t /*result*/) const override { |
346 | 426k | return std::make_shared<PreparedFunctionCast>( |
347 | 426k | CastWrapper::prepare_unpack_dictionaries(context, get_argument_types()[0], |
348 | 426k | get_return_type()), |
349 | 426k | name); |
350 | 426k | } |
351 | | |
352 | 0 | String get_name() const override { return name; } |
353 | | |
354 | 0 | bool is_use_default_implementation_for_constants() const override { return true; } |
355 | | |
356 | | private: |
357 | | const char* name = nullptr; |
358 | | |
359 | | DataTypes argument_types; |
360 | | DataTypePtr return_type; |
361 | | }; |
362 | | |
363 | | class FunctionBuilderCast : public FunctionBuilderImpl { |
364 | | public: |
365 | | static constexpr auto name = "CAST"; |
366 | 306k | static FunctionBuilderPtr create() { return std::make_shared<FunctionBuilderCast>(); } |
367 | | |
368 | 306k | FunctionBuilderCast() = default; |
369 | | |
370 | 1 | String get_name() const override { return name; } |
371 | | |
372 | 0 | size_t get_number_of_arguments() const override { return 2; } |
373 | | |
374 | 0 | ColumnNumbers get_arguments_that_are_always_constant() const override { return {1}; } |
375 | | |
376 | | protected: |
377 | | FunctionBasePtr build_impl(const ColumnsWithTypeAndName& arguments, |
378 | 306k | const DataTypePtr& return_type) const override { |
379 | 306k | DataTypes data_types(arguments.size()); |
380 | | |
381 | 919k | for (size_t i = 0; i < arguments.size(); ++i) { |
382 | 612k | data_types[i] = arguments[i].type; |
383 | 612k | } |
384 | | |
385 | 306k | return std::make_shared<FunctionCast>(name, data_types, return_type); |
386 | 306k | } |
387 | | |
388 | 306k | bool skip_return_type_check() const override { return true; } |
389 | 0 | DataTypePtr get_return_type_impl(const ColumnsWithTypeAndName& arguments) const override { |
390 | 0 | return nullptr; |
391 | 0 | } |
392 | | |
393 | 0 | bool use_default_implementation_for_nulls() const override { return false; } |
394 | | }; |
395 | | |
396 | 8 | void register_function_cast(SimpleFunctionFactory& factory) { |
397 | 8 | factory.register_function<FunctionBuilderCast>(); |
398 | 8 | } |
399 | | } // namespace doris |