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/data_type_variant.h" |
25 | | #include "core/data_type/data_type_variant_v2.h" |
26 | | #include "core/data_type/primitive_type.h" |
27 | | #include "exprs/function/cast/cast_to_array.h" |
28 | | #include "exprs/function/cast/cast_to_jsonb.h" |
29 | | #include "exprs/function/cast/cast_to_map.h" |
30 | | #include "exprs/function/cast/cast_to_struct.h" |
31 | | #include "exprs/function/cast/cast_to_variant.h" |
32 | | #include "exprs/function/cast/cast_wrapper_decls.h" |
33 | | #include "exprs/function/cast/variant_v2/cast_variant_v2.h" |
34 | | #include "exprs/function/simple_function_factory.h" |
35 | | |
36 | | namespace doris { |
37 | | |
38 | | namespace CastWrapper { |
39 | | |
40 | | WrapperType create_hll_wrapper(FunctionContext* context, const DataTypePtr& from_type_untyped, |
41 | 6 | const DataTypeHLL& to_type) { |
42 | | /// Conversion from String through parsing. |
43 | 6 | if (check_and_get_data_type<DataTypeString>(from_type_untyped.get())) { |
44 | 6 | return cast_from_string_to_generic; |
45 | 6 | } |
46 | | |
47 | 0 | return CastWrapper::create_unsupport_wrapper("Cast to HLL only support from String type"); |
48 | 6 | } |
49 | | |
50 | | WrapperType create_bitmap_wrapper(FunctionContext* context, const DataTypePtr& from_type_untyped, |
51 | 5 | const DataTypeBitMap& to_type) { |
52 | | /// Conversion from String through parsing. |
53 | 5 | if (check_and_get_data_type<DataTypeString>(from_type_untyped.get())) { |
54 | 5 | return cast_from_string_to_generic; |
55 | 5 | } |
56 | | |
57 | 0 | return CastWrapper::create_unsupport_wrapper("Cast to BitMap only support from String type"); |
58 | 5 | } |
59 | | |
60 | | WrapperType create_quantile_state_wrapper(FunctionContext* context, |
61 | | const DataTypePtr& from_type_untyped, |
62 | 2 | const DataTypeQuantileState& to_type) { |
63 | | /// Conversion from String through parsing. |
64 | 2 | if (check_and_get_data_type<DataTypeString>(from_type_untyped.get())) { |
65 | 2 | return cast_from_string_to_generic; |
66 | 2 | } |
67 | | |
68 | 0 | return CastWrapper::create_unsupport_wrapper( |
69 | 0 | "Cast to QuantileState only support from String type"); |
70 | 2 | } |
71 | | |
72 | 316 | WrapperType create_varbinary_wrapper(const DataTypePtr& from_type_untyped) { |
73 | | /// Conversion from String through parsing. |
74 | 316 | if (check_and_get_data_type<DataTypeString>(from_type_untyped.get())) { |
75 | 316 | return cast_from_string_to_generic; |
76 | 316 | } |
77 | | |
78 | 0 | return CastWrapper::create_unsupport_wrapper("Cast to Varbinary only support from String type"); |
79 | 316 | } |
80 | | |
81 | | WrapperType prepare_unpack_dictionaries(FunctionContext* context, const DataTypePtr& from_type, |
82 | 1.47M | const DataTypePtr& to_type) { |
83 | 1.47M | const auto& from_nested = from_type; |
84 | 1.47M | const auto& to_nested = to_type; |
85 | | |
86 | 1.47M | if (from_type->is_null_literal()) { |
87 | 2.20k | if (!to_nested->is_nullable()) { |
88 | 0 | return CastWrapper::create_unsupport_wrapper( |
89 | 0 | "Cannot convert NULL to a non-nullable type"); |
90 | 0 | } |
91 | | |
92 | 2.20k | return [](FunctionContext* context, Block& block, const ColumnNumbers&, uint32_t result, |
93 | 2.20k | size_t input_rows_count, const NullMap::value_type* null_map = nullptr) { |
94 | | /// TODO: remove this in the future. |
95 | 2.20k | auto& res = block.get_by_position(result); |
96 | 2.20k | res.column = res.type->create_column_const_with_default_value(input_rows_count) |
97 | 2.20k | ->convert_to_full_column_if_const(); |
98 | 2.20k | return Status::OK(); |
99 | 2.20k | }; |
100 | 2.20k | } |
101 | | |
102 | 1.47M | auto wrapper = prepare_remove_nullable(context, from_nested, to_nested); |
103 | | |
104 | 1.47M | return wrapper; |
105 | 1.47M | } |
106 | | |
107 | | bool need_replace_null_data_to_default(FunctionContext* context, const DataTypePtr& from_type, |
108 | 1.43M | const DataTypePtr& to_type) { |
109 | 1.43M | if (from_type->equals(*to_type)) { |
110 | 92.6k | return false; |
111 | 92.6k | } |
112 | | |
113 | 1.34M | auto make_default_wrapper = [&](const auto& types) -> bool { |
114 | 1.11M | using Types = std::decay_t<decltype(types)>; |
115 | 1.11M | using ToDataType = typename Types::LeftType; |
116 | | |
117 | | if constexpr (!(IsDataTypeDecimalOrNumber<ToDataType> || IsDatelikeV1Types<ToDataType> || |
118 | | IsDatelikeV2Types<ToDataType> || |
119 | 309k | std::is_same_v<ToDataType, DataTypeTimeV2>)) { |
120 | 309k | return false; |
121 | 309k | } |
122 | 0 | return call_on_index_and_data_type< |
123 | 1.11M | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { |
124 | 785k | using Types2 = std::decay_t<decltype(types2)>; |
125 | 785k | using FromDataType = typename Types2::LeftType; |
126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || |
127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || |
128 | 554k | std::is_same_v<FromDataType, DataTypeTimeV2>)) { |
129 | 554k | return false; |
130 | 554k | } |
131 | 216k | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { |
132 | 216k | using FromFieldType = typename FromDataType::FieldType; |
133 | 216k | using ToFieldType = typename ToDataType::FieldType; |
134 | 216k | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); |
135 | 216k | UInt32 from_scale = 0; |
136 | | |
137 | 216k | if constexpr (IsDataTypeDecimal<FromDataType>) { |
138 | 44.8k | const auto* from_decimal_type = |
139 | 44.8k | check_and_get_data_type<FromDataType>(from_type.get()); |
140 | 44.8k | from_precision = |
141 | 44.8k | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); |
142 | 44.8k | from_scale = from_decimal_type->get_scale(); |
143 | 44.8k | } |
144 | | |
145 | 216k | UInt32 to_max_digits = 0; |
146 | 216k | UInt32 to_precision = 0; |
147 | 216k | UInt32 to_scale = 0; |
148 | | |
149 | 216k | if constexpr (IsDataTypeDecimal<ToDataType>) { |
150 | 210k | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); |
151 | | |
152 | 210k | const auto* to_decimal_type = |
153 | 210k | check_and_get_data_type<ToDataType>(to_type.get()); |
154 | 210k | to_precision = to_decimal_type->get_precision(); |
155 | 210k | ToDataType::check_type_precision(to_precision); |
156 | | |
157 | 210k | to_scale = to_decimal_type->get_scale(); |
158 | 210k | ToDataType::check_type_scale(to_scale); |
159 | 210k | } |
160 | 216k | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { |
161 | 6.18k | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); |
162 | 6.18k | to_precision = to_max_digits; |
163 | 6.18k | } |
164 | | |
165 | 216k | bool narrow_integral = context->check_overflow_for_decimal() && |
166 | 216k | (to_precision - to_scale) <= (from_precision - from_scale); |
167 | | |
168 | 216k | bool multiply_may_overflow = context->check_overflow_for_decimal(); |
169 | 216k | if (to_scale > from_scale) { |
170 | 12.3k | multiply_may_overflow &= |
171 | 12.3k | (from_precision + to_scale - from_scale) >= to_max_digits; |
172 | 12.3k | } |
173 | 216k | return narrow_integral || multiply_may_overflow; |
174 | 216k | } |
175 | 0 | return false; |
176 | 785k | }); 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 | 123 | 20 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 20 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 20 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 20 | return false; | 176 | 20 | }); |
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 | 123 | 17 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 17 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 17 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 17 | return false; | 176 | 17 | }); |
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 | 123 | 32 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 32 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 32 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 32 | return false; | 176 | 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 | 123 | 93 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 93 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 93 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 93 | return false; | 176 | 93 | }); |
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 | 123 | 7 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 7 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 7 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 7 | return false; | 176 | 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 | 123 | 2 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 2 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 2 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 2 | return false; | 176 | 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 | 123 | 7 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 7 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 7 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 7 | return false; | 176 | 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 | 123 | 10 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 10 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 10 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 10 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 10 | using FromFieldType = typename FromDataType::FieldType; | 133 | 10 | using ToFieldType = typename ToDataType::FieldType; | 134 | 10 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 10 | UInt32 from_scale = 0; | 136 | | | 137 | 10 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 10 | const auto* from_decimal_type = | 139 | 10 | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 10 | from_precision = | 141 | 10 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 10 | from_scale = from_decimal_type->get_scale(); | 143 | 10 | } | 144 | | | 145 | 10 | UInt32 to_max_digits = 0; | 146 | 10 | UInt32 to_precision = 0; | 147 | 10 | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | 10 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | 10 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | 10 | to_precision = to_max_digits; | 163 | 10 | } | 164 | | | 165 | 10 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 10 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 10 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 10 | if (to_scale > from_scale) { | 170 | 0 | multiply_may_overflow &= | 171 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 0 | } | 173 | 10 | return narrow_integral || multiply_may_overflow; | 174 | 10 | } | 175 | 0 | return false; | 176 | 10 | }); |
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 | 123 | 5 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 5 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 5 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 5 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 5 | using FromFieldType = typename FromDataType::FieldType; | 133 | 5 | using ToFieldType = typename ToDataType::FieldType; | 134 | 5 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 5 | UInt32 from_scale = 0; | 136 | | | 137 | 5 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 5 | const auto* from_decimal_type = | 139 | 5 | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 5 | from_precision = | 141 | 5 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 5 | from_scale = from_decimal_type->get_scale(); | 143 | 5 | } | 144 | | | 145 | 5 | UInt32 to_max_digits = 0; | 146 | 5 | UInt32 to_precision = 0; | 147 | 5 | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | 5 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | 5 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | 5 | to_precision = to_max_digits; | 163 | 5 | } | 164 | | | 165 | 5 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 5 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 5 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 5 | if (to_scale > from_scale) { | 170 | 0 | multiply_may_overflow &= | 171 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 0 | } | 173 | 5 | return narrow_integral || multiply_may_overflow; | 174 | 5 | } | 175 | 0 | return false; | 176 | 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 | 123 | 2 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 2 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 2 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 2 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 2 | using FromFieldType = typename FromDataType::FieldType; | 133 | 2 | using ToFieldType = typename ToDataType::FieldType; | 134 | 2 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 2 | UInt32 from_scale = 0; | 136 | | | 137 | 2 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 2 | const auto* from_decimal_type = | 139 | 2 | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 2 | from_precision = | 141 | 2 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 2 | from_scale = from_decimal_type->get_scale(); | 143 | 2 | } | 144 | | | 145 | 2 | UInt32 to_max_digits = 0; | 146 | 2 | UInt32 to_precision = 0; | 147 | 2 | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | 2 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | 2 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | 2 | to_precision = to_max_digits; | 163 | 2 | } | 164 | | | 165 | 2 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 2 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 2 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 2 | if (to_scale > from_scale) { | 170 | 0 | multiply_may_overflow &= | 171 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 0 | } | 173 | 2 | return narrow_integral || multiply_may_overflow; | 174 | 2 | } | 175 | 0 | return false; | 176 | 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 | 123 | 5 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 5 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 5 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 5 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 5 | using FromFieldType = typename FromDataType::FieldType; | 133 | 5 | using ToFieldType = typename ToDataType::FieldType; | 134 | 5 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 5 | UInt32 from_scale = 0; | 136 | | | 137 | 5 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 5 | const auto* from_decimal_type = | 139 | 5 | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 5 | from_precision = | 141 | 5 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 5 | from_scale = from_decimal_type->get_scale(); | 143 | 5 | } | 144 | | | 145 | 5 | UInt32 to_max_digits = 0; | 146 | 5 | UInt32 to_precision = 0; | 147 | 5 | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | 5 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | 5 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | 5 | to_precision = to_max_digits; | 163 | 5 | } | 164 | | | 165 | 5 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 5 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 5 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 5 | if (to_scale > from_scale) { | 170 | 0 | multiply_may_overflow &= | 171 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 0 | } | 173 | 5 | return narrow_integral || multiply_may_overflow; | 174 | 5 | } | 175 | 0 | return false; | 176 | 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 | 123 | 2 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 2 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 2 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 2 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 2 | using FromFieldType = typename FromDataType::FieldType; | 133 | 2 | using ToFieldType = typename ToDataType::FieldType; | 134 | 2 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 2 | UInt32 from_scale = 0; | 136 | | | 137 | 2 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 2 | const auto* from_decimal_type = | 139 | 2 | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 2 | from_precision = | 141 | 2 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 2 | from_scale = from_decimal_type->get_scale(); | 143 | 2 | } | 144 | | | 145 | 2 | UInt32 to_max_digits = 0; | 146 | 2 | UInt32 to_precision = 0; | 147 | 2 | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | 2 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | 2 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | 2 | to_precision = to_max_digits; | 163 | 2 | } | 164 | | | 165 | 2 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 2 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 2 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 2 | if (to_scale > from_scale) { | 170 | 0 | multiply_may_overflow &= | 171 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 0 | } | 173 | 2 | return narrow_integral || multiply_may_overflow; | 174 | 2 | } | 175 | 0 | return false; | 176 | 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 | 123 | 813 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 813 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 813 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | 813 | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | 813 | return false; | 130 | 813 | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 813 | return false; | 176 | 813 | }); |
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 | 123 | 920 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 920 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 920 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 920 | return false; | 176 | 920 | }); |
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 | 123 | 10 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 10 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 10 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 10 | return false; | 176 | 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 | 123 | 141 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 141 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 141 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 141 | return false; | 176 | 141 | }); |
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 | 123 | 258 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 258 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 258 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 258 | return false; | 176 | 258 | }); |
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 | 123 | 7 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 7 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 7 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 7 | return false; | 176 | 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 | 123 | 23 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 23 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 23 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 23 | return false; | 176 | 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 | 123 | 30 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 30 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 30 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 30 | return false; | 176 | 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 | 123 | 22 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 22 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 22 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 22 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 22 | using FromFieldType = typename FromDataType::FieldType; | 133 | 22 | using ToFieldType = typename ToDataType::FieldType; | 134 | 22 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 22 | UInt32 from_scale = 0; | 136 | | | 137 | 22 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 22 | const auto* from_decimal_type = | 139 | 22 | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 22 | from_precision = | 141 | 22 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 22 | from_scale = from_decimal_type->get_scale(); | 143 | 22 | } | 144 | | | 145 | 22 | UInt32 to_max_digits = 0; | 146 | 22 | UInt32 to_precision = 0; | 147 | 22 | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | 22 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | 22 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | 22 | to_precision = to_max_digits; | 163 | 22 | } | 164 | | | 165 | 22 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 22 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 22 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 22 | if (to_scale > from_scale) { | 170 | 0 | multiply_may_overflow &= | 171 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 0 | } | 173 | 22 | return narrow_integral || multiply_may_overflow; | 174 | 22 | } | 175 | 0 | return false; | 176 | 22 | }); |
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 | 123 | 25 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 25 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 25 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 25 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 25 | using FromFieldType = typename FromDataType::FieldType; | 133 | 25 | using ToFieldType = typename ToDataType::FieldType; | 134 | 25 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 25 | UInt32 from_scale = 0; | 136 | | | 137 | 25 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 25 | const auto* from_decimal_type = | 139 | 25 | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 25 | from_precision = | 141 | 25 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 25 | from_scale = from_decimal_type->get_scale(); | 143 | 25 | } | 144 | | | 145 | 25 | UInt32 to_max_digits = 0; | 146 | 25 | UInt32 to_precision = 0; | 147 | 25 | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | 25 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | 25 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | 25 | to_precision = to_max_digits; | 163 | 25 | } | 164 | | | 165 | 25 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 25 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 25 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 25 | if (to_scale > from_scale) { | 170 | 0 | multiply_may_overflow &= | 171 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 0 | } | 173 | 25 | return narrow_integral || multiply_may_overflow; | 174 | 25 | } | 175 | 0 | return false; | 176 | 25 | }); |
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 | 123 | 8 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 8 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 8 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 8 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 8 | using FromFieldType = typename FromDataType::FieldType; | 133 | 8 | using ToFieldType = typename ToDataType::FieldType; | 134 | 8 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 8 | UInt32 from_scale = 0; | 136 | | | 137 | 8 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 8 | const auto* from_decimal_type = | 139 | 8 | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 8 | from_precision = | 141 | 8 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 8 | from_scale = from_decimal_type->get_scale(); | 143 | 8 | } | 144 | | | 145 | 8 | UInt32 to_max_digits = 0; | 146 | 8 | UInt32 to_precision = 0; | 147 | 8 | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | 8 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | 8 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | 8 | to_precision = to_max_digits; | 163 | 8 | } | 164 | | | 165 | 8 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 8 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 8 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 8 | if (to_scale > from_scale) { | 170 | 0 | multiply_may_overflow &= | 171 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 0 | } | 173 | 8 | return narrow_integral || multiply_may_overflow; | 174 | 8 | } | 175 | 0 | return false; | 176 | 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 | 123 | 25 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 25 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 25 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 25 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 25 | using FromFieldType = typename FromDataType::FieldType; | 133 | 25 | using ToFieldType = typename ToDataType::FieldType; | 134 | 25 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 25 | UInt32 from_scale = 0; | 136 | | | 137 | 25 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 25 | const auto* from_decimal_type = | 139 | 25 | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 25 | from_precision = | 141 | 25 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 25 | from_scale = from_decimal_type->get_scale(); | 143 | 25 | } | 144 | | | 145 | 25 | UInt32 to_max_digits = 0; | 146 | 25 | UInt32 to_precision = 0; | 147 | 25 | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | 25 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | 25 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | 25 | to_precision = to_max_digits; | 163 | 25 | } | 164 | | | 165 | 25 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 25 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 25 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 25 | if (to_scale > from_scale) { | 170 | 0 | multiply_may_overflow &= | 171 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 0 | } | 173 | 25 | return narrow_integral || multiply_may_overflow; | 174 | 25 | } | 175 | 0 | return false; | 176 | 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 | 123 | 25 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 25 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 25 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 25 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 25 | using FromFieldType = typename FromDataType::FieldType; | 133 | 25 | using ToFieldType = typename ToDataType::FieldType; | 134 | 25 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 25 | UInt32 from_scale = 0; | 136 | | | 137 | 25 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 25 | const auto* from_decimal_type = | 139 | 25 | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 25 | from_precision = | 141 | 25 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 25 | from_scale = from_decimal_type->get_scale(); | 143 | 25 | } | 144 | | | 145 | 25 | UInt32 to_max_digits = 0; | 146 | 25 | UInt32 to_precision = 0; | 147 | 25 | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | 25 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | 25 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | 25 | to_precision = to_max_digits; | 163 | 25 | } | 164 | | | 165 | 25 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 25 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 25 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 25 | if (to_scale > from_scale) { | 170 | 0 | multiply_may_overflow &= | 171 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 0 | } | 173 | 25 | return narrow_integral || multiply_may_overflow; | 174 | 25 | } | 175 | 0 | return false; | 176 | 25 | }); |
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 | 123 | 72 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 72 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 72 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 72 | return false; | 176 | 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 | 123 | 24 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 24 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 24 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 24 | return false; | 176 | 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 | 123 | 320 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 320 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 320 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 320 | return false; | 176 | 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 | 123 | 6.88k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 6.88k | using Types2 = std::decay_t<decltype(types2)>; | 125 | 6.88k | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | 6.88k | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | 6.88k | return false; | 130 | 6.88k | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 6.88k | return false; | 176 | 6.88k | }); |
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 | 123 | 142 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 142 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 142 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 142 | return false; | 176 | 142 | }); |
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 | 123 | 1.56k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 1.56k | using Types2 = std::decay_t<decltype(types2)>; | 125 | 1.56k | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 1.56k | return false; | 176 | 1.56k | }); |
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 | 123 | 129 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 129 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 129 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 129 | return false; | 176 | 129 | }); |
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 | 123 | 100 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 100 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 100 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 100 | return false; | 176 | 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 | 123 | 20 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 20 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 20 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 20 | return false; | 176 | 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 | 123 | 21 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 21 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 21 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 21 | return false; | 176 | 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 | 123 | 25 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 25 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 25 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 25 | return false; | 176 | 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 | 123 | 21 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 21 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 21 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 21 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 21 | using FromFieldType = typename FromDataType::FieldType; | 133 | 21 | using ToFieldType = typename ToDataType::FieldType; | 134 | 21 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 21 | UInt32 from_scale = 0; | 136 | | | 137 | 21 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 21 | const auto* from_decimal_type = | 139 | 21 | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 21 | from_precision = | 141 | 21 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 21 | from_scale = from_decimal_type->get_scale(); | 143 | 21 | } | 144 | | | 145 | 21 | UInt32 to_max_digits = 0; | 146 | 21 | UInt32 to_precision = 0; | 147 | 21 | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | 21 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | 21 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | 21 | to_precision = to_max_digits; | 163 | 21 | } | 164 | | | 165 | 21 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 21 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 21 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 21 | if (to_scale > from_scale) { | 170 | 0 | multiply_may_overflow &= | 171 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 0 | } | 173 | 21 | return narrow_integral || multiply_may_overflow; | 174 | 21 | } | 175 | 0 | return false; | 176 | 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 | 123 | 24 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 24 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 24 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 24 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 24 | using FromFieldType = typename FromDataType::FieldType; | 133 | 24 | using ToFieldType = typename ToDataType::FieldType; | 134 | 24 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 24 | UInt32 from_scale = 0; | 136 | | | 137 | 24 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 24 | const auto* from_decimal_type = | 139 | 24 | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 24 | from_precision = | 141 | 24 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 24 | from_scale = from_decimal_type->get_scale(); | 143 | 24 | } | 144 | | | 145 | 24 | UInt32 to_max_digits = 0; | 146 | 24 | UInt32 to_precision = 0; | 147 | 24 | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | 24 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | 24 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | 24 | to_precision = to_max_digits; | 163 | 24 | } | 164 | | | 165 | 24 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 24 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 24 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 24 | if (to_scale > from_scale) { | 170 | 0 | multiply_may_overflow &= | 171 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 0 | } | 173 | 24 | return narrow_integral || multiply_may_overflow; | 174 | 24 | } | 175 | 0 | return false; | 176 | 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 | 123 | 8 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 8 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 8 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 8 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 8 | using FromFieldType = typename FromDataType::FieldType; | 133 | 8 | using ToFieldType = typename ToDataType::FieldType; | 134 | 8 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 8 | UInt32 from_scale = 0; | 136 | | | 137 | 8 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 8 | const auto* from_decimal_type = | 139 | 8 | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 8 | from_precision = | 141 | 8 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 8 | from_scale = from_decimal_type->get_scale(); | 143 | 8 | } | 144 | | | 145 | 8 | UInt32 to_max_digits = 0; | 146 | 8 | UInt32 to_precision = 0; | 147 | 8 | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | 8 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | 8 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | 8 | to_precision = to_max_digits; | 163 | 8 | } | 164 | | | 165 | 8 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 8 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 8 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 8 | if (to_scale > from_scale) { | 170 | 0 | multiply_may_overflow &= | 171 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 0 | } | 173 | 8 | return narrow_integral || multiply_may_overflow; | 174 | 8 | } | 175 | 0 | return false; | 176 | 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 | 123 | 26 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 26 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 26 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 26 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 26 | using FromFieldType = typename FromDataType::FieldType; | 133 | 26 | using ToFieldType = typename ToDataType::FieldType; | 134 | 26 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 26 | UInt32 from_scale = 0; | 136 | | | 137 | 26 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 26 | const auto* from_decimal_type = | 139 | 26 | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 26 | from_precision = | 141 | 26 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 26 | from_scale = from_decimal_type->get_scale(); | 143 | 26 | } | 144 | | | 145 | 26 | UInt32 to_max_digits = 0; | 146 | 26 | UInt32 to_precision = 0; | 147 | 26 | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | 26 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | 26 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | 26 | to_precision = to_max_digits; | 163 | 26 | } | 164 | | | 165 | 26 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 26 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 26 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 26 | if (to_scale > from_scale) { | 170 | 0 | multiply_may_overflow &= | 171 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 0 | } | 173 | 26 | return narrow_integral || multiply_may_overflow; | 174 | 26 | } | 175 | 0 | return false; | 176 | 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 | 123 | 26 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 26 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 26 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 26 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 26 | using FromFieldType = typename FromDataType::FieldType; | 133 | 26 | using ToFieldType = typename ToDataType::FieldType; | 134 | 26 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 26 | UInt32 from_scale = 0; | 136 | | | 137 | 26 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 26 | const auto* from_decimal_type = | 139 | 26 | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 26 | from_precision = | 141 | 26 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 26 | from_scale = from_decimal_type->get_scale(); | 143 | 26 | } | 144 | | | 145 | 26 | UInt32 to_max_digits = 0; | 146 | 26 | UInt32 to_precision = 0; | 147 | 26 | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | 26 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | 26 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | 26 | to_precision = to_max_digits; | 163 | 26 | } | 164 | | | 165 | 26 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 26 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 26 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 26 | if (to_scale > from_scale) { | 170 | 0 | multiply_may_overflow &= | 171 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 0 | } | 173 | 26 | return narrow_integral || multiply_may_overflow; | 174 | 26 | } | 175 | 0 | return false; | 176 | 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 | 123 | 72 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 72 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 72 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 72 | return false; | 176 | 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 | 123 | 24 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 24 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 24 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 24 | return false; | 176 | 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 | 123 | 320 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 320 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 320 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 320 | return false; | 176 | 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 | 123 | 2.93k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 2.93k | using Types2 = std::decay_t<decltype(types2)>; | 125 | 2.93k | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | 2.93k | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | 2.93k | return false; | 130 | 2.93k | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 2.93k | return false; | 176 | 2.93k | }); |
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 | 123 | 44 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 44 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 44 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 44 | return false; | 176 | 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 | 123 | 3.68k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 3.68k | using Types2 = std::decay_t<decltype(types2)>; | 125 | 3.68k | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 3.68k | return false; | 176 | 3.68k | }); |
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 | 123 | 531 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 531 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 531 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 531 | return false; | 176 | 531 | }); |
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 | 123 | 117k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 117k | using Types2 = std::decay_t<decltype(types2)>; | 125 | 117k | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 117k | return false; | 176 | 117k | }); |
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 | 123 | 13 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 13 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 13 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 13 | return false; | 176 | 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 | 123 | 20 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 20 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 20 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 20 | return false; | 176 | 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 | 123 | 132 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 132 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 132 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 132 | return false; | 176 | 132 | }); |
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 | 123 | 21 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 21 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 21 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 21 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 21 | using FromFieldType = typename FromDataType::FieldType; | 133 | 21 | using ToFieldType = typename ToDataType::FieldType; | 134 | 21 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 21 | UInt32 from_scale = 0; | 136 | | | 137 | 21 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 21 | const auto* from_decimal_type = | 139 | 21 | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 21 | from_precision = | 141 | 21 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 21 | from_scale = from_decimal_type->get_scale(); | 143 | 21 | } | 144 | | | 145 | 21 | UInt32 to_max_digits = 0; | 146 | 21 | UInt32 to_precision = 0; | 147 | 21 | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | 21 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | 21 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | 21 | to_precision = to_max_digits; | 163 | 21 | } | 164 | | | 165 | 21 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 21 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 21 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 21 | if (to_scale > from_scale) { | 170 | 0 | multiply_may_overflow &= | 171 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 0 | } | 173 | 21 | return narrow_integral || multiply_may_overflow; | 174 | 21 | } | 175 | 0 | return false; | 176 | 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 | 123 | 38 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 38 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 38 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 38 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 38 | using FromFieldType = typename FromDataType::FieldType; | 133 | 38 | using ToFieldType = typename ToDataType::FieldType; | 134 | 38 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 38 | UInt32 from_scale = 0; | 136 | | | 137 | 38 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 38 | const auto* from_decimal_type = | 139 | 38 | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 38 | from_precision = | 141 | 38 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 38 | from_scale = from_decimal_type->get_scale(); | 143 | 38 | } | 144 | | | 145 | 38 | UInt32 to_max_digits = 0; | 146 | 38 | UInt32 to_precision = 0; | 147 | 38 | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | 38 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | 38 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | 38 | to_precision = to_max_digits; | 163 | 38 | } | 164 | | | 165 | 38 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 38 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 38 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 38 | if (to_scale > from_scale) { | 170 | 0 | multiply_may_overflow &= | 171 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 0 | } | 173 | 38 | return narrow_integral || multiply_may_overflow; | 174 | 38 | } | 175 | 0 | return false; | 176 | 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 | 123 | 8 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 8 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 8 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 8 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 8 | using FromFieldType = typename FromDataType::FieldType; | 133 | 8 | using ToFieldType = typename ToDataType::FieldType; | 134 | 8 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 8 | UInt32 from_scale = 0; | 136 | | | 137 | 8 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 8 | const auto* from_decimal_type = | 139 | 8 | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 8 | from_precision = | 141 | 8 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 8 | from_scale = from_decimal_type->get_scale(); | 143 | 8 | } | 144 | | | 145 | 8 | UInt32 to_max_digits = 0; | 146 | 8 | UInt32 to_precision = 0; | 147 | 8 | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | 8 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | 8 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | 8 | to_precision = to_max_digits; | 163 | 8 | } | 164 | | | 165 | 8 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 8 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 8 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 8 | if (to_scale > from_scale) { | 170 | 0 | multiply_may_overflow &= | 171 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 0 | } | 173 | 8 | return narrow_integral || multiply_may_overflow; | 174 | 8 | } | 175 | 0 | return false; | 176 | 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 | 123 | 249 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 249 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 249 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 249 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 249 | using FromFieldType = typename FromDataType::FieldType; | 133 | 249 | using ToFieldType = typename ToDataType::FieldType; | 134 | 249 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 249 | UInt32 from_scale = 0; | 136 | | | 137 | 249 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 249 | const auto* from_decimal_type = | 139 | 249 | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 249 | from_precision = | 141 | 249 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 249 | from_scale = from_decimal_type->get_scale(); | 143 | 249 | } | 144 | | | 145 | 249 | UInt32 to_max_digits = 0; | 146 | 249 | UInt32 to_precision = 0; | 147 | 249 | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | 249 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | 249 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | 249 | to_precision = to_max_digits; | 163 | 249 | } | 164 | | | 165 | 249 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 249 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 249 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 249 | if (to_scale > from_scale) { | 170 | 0 | multiply_may_overflow &= | 171 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 0 | } | 173 | 249 | return narrow_integral || multiply_may_overflow; | 174 | 249 | } | 175 | 0 | return false; | 176 | 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 | 123 | 22 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 22 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 22 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 22 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 22 | using FromFieldType = typename FromDataType::FieldType; | 133 | 22 | using ToFieldType = typename ToDataType::FieldType; | 134 | 22 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 22 | UInt32 from_scale = 0; | 136 | | | 137 | 22 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 22 | const auto* from_decimal_type = | 139 | 22 | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 22 | from_precision = | 141 | 22 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 22 | from_scale = from_decimal_type->get_scale(); | 143 | 22 | } | 144 | | | 145 | 22 | UInt32 to_max_digits = 0; | 146 | 22 | UInt32 to_precision = 0; | 147 | 22 | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | 22 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | 22 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | 22 | to_precision = to_max_digits; | 163 | 22 | } | 164 | | | 165 | 22 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 22 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 22 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 22 | if (to_scale > from_scale) { | 170 | 0 | multiply_may_overflow &= | 171 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 0 | } | 173 | 22 | return narrow_integral || multiply_may_overflow; | 174 | 22 | } | 175 | 0 | return false; | 176 | 22 | }); |
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 | 123 | 12 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 12 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 12 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 12 | return false; | 176 | 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 | 123 | 24 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 24 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 24 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 24 | return false; | 176 | 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 | 123 | 276 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 276 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 276 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 276 | return false; | 176 | 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 | 123 | 23.3k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 23.3k | using Types2 = std::decay_t<decltype(types2)>; | 125 | 23.3k | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | 23.3k | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | 23.3k | return false; | 130 | 23.3k | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 23.3k | return false; | 176 | 23.3k | }); |
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 | 123 | 560 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 560 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 560 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 560 | return false; | 176 | 560 | }); |
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 | 123 | 1.40k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 1.40k | using Types2 = std::decay_t<decltype(types2)>; | 125 | 1.40k | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 1.40k | return false; | 176 | 1.40k | }); |
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 | 123 | 675 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 675 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 675 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 675 | return false; | 176 | 675 | }); |
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 | 123 | 14.1k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 14.1k | using Types2 = std::decay_t<decltype(types2)>; | 125 | 14.1k | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 14.1k | return false; | 176 | 14.1k | }); |
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 | 123 | 314 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 314 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 314 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 314 | return false; | 176 | 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 | 123 | 642 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 642 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 642 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 642 | return false; | 176 | 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 | 123 | 2.34k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 2.34k | using Types2 = std::decay_t<decltype(types2)>; | 125 | 2.34k | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 2.34k | return false; | 176 | 2.34k | }); |
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 | 123 | 313 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 313 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 313 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 313 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 313 | using FromFieldType = typename FromDataType::FieldType; | 133 | 313 | using ToFieldType = typename ToDataType::FieldType; | 134 | 313 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 313 | UInt32 from_scale = 0; | 136 | | | 137 | 313 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 313 | const auto* from_decimal_type = | 139 | 313 | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 313 | from_precision = | 141 | 313 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 313 | from_scale = from_decimal_type->get_scale(); | 143 | 313 | } | 144 | | | 145 | 313 | UInt32 to_max_digits = 0; | 146 | 313 | UInt32 to_precision = 0; | 147 | 313 | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | 313 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | 313 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | 313 | to_precision = to_max_digits; | 163 | 313 | } | 164 | | | 165 | 313 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 313 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 313 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 313 | if (to_scale > from_scale) { | 170 | 0 | multiply_may_overflow &= | 171 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 0 | } | 173 | 313 | return narrow_integral || multiply_may_overflow; | 174 | 313 | } | 175 | 0 | return false; | 176 | 313 | }); |
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 | 123 | 317 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 317 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 317 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 317 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 317 | using FromFieldType = typename FromDataType::FieldType; | 133 | 317 | using ToFieldType = typename ToDataType::FieldType; | 134 | 317 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 317 | UInt32 from_scale = 0; | 136 | | | 137 | 317 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 317 | const auto* from_decimal_type = | 139 | 317 | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 317 | from_precision = | 141 | 317 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 317 | from_scale = from_decimal_type->get_scale(); | 143 | 317 | } | 144 | | | 145 | 317 | UInt32 to_max_digits = 0; | 146 | 317 | UInt32 to_precision = 0; | 147 | 317 | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | 317 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | 317 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | 317 | to_precision = to_max_digits; | 163 | 317 | } | 164 | | | 165 | 317 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 317 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 317 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 317 | if (to_scale > from_scale) { | 170 | 0 | multiply_may_overflow &= | 171 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 0 | } | 173 | 318 | return narrow_integral || multiply_may_overflow; | 174 | 317 | } | 175 | 0 | return false; | 176 | 317 | }); |
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 | 123 | 302 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 302 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 302 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 302 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 302 | using FromFieldType = typename FromDataType::FieldType; | 133 | 302 | using ToFieldType = typename ToDataType::FieldType; | 134 | 302 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 302 | UInt32 from_scale = 0; | 136 | | | 137 | 302 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 302 | const auto* from_decimal_type = | 139 | 302 | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 302 | from_precision = | 141 | 302 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 302 | from_scale = from_decimal_type->get_scale(); | 143 | 302 | } | 144 | | | 145 | 302 | UInt32 to_max_digits = 0; | 146 | 302 | UInt32 to_precision = 0; | 147 | 302 | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | 302 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | 302 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | 302 | to_precision = to_max_digits; | 163 | 302 | } | 164 | | | 165 | 302 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 302 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 302 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 302 | if (to_scale > from_scale) { | 170 | 0 | multiply_may_overflow &= | 171 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 0 | } | 173 | 302 | return narrow_integral || multiply_may_overflow; | 174 | 302 | } | 175 | 0 | return false; | 176 | 302 | }); |
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 | 123 | 754 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 754 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 754 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 754 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 754 | using FromFieldType = typename FromDataType::FieldType; | 133 | 754 | using ToFieldType = typename ToDataType::FieldType; | 134 | 754 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 754 | UInt32 from_scale = 0; | 136 | | | 137 | 754 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 754 | const auto* from_decimal_type = | 139 | 754 | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 754 | from_precision = | 141 | 754 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 754 | from_scale = from_decimal_type->get_scale(); | 143 | 754 | } | 144 | | | 145 | 754 | UInt32 to_max_digits = 0; | 146 | 754 | UInt32 to_precision = 0; | 147 | 754 | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | 754 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | 754 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | 754 | to_precision = to_max_digits; | 163 | 754 | } | 164 | | | 165 | 754 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 754 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 754 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 754 | if (to_scale > from_scale) { | 170 | 0 | multiply_may_overflow &= | 171 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 0 | } | 173 | 754 | return narrow_integral || multiply_may_overflow; | 174 | 754 | } | 175 | 0 | return false; | 176 | 754 | }); |
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 | 123 | 22 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 22 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 22 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 22 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 22 | using FromFieldType = typename FromDataType::FieldType; | 133 | 22 | using ToFieldType = typename ToDataType::FieldType; | 134 | 22 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 22 | UInt32 from_scale = 0; | 136 | | | 137 | 22 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 22 | const auto* from_decimal_type = | 139 | 22 | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 22 | from_precision = | 141 | 22 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 22 | from_scale = from_decimal_type->get_scale(); | 143 | 22 | } | 144 | | | 145 | 22 | UInt32 to_max_digits = 0; | 146 | 22 | UInt32 to_precision = 0; | 147 | 22 | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | 22 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | 22 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | 22 | to_precision = to_max_digits; | 163 | 22 | } | 164 | | | 165 | 22 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 22 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 22 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 22 | if (to_scale > from_scale) { | 170 | 0 | multiply_may_overflow &= | 171 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 0 | } | 173 | 22 | return narrow_integral || multiply_may_overflow; | 174 | 22 | } | 175 | 0 | return false; | 176 | 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 | 123 | 1.24k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 1.24k | using Types2 = std::decay_t<decltype(types2)>; | 125 | 1.24k | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 1.24k | return false; | 176 | 1.24k | }); |
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 | 123 | 1.25k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 1.25k | using Types2 = std::decay_t<decltype(types2)>; | 125 | 1.25k | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 1.25k | return false; | 176 | 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 | 123 | 4 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 4 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 4 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 4 | return false; | 176 | 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 | 123 | 23.3k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 23.3k | using Types2 = std::decay_t<decltype(types2)>; | 125 | 23.3k | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | 23.3k | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | 23.3k | return false; | 130 | 23.3k | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 23.3k | return false; | 176 | 23.3k | }); |
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 | 123 | 126 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 126 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 126 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 126 | return false; | 176 | 126 | }); |
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 | 123 | 109 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 109 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 109 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 109 | return false; | 176 | 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 | 123 | 79 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 79 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 79 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 79 | return false; | 176 | 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 | 123 | 135 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 135 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 135 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 135 | return false; | 176 | 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 | 123 | 585 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 585 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 585 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 585 | return false; | 176 | 585 | }); |
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 | 123 | 9 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 9 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 9 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 9 | return false; | 176 | 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 | 123 | 13 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 13 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 13 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 13 | return false; | 176 | 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 | 123 | 18 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 18 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 18 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 18 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 18 | using FromFieldType = typename FromDataType::FieldType; | 133 | 18 | using ToFieldType = typename ToDataType::FieldType; | 134 | 18 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 18 | UInt32 from_scale = 0; | 136 | | | 137 | 18 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 18 | const auto* from_decimal_type = | 139 | 18 | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 18 | from_precision = | 141 | 18 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 18 | from_scale = from_decimal_type->get_scale(); | 143 | 18 | } | 144 | | | 145 | 18 | UInt32 to_max_digits = 0; | 146 | 18 | UInt32 to_precision = 0; | 147 | 18 | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | 18 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | 18 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | 18 | to_precision = to_max_digits; | 163 | 18 | } | 164 | | | 165 | 18 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 18 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 18 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 18 | if (to_scale > from_scale) { | 170 | 0 | multiply_may_overflow &= | 171 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 0 | } | 173 | 18 | return narrow_integral || multiply_may_overflow; | 174 | 18 | } | 175 | 0 | return false; | 176 | 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 | 123 | 21 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 21 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 21 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 21 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 21 | using FromFieldType = typename FromDataType::FieldType; | 133 | 21 | using ToFieldType = typename ToDataType::FieldType; | 134 | 21 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 21 | UInt32 from_scale = 0; | 136 | | | 137 | 21 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 21 | const auto* from_decimal_type = | 139 | 21 | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 21 | from_precision = | 141 | 21 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 21 | from_scale = from_decimal_type->get_scale(); | 143 | 21 | } | 144 | | | 145 | 21 | UInt32 to_max_digits = 0; | 146 | 21 | UInt32 to_precision = 0; | 147 | 21 | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | 21 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | 21 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | 21 | to_precision = to_max_digits; | 163 | 21 | } | 164 | | | 165 | 21 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 21 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 21 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 21 | if (to_scale > from_scale) { | 170 | 0 | multiply_may_overflow &= | 171 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 0 | } | 173 | 21 | return narrow_integral || multiply_may_overflow; | 174 | 21 | } | 175 | 0 | return false; | 176 | 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 | 123 | 8 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 8 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 8 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 8 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 8 | using FromFieldType = typename FromDataType::FieldType; | 133 | 8 | using ToFieldType = typename ToDataType::FieldType; | 134 | 8 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 8 | UInt32 from_scale = 0; | 136 | | | 137 | 8 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 8 | const auto* from_decimal_type = | 139 | 8 | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 8 | from_precision = | 141 | 8 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 8 | from_scale = from_decimal_type->get_scale(); | 143 | 8 | } | 144 | | | 145 | 8 | UInt32 to_max_digits = 0; | 146 | 8 | UInt32 to_precision = 0; | 147 | 8 | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | 8 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | 8 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | 8 | to_precision = to_max_digits; | 163 | 8 | } | 164 | | | 165 | 8 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 8 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 8 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 8 | if (to_scale > from_scale) { | 170 | 0 | multiply_may_overflow &= | 171 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 0 | } | 173 | 8 | return narrow_integral || multiply_may_overflow; | 174 | 8 | } | 175 | 0 | return false; | 176 | 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 | 123 | 21 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 21 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 21 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 21 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 21 | using FromFieldType = typename FromDataType::FieldType; | 133 | 21 | using ToFieldType = typename ToDataType::FieldType; | 134 | 21 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 21 | UInt32 from_scale = 0; | 136 | | | 137 | 21 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 21 | const auto* from_decimal_type = | 139 | 21 | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 21 | from_precision = | 141 | 21 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 21 | from_scale = from_decimal_type->get_scale(); | 143 | 21 | } | 144 | | | 145 | 21 | UInt32 to_max_digits = 0; | 146 | 21 | UInt32 to_precision = 0; | 147 | 21 | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | 21 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | 21 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | 21 | to_precision = to_max_digits; | 163 | 21 | } | 164 | | | 165 | 21 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 21 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 21 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 21 | if (to_scale > from_scale) { | 170 | 0 | multiply_may_overflow &= | 171 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 0 | } | 173 | 21 | return narrow_integral || multiply_may_overflow; | 174 | 21 | } | 175 | 0 | return false; | 176 | 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 | 123 | 783 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 783 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 783 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 783 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 783 | using FromFieldType = typename FromDataType::FieldType; | 133 | 783 | using ToFieldType = typename ToDataType::FieldType; | 134 | 783 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 783 | UInt32 from_scale = 0; | 136 | | | 137 | 783 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 783 | const auto* from_decimal_type = | 139 | 783 | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 783 | from_precision = | 141 | 783 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 783 | from_scale = from_decimal_type->get_scale(); | 143 | 783 | } | 144 | | | 145 | 783 | UInt32 to_max_digits = 0; | 146 | 783 | UInt32 to_precision = 0; | 147 | 783 | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | 783 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | 783 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | 783 | to_precision = to_max_digits; | 163 | 783 | } | 164 | | | 165 | 783 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 783 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 783 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 783 | if (to_scale > from_scale) { | 170 | 0 | multiply_may_overflow &= | 171 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 0 | } | 173 | 783 | return narrow_integral || multiply_may_overflow; | 174 | 783 | } | 175 | 0 | return false; | 176 | 783 | }); |
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 | 123 | 2 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 2 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 2 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 2 | return false; | 176 | 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 | 123 | 16 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 16 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 16 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 16 | return false; | 176 | 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 | 123 | 4 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 4 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 4 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 4 | return false; | 176 | 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 | 123 | 57.2k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 57.2k | using Types2 = std::decay_t<decltype(types2)>; | 125 | 57.2k | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | 57.2k | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | 57.2k | return false; | 130 | 57.2k | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 57.2k | return false; | 176 | 57.2k | }); |
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 | 123 | 2 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 2 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 2 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 2 | return false; | 176 | 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 | 123 | 31 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 31 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 31 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 31 | return false; | 176 | 31 | }); |
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 | 123 | 8 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 8 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 8 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 8 | return false; | 176 | 8 | }); |
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 | 123 | 20 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 20 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 20 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 20 | return false; | 176 | 20 | }); |
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 | 123 | 8 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 8 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 8 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 8 | return false; | 176 | 8 | }); |
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 | 123 | 119 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 119 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 119 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 119 | return false; | 176 | 119 | }); |
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 | 123 | 89 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 89 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 89 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 89 | return false; | 176 | 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 | 123 | 119 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 119 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 119 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 119 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 119 | using FromFieldType = typename FromDataType::FieldType; | 133 | 119 | using ToFieldType = typename ToDataType::FieldType; | 134 | 119 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 119 | UInt32 from_scale = 0; | 136 | | | 137 | 119 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 119 | const auto* from_decimal_type = | 139 | 119 | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 119 | from_precision = | 141 | 119 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 119 | from_scale = from_decimal_type->get_scale(); | 143 | 119 | } | 144 | | | 145 | 119 | UInt32 to_max_digits = 0; | 146 | 119 | UInt32 to_precision = 0; | 147 | 119 | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | 119 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | 119 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | 119 | to_precision = to_max_digits; | 163 | 119 | } | 164 | | | 165 | 119 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 119 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 119 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 119 | if (to_scale > from_scale) { | 170 | 0 | multiply_may_overflow &= | 171 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 0 | } | 173 | 119 | return narrow_integral || multiply_may_overflow; | 174 | 119 | } | 175 | 0 | return false; | 176 | 119 | }); |
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 | 123 | 112 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 112 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 112 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 112 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 112 | using FromFieldType = typename FromDataType::FieldType; | 133 | 112 | using ToFieldType = typename ToDataType::FieldType; | 134 | 112 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 112 | UInt32 from_scale = 0; | 136 | | | 137 | 112 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 112 | const auto* from_decimal_type = | 139 | 112 | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 112 | from_precision = | 141 | 112 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 112 | from_scale = from_decimal_type->get_scale(); | 143 | 112 | } | 144 | | | 145 | 112 | UInt32 to_max_digits = 0; | 146 | 112 | UInt32 to_precision = 0; | 147 | 112 | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | 112 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | 112 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | 112 | to_precision = to_max_digits; | 163 | 112 | } | 164 | | | 165 | 112 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 112 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 112 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 112 | if (to_scale > from_scale) { | 170 | 0 | multiply_may_overflow &= | 171 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 0 | } | 173 | 112 | return narrow_integral || multiply_may_overflow; | 174 | 112 | } | 175 | 0 | return false; | 176 | 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 | 123 | 16 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 16 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 16 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 16 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 16 | using FromFieldType = typename FromDataType::FieldType; | 133 | 16 | using ToFieldType = typename ToDataType::FieldType; | 134 | 16 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 16 | UInt32 from_scale = 0; | 136 | | | 137 | 16 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 16 | const auto* from_decimal_type = | 139 | 16 | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 16 | from_precision = | 141 | 16 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 16 | from_scale = from_decimal_type->get_scale(); | 143 | 16 | } | 144 | | | 145 | 16 | UInt32 to_max_digits = 0; | 146 | 16 | UInt32 to_precision = 0; | 147 | 16 | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | 16 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | 16 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | 16 | to_precision = to_max_digits; | 163 | 16 | } | 164 | | | 165 | 16 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 16 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 16 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 16 | if (to_scale > from_scale) { | 170 | 0 | multiply_may_overflow &= | 171 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 0 | } | 173 | 16 | return narrow_integral || multiply_may_overflow; | 174 | 16 | } | 175 | 0 | return false; | 176 | 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 | 123 | 101 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 101 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 101 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 101 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 101 | using FromFieldType = typename FromDataType::FieldType; | 133 | 101 | using ToFieldType = typename ToDataType::FieldType; | 134 | 101 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 101 | UInt32 from_scale = 0; | 136 | | | 137 | 101 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 101 | const auto* from_decimal_type = | 139 | 101 | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 101 | from_precision = | 141 | 101 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 101 | from_scale = from_decimal_type->get_scale(); | 143 | 101 | } | 144 | | | 145 | 101 | UInt32 to_max_digits = 0; | 146 | 101 | UInt32 to_precision = 0; | 147 | 101 | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | 101 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | 101 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | 101 | to_precision = to_max_digits; | 163 | 101 | } | 164 | | | 165 | 101 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 101 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 101 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 101 | if (to_scale > from_scale) { | 170 | 0 | multiply_may_overflow &= | 171 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 0 | } | 173 | 101 | return narrow_integral || multiply_may_overflow; | 174 | 101 | } | 175 | 0 | return false; | 176 | 101 | }); |
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 | 123 | 554 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 554 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 554 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 554 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 554 | using FromFieldType = typename FromDataType::FieldType; | 133 | 554 | using ToFieldType = typename ToDataType::FieldType; | 134 | 554 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 554 | UInt32 from_scale = 0; | 136 | | | 137 | 554 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 554 | const auto* from_decimal_type = | 139 | 554 | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 554 | from_precision = | 141 | 554 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 554 | from_scale = from_decimal_type->get_scale(); | 143 | 554 | } | 144 | | | 145 | 554 | UInt32 to_max_digits = 0; | 146 | 554 | UInt32 to_precision = 0; | 147 | 554 | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | 554 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | 554 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | 554 | to_precision = to_max_digits; | 163 | 554 | } | 164 | | | 165 | 554 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 554 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 554 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 554 | if (to_scale > from_scale) { | 170 | 0 | multiply_may_overflow &= | 171 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 0 | } | 173 | 554 | return narrow_integral || multiply_may_overflow; | 174 | 554 | } | 175 | 0 | return false; | 176 | 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 | 123 | 39 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 39 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 39 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 39 | return false; | 176 | 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 | 123 | 7.78k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 7.78k | using Types2 = std::decay_t<decltype(types2)>; | 125 | 7.78k | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 7.78k | return false; | 176 | 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 | 123 | 162 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 162 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 162 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 162 | return false; | 176 | 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 | 123 | 1.76k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 1.76k | using Types2 = std::decay_t<decltype(types2)>; | 125 | 1.76k | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | 1.76k | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | 1.76k | return false; | 130 | 1.76k | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 1.76k | return false; | 176 | 1.76k | }); |
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 | 123 | 304 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 304 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 304 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 304 | return false; | 176 | 304 | }); |
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 | 123 | 443 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 443 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 443 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 443 | return false; | 176 | 443 | }); |
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 | 123 | 886 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 886 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 886 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 886 | return false; | 176 | 886 | }); |
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 | 123 | 1.23k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 1.23k | using Types2 = std::decay_t<decltype(types2)>; | 125 | 1.23k | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 1.23k | return false; | 176 | 1.23k | }); |
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 | 123 | 1.52k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 1.52k | using Types2 = std::decay_t<decltype(types2)>; | 125 | 1.52k | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 1.52k | return false; | 176 | 1.52k | }); |
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 | 123 | 193 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 193 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 193 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 193 | return false; | 176 | 193 | }); |
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 | 123 | 2.80k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 2.80k | using Types2 = std::decay_t<decltype(types2)>; | 125 | 2.80k | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 2.80k | return false; | 176 | 2.80k | }); |
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 | 123 | 402 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 402 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 402 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 402 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 402 | using FromFieldType = typename FromDataType::FieldType; | 133 | 402 | using ToFieldType = typename ToDataType::FieldType; | 134 | 402 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 402 | UInt32 from_scale = 0; | 136 | | | 137 | 402 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 402 | const auto* from_decimal_type = | 139 | 402 | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 402 | from_precision = | 141 | 402 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 402 | from_scale = from_decimal_type->get_scale(); | 143 | 402 | } | 144 | | | 145 | 402 | UInt32 to_max_digits = 0; | 146 | 402 | UInt32 to_precision = 0; | 147 | 402 | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | 402 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | 402 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | 402 | to_precision = to_max_digits; | 163 | 402 | } | 164 | | | 165 | 402 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 402 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 402 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 402 | if (to_scale > from_scale) { | 170 | 0 | multiply_may_overflow &= | 171 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 0 | } | 173 | 402 | return narrow_integral || multiply_may_overflow; | 174 | 402 | } | 175 | 0 | return false; | 176 | 402 | }); |
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 | 123 | 356 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 356 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 356 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 356 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 356 | using FromFieldType = typename FromDataType::FieldType; | 133 | 356 | using ToFieldType = typename ToDataType::FieldType; | 134 | 356 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 356 | UInt32 from_scale = 0; | 136 | | | 137 | 356 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 356 | const auto* from_decimal_type = | 139 | 356 | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 356 | from_precision = | 141 | 356 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 356 | from_scale = from_decimal_type->get_scale(); | 143 | 356 | } | 144 | | | 145 | 356 | UInt32 to_max_digits = 0; | 146 | 356 | UInt32 to_precision = 0; | 147 | 356 | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | 356 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | 356 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | 356 | to_precision = to_max_digits; | 163 | 356 | } | 164 | | | 165 | 356 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 356 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 356 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 356 | if (to_scale > from_scale) { | 170 | 0 | multiply_may_overflow &= | 171 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 0 | } | 173 | 357 | return narrow_integral || multiply_may_overflow; | 174 | 356 | } | 175 | 0 | return false; | 176 | 356 | }); |
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 | 123 | 56 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 56 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 56 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 56 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 56 | using FromFieldType = typename FromDataType::FieldType; | 133 | 56 | using ToFieldType = typename ToDataType::FieldType; | 134 | 56 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 56 | UInt32 from_scale = 0; | 136 | | | 137 | 56 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 56 | const auto* from_decimal_type = | 139 | 56 | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 56 | from_precision = | 141 | 56 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 56 | from_scale = from_decimal_type->get_scale(); | 143 | 56 | } | 144 | | | 145 | 56 | UInt32 to_max_digits = 0; | 146 | 56 | UInt32 to_precision = 0; | 147 | 56 | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | 56 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | 56 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | 56 | to_precision = to_max_digits; | 163 | 56 | } | 164 | | | 165 | 56 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 56 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 56 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 56 | if (to_scale > from_scale) { | 170 | 0 | multiply_may_overflow &= | 171 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 0 | } | 173 | 56 | return narrow_integral || multiply_may_overflow; | 174 | 56 | } | 175 | 0 | return false; | 176 | 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 | 123 | 786 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 786 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 786 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 786 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 786 | using FromFieldType = typename FromDataType::FieldType; | 133 | 786 | using ToFieldType = typename ToDataType::FieldType; | 134 | 786 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 786 | UInt32 from_scale = 0; | 136 | | | 137 | 786 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 786 | const auto* from_decimal_type = | 139 | 786 | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 786 | from_precision = | 141 | 786 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 786 | from_scale = from_decimal_type->get_scale(); | 143 | 786 | } | 144 | | | 145 | 786 | UInt32 to_max_digits = 0; | 146 | 786 | UInt32 to_precision = 0; | 147 | 786 | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | 786 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | 786 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | 786 | to_precision = to_max_digits; | 163 | 786 | } | 164 | | | 165 | 786 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 786 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 786 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 786 | if (to_scale > from_scale) { | 170 | 0 | multiply_may_overflow &= | 171 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 0 | } | 173 | 786 | return narrow_integral || multiply_may_overflow; | 174 | 786 | } | 175 | 0 | return false; | 176 | 786 | }); |
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 | 123 | 540 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 540 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 540 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 540 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 540 | using FromFieldType = typename FromDataType::FieldType; | 133 | 540 | using ToFieldType = typename ToDataType::FieldType; | 134 | 540 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 540 | UInt32 from_scale = 0; | 136 | | | 137 | 540 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 540 | const auto* from_decimal_type = | 139 | 540 | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 540 | from_precision = | 141 | 540 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 540 | from_scale = from_decimal_type->get_scale(); | 143 | 540 | } | 144 | | | 145 | 540 | UInt32 to_max_digits = 0; | 146 | 540 | UInt32 to_precision = 0; | 147 | 540 | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | 540 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | 540 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | 540 | to_precision = to_max_digits; | 163 | 540 | } | 164 | | | 165 | 540 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 540 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 540 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 540 | if (to_scale > from_scale) { | 170 | 0 | multiply_may_overflow &= | 171 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 0 | } | 173 | 540 | return narrow_integral || multiply_may_overflow; | 174 | 540 | } | 175 | 0 | return false; | 176 | 540 | }); |
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 | 123 | 89 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 89 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 89 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 89 | return false; | 176 | 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 | 123 | 7.84k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 7.84k | using Types2 = std::decay_t<decltype(types2)>; | 125 | 7.84k | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 7.84k | return false; | 176 | 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 | 123 | 162 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 162 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 162 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 162 | return false; | 176 | 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 | 123 | 6.61k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 6.61k | using Types2 = std::decay_t<decltype(types2)>; | 125 | 6.61k | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | 6.61k | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | 6.61k | return false; | 130 | 6.61k | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 6.61k | return false; | 176 | 6.61k | }); |
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 | 123 | 19 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 19 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 19 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 19 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 19 | using FromFieldType = typename FromDataType::FieldType; | 133 | 19 | using ToFieldType = typename ToDataType::FieldType; | 134 | 19 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 19 | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | 19 | UInt32 to_max_digits = 0; | 146 | 19 | UInt32 to_precision = 0; | 147 | 19 | UInt32 to_scale = 0; | 148 | | | 149 | 19 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 19 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 19 | const auto* to_decimal_type = | 153 | 19 | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 19 | to_precision = to_decimal_type->get_precision(); | 155 | 19 | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 19 | to_scale = to_decimal_type->get_scale(); | 158 | 19 | ToDataType::check_type_scale(to_scale); | 159 | 19 | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | 19 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 19 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 19 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 19 | if (to_scale > from_scale) { | 170 | 18 | multiply_may_overflow &= | 171 | 18 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 18 | } | 173 | 19 | return narrow_integral || multiply_may_overflow; | 174 | 19 | } | 175 | 0 | return false; | 176 | 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 | 123 | 469 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 469 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 469 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 469 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 469 | using FromFieldType = typename FromDataType::FieldType; | 133 | 469 | using ToFieldType = typename ToDataType::FieldType; | 134 | 469 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 469 | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | 469 | UInt32 to_max_digits = 0; | 146 | 469 | UInt32 to_precision = 0; | 147 | 469 | UInt32 to_scale = 0; | 148 | | | 149 | 469 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 469 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 469 | const auto* to_decimal_type = | 153 | 469 | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 469 | to_precision = to_decimal_type->get_precision(); | 155 | 469 | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 469 | to_scale = to_decimal_type->get_scale(); | 158 | 469 | ToDataType::check_type_scale(to_scale); | 159 | 469 | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | 469 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 469 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 469 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 469 | if (to_scale > from_scale) { | 170 | 266 | multiply_may_overflow &= | 171 | 266 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 266 | } | 173 | 469 | return narrow_integral || multiply_may_overflow; | 174 | 469 | } | 175 | 0 | return false; | 176 | 469 | }); |
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 | 123 | 501 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 501 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 501 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 501 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 501 | using FromFieldType = typename FromDataType::FieldType; | 133 | 501 | using ToFieldType = typename ToDataType::FieldType; | 134 | 501 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 501 | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | 501 | UInt32 to_max_digits = 0; | 146 | 501 | UInt32 to_precision = 0; | 147 | 501 | UInt32 to_scale = 0; | 148 | | | 149 | 501 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 501 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 501 | const auto* to_decimal_type = | 153 | 501 | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 501 | to_precision = to_decimal_type->get_precision(); | 155 | 501 | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 501 | to_scale = to_decimal_type->get_scale(); | 158 | 501 | ToDataType::check_type_scale(to_scale); | 159 | 501 | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | 501 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 501 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 501 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 501 | if (to_scale > from_scale) { | 170 | 252 | multiply_may_overflow &= | 171 | 252 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 252 | } | 173 | 501 | return narrow_integral || multiply_may_overflow; | 174 | 501 | } | 175 | 0 | return false; | 176 | 501 | }); |
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 | 123 | 553 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 553 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 553 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 553 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 553 | using FromFieldType = typename FromDataType::FieldType; | 133 | 553 | using ToFieldType = typename ToDataType::FieldType; | 134 | 553 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 553 | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | 553 | UInt32 to_max_digits = 0; | 146 | 553 | UInt32 to_precision = 0; | 147 | 553 | UInt32 to_scale = 0; | 148 | | | 149 | 553 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 553 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 553 | const auto* to_decimal_type = | 153 | 553 | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 553 | to_precision = to_decimal_type->get_precision(); | 155 | 553 | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 553 | to_scale = to_decimal_type->get_scale(); | 158 | 553 | ToDataType::check_type_scale(to_scale); | 159 | 553 | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | 553 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 553 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 553 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 553 | if (to_scale > from_scale) { | 170 | 280 | multiply_may_overflow &= | 171 | 280 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 280 | } | 173 | 553 | return narrow_integral || multiply_may_overflow; | 174 | 553 | } | 175 | 0 | return false; | 176 | 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 | 123 | 612 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 612 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 612 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 612 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 612 | using FromFieldType = typename FromDataType::FieldType; | 133 | 612 | using ToFieldType = typename ToDataType::FieldType; | 134 | 612 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 612 | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | 612 | UInt32 to_max_digits = 0; | 146 | 612 | UInt32 to_precision = 0; | 147 | 612 | UInt32 to_scale = 0; | 148 | | | 149 | 612 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 612 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 612 | const auto* to_decimal_type = | 153 | 612 | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 612 | to_precision = to_decimal_type->get_precision(); | 155 | 612 | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 612 | to_scale = to_decimal_type->get_scale(); | 158 | 612 | ToDataType::check_type_scale(to_scale); | 159 | 612 | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | 612 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 612 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 612 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 612 | if (to_scale > from_scale) { | 170 | 266 | multiply_may_overflow &= | 171 | 266 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 266 | } | 173 | 612 | return narrow_integral || multiply_may_overflow; | 174 | 612 | } | 175 | 0 | return false; | 176 | 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 | 123 | 549 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 549 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 549 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 549 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 549 | using FromFieldType = typename FromDataType::FieldType; | 133 | 549 | using ToFieldType = typename ToDataType::FieldType; | 134 | 549 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 549 | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | 549 | UInt32 to_max_digits = 0; | 146 | 549 | UInt32 to_precision = 0; | 147 | 549 | UInt32 to_scale = 0; | 148 | | | 149 | 549 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 549 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 549 | const auto* to_decimal_type = | 153 | 549 | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 549 | to_precision = to_decimal_type->get_precision(); | 155 | 549 | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 549 | to_scale = to_decimal_type->get_scale(); | 158 | 549 | ToDataType::check_type_scale(to_scale); | 159 | 549 | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | 549 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 549 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 549 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 549 | if (to_scale > from_scale) { | 170 | 278 | multiply_may_overflow &= | 171 | 278 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 278 | } | 173 | 549 | return narrow_integral || multiply_may_overflow; | 174 | 549 | } | 175 | 0 | return false; | 176 | 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 | 123 | 104 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 104 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 104 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 104 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 104 | using FromFieldType = typename FromDataType::FieldType; | 133 | 104 | using ToFieldType = typename ToDataType::FieldType; | 134 | 104 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 104 | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | 104 | UInt32 to_max_digits = 0; | 146 | 104 | UInt32 to_precision = 0; | 147 | 104 | UInt32 to_scale = 0; | 148 | | | 149 | 104 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 104 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 104 | const auto* to_decimal_type = | 153 | 104 | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 104 | to_precision = to_decimal_type->get_precision(); | 155 | 104 | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 104 | to_scale = to_decimal_type->get_scale(); | 158 | 104 | ToDataType::check_type_scale(to_scale); | 159 | 104 | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | 104 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 104 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 104 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 104 | if (to_scale > from_scale) { | 170 | 68 | multiply_may_overflow &= | 171 | 68 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 68 | } | 173 | 104 | return narrow_integral || multiply_may_overflow; | 174 | 104 | } | 175 | 0 | return false; | 176 | 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 | 123 | 308 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 308 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 308 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 308 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 308 | using FromFieldType = typename FromDataType::FieldType; | 133 | 308 | using ToFieldType = typename ToDataType::FieldType; | 134 | 308 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 308 | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | 308 | UInt32 to_max_digits = 0; | 146 | 308 | UInt32 to_precision = 0; | 147 | 308 | UInt32 to_scale = 0; | 148 | | | 149 | 308 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 308 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 308 | const auto* to_decimal_type = | 153 | 308 | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 308 | to_precision = to_decimal_type->get_precision(); | 155 | 308 | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 308 | to_scale = to_decimal_type->get_scale(); | 158 | 308 | ToDataType::check_type_scale(to_scale); | 159 | 308 | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | 308 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 308 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 308 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 308 | if (to_scale > from_scale) { | 170 | 258 | multiply_may_overflow &= | 171 | 258 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 258 | } | 173 | 308 | return narrow_integral || multiply_may_overflow; | 174 | 308 | } | 175 | 0 | return false; | 176 | 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 | 123 | 396 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 396 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 396 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 396 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 396 | using FromFieldType = typename FromDataType::FieldType; | 133 | 396 | using ToFieldType = typename ToDataType::FieldType; | 134 | 396 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 396 | UInt32 from_scale = 0; | 136 | | | 137 | 396 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 396 | const auto* from_decimal_type = | 139 | 396 | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 396 | from_precision = | 141 | 396 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 396 | from_scale = from_decimal_type->get_scale(); | 143 | 396 | } | 144 | | | 145 | 396 | UInt32 to_max_digits = 0; | 146 | 396 | UInt32 to_precision = 0; | 147 | 396 | UInt32 to_scale = 0; | 148 | | | 149 | 396 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 396 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 396 | const auto* to_decimal_type = | 153 | 396 | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 396 | to_precision = to_decimal_type->get_precision(); | 155 | 396 | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 396 | to_scale = to_decimal_type->get_scale(); | 158 | 396 | ToDataType::check_type_scale(to_scale); | 159 | 396 | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | 396 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 396 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 396 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 396 | if (to_scale > from_scale) { | 170 | 90 | multiply_may_overflow &= | 171 | 90 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 90 | } | 173 | 396 | return narrow_integral || multiply_may_overflow; | 174 | 396 | } | 175 | 0 | return false; | 176 | 396 | }); |
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 | 123 | 620 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 620 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 620 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 620 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 620 | using FromFieldType = typename FromDataType::FieldType; | 133 | 620 | using ToFieldType = typename ToDataType::FieldType; | 134 | 620 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 620 | UInt32 from_scale = 0; | 136 | | | 137 | 620 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 620 | const auto* from_decimal_type = | 139 | 620 | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 620 | from_precision = | 141 | 620 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 620 | from_scale = from_decimal_type->get_scale(); | 143 | 620 | } | 144 | | | 145 | 620 | UInt32 to_max_digits = 0; | 146 | 620 | UInt32 to_precision = 0; | 147 | 620 | UInt32 to_scale = 0; | 148 | | | 149 | 620 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 620 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 620 | const auto* to_decimal_type = | 153 | 620 | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 620 | to_precision = to_decimal_type->get_precision(); | 155 | 620 | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 620 | to_scale = to_decimal_type->get_scale(); | 158 | 620 | ToDataType::check_type_scale(to_scale); | 159 | 620 | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | 620 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 620 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 620 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 620 | if (to_scale > from_scale) { | 170 | 198 | multiply_may_overflow &= | 171 | 198 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 198 | } | 173 | 620 | return narrow_integral || multiply_may_overflow; | 174 | 620 | } | 175 | 0 | return false; | 176 | 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 | 123 | 206 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 206 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 206 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 206 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 206 | using FromFieldType = typename FromDataType::FieldType; | 133 | 206 | using ToFieldType = typename ToDataType::FieldType; | 134 | 206 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 206 | UInt32 from_scale = 0; | 136 | | | 137 | 206 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 206 | const auto* from_decimal_type = | 139 | 206 | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 206 | from_precision = | 141 | 206 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 206 | from_scale = from_decimal_type->get_scale(); | 143 | 206 | } | 144 | | | 145 | 206 | UInt32 to_max_digits = 0; | 146 | 206 | UInt32 to_precision = 0; | 147 | 206 | UInt32 to_scale = 0; | 148 | | | 149 | 206 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 206 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 206 | const auto* to_decimal_type = | 153 | 206 | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 206 | to_precision = to_decimal_type->get_precision(); | 155 | 206 | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 206 | to_scale = to_decimal_type->get_scale(); | 158 | 206 | ToDataType::check_type_scale(to_scale); | 159 | 206 | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | 206 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 206 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 206 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 206 | if (to_scale > from_scale) { | 170 | 0 | multiply_may_overflow &= | 171 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 0 | } | 173 | 206 | return narrow_integral || multiply_may_overflow; | 174 | 206 | } | 175 | 0 | return false; | 176 | 206 | }); |
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 | 123 | 4.31k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 4.31k | using Types2 = std::decay_t<decltype(types2)>; | 125 | 4.31k | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 4.31k | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 4.31k | using FromFieldType = typename FromDataType::FieldType; | 133 | 4.31k | using ToFieldType = typename ToDataType::FieldType; | 134 | 4.31k | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 4.31k | UInt32 from_scale = 0; | 136 | | | 137 | 4.31k | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 4.31k | const auto* from_decimal_type = | 139 | 4.31k | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 4.31k | from_precision = | 141 | 4.31k | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 4.31k | from_scale = from_decimal_type->get_scale(); | 143 | 4.31k | } | 144 | | | 145 | 4.31k | UInt32 to_max_digits = 0; | 146 | 4.31k | UInt32 to_precision = 0; | 147 | 4.31k | UInt32 to_scale = 0; | 148 | | | 149 | 4.31k | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 4.31k | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 4.31k | const auto* to_decimal_type = | 153 | 4.31k | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 4.31k | to_precision = to_decimal_type->get_precision(); | 155 | 4.31k | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 4.31k | to_scale = to_decimal_type->get_scale(); | 158 | 4.31k | ToDataType::check_type_scale(to_scale); | 159 | 4.31k | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | 4.31k | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 4.31k | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 4.31k | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 4.31k | if (to_scale > from_scale) { | 170 | 139 | multiply_may_overflow &= | 171 | 139 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 139 | } | 173 | 4.31k | return narrow_integral || multiply_may_overflow; | 174 | 4.31k | } | 175 | 0 | return false; | 176 | 4.31k | }); |
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 | 123 | 303 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 303 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 303 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 303 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 303 | using FromFieldType = typename FromDataType::FieldType; | 133 | 303 | using ToFieldType = typename ToDataType::FieldType; | 134 | 303 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 303 | UInt32 from_scale = 0; | 136 | | | 137 | 303 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 303 | const auto* from_decimal_type = | 139 | 303 | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 303 | from_precision = | 141 | 303 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 303 | from_scale = from_decimal_type->get_scale(); | 143 | 303 | } | 144 | | | 145 | 303 | UInt32 to_max_digits = 0; | 146 | 303 | UInt32 to_precision = 0; | 147 | 303 | UInt32 to_scale = 0; | 148 | | | 149 | 303 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 303 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 303 | const auto* to_decimal_type = | 153 | 303 | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 303 | to_precision = to_decimal_type->get_precision(); | 155 | 303 | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 303 | to_scale = to_decimal_type->get_scale(); | 158 | 303 | ToDataType::check_type_scale(to_scale); | 159 | 303 | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | 303 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 303 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 303 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 303 | if (to_scale > from_scale) { | 170 | 79 | multiply_may_overflow &= | 171 | 79 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 79 | } | 173 | 303 | return narrow_integral || multiply_may_overflow; | 174 | 303 | } | 175 | 0 | return false; | 176 | 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 | 123 | 2.93k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 2.93k | using Types2 = std::decay_t<decltype(types2)>; | 125 | 2.93k | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | 2.93k | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | 2.93k | return false; | 130 | 2.93k | } | 131 | 2.93k | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 2.93k | using FromFieldType = typename FromDataType::FieldType; | 133 | 2.93k | using ToFieldType = typename ToDataType::FieldType; | 134 | 2.93k | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 2.93k | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | 2.93k | UInt32 to_max_digits = 0; | 146 | 2.93k | UInt32 to_precision = 0; | 147 | 2.93k | UInt32 to_scale = 0; | 148 | | | 149 | 2.93k | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 2.93k | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 2.93k | const auto* to_decimal_type = | 153 | 2.93k | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 2.93k | to_precision = to_decimal_type->get_precision(); | 155 | 2.93k | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 2.93k | to_scale = to_decimal_type->get_scale(); | 158 | 2.93k | ToDataType::check_type_scale(to_scale); | 159 | 2.93k | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | 2.93k | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 2.93k | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 2.93k | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 2.93k | if (to_scale > from_scale) { | 170 | 0 | multiply_may_overflow &= | 171 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 0 | } | 173 | 2.93k | return narrow_integral || multiply_may_overflow; | 174 | 2.93k | } | 175 | 0 | return false; | 176 | 2.93k | }); |
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 | 123 | 17 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 17 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 17 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 17 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 17 | using FromFieldType = typename FromDataType::FieldType; | 133 | 17 | using ToFieldType = typename ToDataType::FieldType; | 134 | 17 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 17 | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | 17 | UInt32 to_max_digits = 0; | 146 | 17 | UInt32 to_precision = 0; | 147 | 17 | UInt32 to_scale = 0; | 148 | | | 149 | 17 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 17 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 17 | const auto* to_decimal_type = | 153 | 17 | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 17 | to_precision = to_decimal_type->get_precision(); | 155 | 17 | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 17 | to_scale = to_decimal_type->get_scale(); | 158 | 17 | ToDataType::check_type_scale(to_scale); | 159 | 17 | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | 17 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 17 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 17 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 17 | if (to_scale > from_scale) { | 170 | 16 | multiply_may_overflow &= | 171 | 16 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 16 | } | 173 | 17 | return narrow_integral || multiply_may_overflow; | 174 | 17 | } | 175 | 0 | return false; | 176 | 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 | 123 | 72 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 72 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 72 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 72 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 72 | using FromFieldType = typename FromDataType::FieldType; | 133 | 72 | using ToFieldType = typename ToDataType::FieldType; | 134 | 72 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 72 | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | 72 | UInt32 to_max_digits = 0; | 146 | 72 | UInt32 to_precision = 0; | 147 | 72 | UInt32 to_scale = 0; | 148 | | | 149 | 72 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 72 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 72 | const auto* to_decimal_type = | 153 | 72 | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 72 | to_precision = to_decimal_type->get_precision(); | 155 | 72 | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 72 | to_scale = to_decimal_type->get_scale(); | 158 | 72 | ToDataType::check_type_scale(to_scale); | 159 | 72 | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | 72 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 72 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 72 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 72 | if (to_scale > from_scale) { | 170 | 59 | multiply_may_overflow &= | 171 | 59 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 59 | } | 173 | 72 | return narrow_integral || multiply_may_overflow; | 174 | 72 | } | 175 | 0 | return false; | 176 | 72 | }); |
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 | 123 | 49 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 49 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 49 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 49 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 49 | using FromFieldType = typename FromDataType::FieldType; | 133 | 49 | using ToFieldType = typename ToDataType::FieldType; | 134 | 49 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 49 | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | 49 | UInt32 to_max_digits = 0; | 146 | 49 | UInt32 to_precision = 0; | 147 | 49 | UInt32 to_scale = 0; | 148 | | | 149 | 49 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 49 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 49 | const auto* to_decimal_type = | 153 | 49 | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 49 | to_precision = to_decimal_type->get_precision(); | 155 | 49 | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 49 | to_scale = to_decimal_type->get_scale(); | 158 | 49 | ToDataType::check_type_scale(to_scale); | 159 | 49 | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | 49 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 49 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 49 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 49 | if (to_scale > from_scale) { | 170 | 38 | multiply_may_overflow &= | 171 | 38 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 38 | } | 173 | 49 | return narrow_integral || multiply_may_overflow; | 174 | 49 | } | 175 | 0 | return false; | 176 | 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 | 123 | 463 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 463 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 463 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 463 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 463 | using FromFieldType = typename FromDataType::FieldType; | 133 | 463 | using ToFieldType = typename ToDataType::FieldType; | 134 | 463 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 463 | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | 463 | UInt32 to_max_digits = 0; | 146 | 463 | UInt32 to_precision = 0; | 147 | 463 | UInt32 to_scale = 0; | 148 | | | 149 | 463 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 463 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 463 | const auto* to_decimal_type = | 153 | 463 | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 463 | to_precision = to_decimal_type->get_precision(); | 155 | 463 | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 463 | to_scale = to_decimal_type->get_scale(); | 158 | 463 | ToDataType::check_type_scale(to_scale); | 159 | 463 | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | 463 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 463 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 463 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 463 | if (to_scale > from_scale) { | 170 | 308 | multiply_may_overflow &= | 171 | 308 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 308 | } | 173 | 463 | return narrow_integral || multiply_may_overflow; | 174 | 463 | } | 175 | 0 | return false; | 176 | 463 | }); |
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 | 123 | 53 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 53 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 53 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 53 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 53 | using FromFieldType = typename FromDataType::FieldType; | 133 | 53 | using ToFieldType = typename ToDataType::FieldType; | 134 | 53 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 53 | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | 53 | UInt32 to_max_digits = 0; | 146 | 53 | UInt32 to_precision = 0; | 147 | 53 | UInt32 to_scale = 0; | 148 | | | 149 | 53 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 53 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 53 | const auto* to_decimal_type = | 153 | 53 | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 53 | to_precision = to_decimal_type->get_precision(); | 155 | 53 | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 53 | to_scale = to_decimal_type->get_scale(); | 158 | 53 | ToDataType::check_type_scale(to_scale); | 159 | 53 | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | 53 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 53 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 53 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 53 | if (to_scale > from_scale) { | 170 | 32 | multiply_may_overflow &= | 171 | 32 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 32 | } | 173 | 53 | return narrow_integral || multiply_may_overflow; | 174 | 53 | } | 175 | 0 | return false; | 176 | 53 | }); |
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 | 123 | 65 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 65 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 65 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 65 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 65 | using FromFieldType = typename FromDataType::FieldType; | 133 | 65 | using ToFieldType = typename ToDataType::FieldType; | 134 | 65 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 65 | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | 65 | UInt32 to_max_digits = 0; | 146 | 65 | UInt32 to_precision = 0; | 147 | 65 | UInt32 to_scale = 0; | 148 | | | 149 | 65 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 65 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 65 | const auto* to_decimal_type = | 153 | 65 | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 65 | to_precision = to_decimal_type->get_precision(); | 155 | 65 | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 65 | to_scale = to_decimal_type->get_scale(); | 158 | 65 | ToDataType::check_type_scale(to_scale); | 159 | 65 | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | 65 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 65 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 65 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 65 | if (to_scale > from_scale) { | 170 | 39 | multiply_may_overflow &= | 171 | 39 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 39 | } | 173 | 65 | return narrow_integral || multiply_may_overflow; | 174 | 65 | } | 175 | 0 | return false; | 176 | 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 | 123 | 107 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 107 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 107 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 107 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 107 | using FromFieldType = typename FromDataType::FieldType; | 133 | 107 | using ToFieldType = typename ToDataType::FieldType; | 134 | 107 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 107 | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | 107 | UInt32 to_max_digits = 0; | 146 | 107 | UInt32 to_precision = 0; | 147 | 107 | UInt32 to_scale = 0; | 148 | | | 149 | 107 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 107 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 107 | const auto* to_decimal_type = | 153 | 107 | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 107 | to_precision = to_decimal_type->get_precision(); | 155 | 107 | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 107 | to_scale = to_decimal_type->get_scale(); | 158 | 107 | ToDataType::check_type_scale(to_scale); | 159 | 107 | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | 107 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 107 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 107 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 107 | if (to_scale > from_scale) { | 170 | 65 | multiply_may_overflow &= | 171 | 65 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 65 | } | 173 | 107 | return narrow_integral || multiply_may_overflow; | 174 | 107 | } | 175 | 0 | return false; | 176 | 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 | 123 | 215 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 215 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 215 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 215 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 215 | using FromFieldType = typename FromDataType::FieldType; | 133 | 215 | using ToFieldType = typename ToDataType::FieldType; | 134 | 215 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 215 | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | 215 | UInt32 to_max_digits = 0; | 146 | 215 | UInt32 to_precision = 0; | 147 | 215 | UInt32 to_scale = 0; | 148 | | | 149 | 215 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 215 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 215 | const auto* to_decimal_type = | 153 | 215 | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 215 | to_precision = to_decimal_type->get_precision(); | 155 | 215 | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 215 | to_scale = to_decimal_type->get_scale(); | 158 | 215 | ToDataType::check_type_scale(to_scale); | 159 | 215 | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | 215 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 215 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 215 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 215 | if (to_scale > from_scale) { | 170 | 182 | multiply_may_overflow &= | 171 | 182 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 182 | } | 173 | 215 | return narrow_integral || multiply_may_overflow; | 174 | 215 | } | 175 | 0 | return false; | 176 | 215 | }); |
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 | 123 | 1.11k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 1.11k | using Types2 = std::decay_t<decltype(types2)>; | 125 | 1.11k | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 1.11k | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 1.11k | using FromFieldType = typename FromDataType::FieldType; | 133 | 1.11k | using ToFieldType = typename ToDataType::FieldType; | 134 | 1.11k | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 1.11k | UInt32 from_scale = 0; | 136 | | | 137 | 1.11k | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 1.11k | const auto* from_decimal_type = | 139 | 1.11k | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 1.11k | from_precision = | 141 | 1.11k | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 1.11k | from_scale = from_decimal_type->get_scale(); | 143 | 1.11k | } | 144 | | | 145 | 1.11k | UInt32 to_max_digits = 0; | 146 | 1.11k | UInt32 to_precision = 0; | 147 | 1.11k | UInt32 to_scale = 0; | 148 | | | 149 | 1.11k | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 1.11k | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 1.11k | const auto* to_decimal_type = | 153 | 1.11k | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 1.11k | to_precision = to_decimal_type->get_precision(); | 155 | 1.11k | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 1.11k | to_scale = to_decimal_type->get_scale(); | 158 | 1.11k | ToDataType::check_type_scale(to_scale); | 159 | 1.11k | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | 1.11k | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 1.11k | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 1.11k | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 1.11k | if (to_scale > from_scale) { | 170 | 767 | multiply_may_overflow &= | 171 | 767 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 767 | } | 173 | 1.11k | return narrow_integral || multiply_may_overflow; | 174 | 1.11k | } | 175 | 0 | return false; | 176 | 1.11k | }); |
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 | 123 | 10.0k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 10.0k | using Types2 = std::decay_t<decltype(types2)>; | 125 | 10.0k | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 10.0k | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 10.0k | using FromFieldType = typename FromDataType::FieldType; | 133 | 10.0k | using ToFieldType = typename ToDataType::FieldType; | 134 | 10.0k | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 10.0k | UInt32 from_scale = 0; | 136 | | | 137 | 10.0k | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 10.0k | const auto* from_decimal_type = | 139 | 10.0k | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 10.0k | from_precision = | 141 | 10.0k | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 10.0k | from_scale = from_decimal_type->get_scale(); | 143 | 10.0k | } | 144 | | | 145 | 10.0k | UInt32 to_max_digits = 0; | 146 | 10.0k | UInt32 to_precision = 0; | 147 | 10.0k | UInt32 to_scale = 0; | 148 | | | 149 | 10.0k | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 10.0k | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 10.0k | const auto* to_decimal_type = | 153 | 10.0k | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 10.0k | to_precision = to_decimal_type->get_precision(); | 155 | 10.0k | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 10.0k | to_scale = to_decimal_type->get_scale(); | 158 | 10.0k | ToDataType::check_type_scale(to_scale); | 159 | 10.0k | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | 10.0k | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 10.0k | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 10.0k | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 10.0k | if (to_scale > from_scale) { | 170 | 157 | multiply_may_overflow &= | 171 | 157 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 157 | } | 173 | 10.0k | return narrow_integral || multiply_may_overflow; | 174 | 10.0k | } | 175 | 0 | return false; | 176 | 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 | 123 | 224 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 224 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 224 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 224 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 224 | using FromFieldType = typename FromDataType::FieldType; | 133 | 224 | using ToFieldType = typename ToDataType::FieldType; | 134 | 224 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 224 | UInt32 from_scale = 0; | 136 | | | 137 | 224 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 224 | const auto* from_decimal_type = | 139 | 224 | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 224 | from_precision = | 141 | 224 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 224 | from_scale = from_decimal_type->get_scale(); | 143 | 224 | } | 144 | | | 145 | 224 | UInt32 to_max_digits = 0; | 146 | 224 | UInt32 to_precision = 0; | 147 | 224 | UInt32 to_scale = 0; | 148 | | | 149 | 224 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 224 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 224 | const auto* to_decimal_type = | 153 | 224 | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 224 | to_precision = to_decimal_type->get_precision(); | 155 | 224 | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 224 | to_scale = to_decimal_type->get_scale(); | 158 | 224 | ToDataType::check_type_scale(to_scale); | 159 | 224 | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | 224 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 224 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 224 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 224 | if (to_scale > from_scale) { | 170 | 50 | multiply_may_overflow &= | 171 | 50 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 50 | } | 173 | 224 | return narrow_integral || multiply_may_overflow; | 174 | 224 | } | 175 | 0 | return false; | 176 | 224 | }); |
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 | 123 | 10.7k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 10.7k | using Types2 = std::decay_t<decltype(types2)>; | 125 | 10.7k | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 10.7k | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 10.7k | using FromFieldType = typename FromDataType::FieldType; | 133 | 10.7k | using ToFieldType = typename ToDataType::FieldType; | 134 | 10.7k | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 10.7k | UInt32 from_scale = 0; | 136 | | | 137 | 10.7k | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 10.7k | const auto* from_decimal_type = | 139 | 10.7k | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 10.7k | from_precision = | 141 | 10.7k | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 10.7k | from_scale = from_decimal_type->get_scale(); | 143 | 10.7k | } | 144 | | | 145 | 10.7k | UInt32 to_max_digits = 0; | 146 | 10.7k | UInt32 to_precision = 0; | 147 | 10.7k | UInt32 to_scale = 0; | 148 | | | 149 | 10.7k | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 10.7k | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 10.7k | const auto* to_decimal_type = | 153 | 10.7k | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 10.7k | to_precision = to_decimal_type->get_precision(); | 155 | 10.7k | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 10.7k | to_scale = to_decimal_type->get_scale(); | 158 | 10.7k | ToDataType::check_type_scale(to_scale); | 159 | 10.7k | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | 10.7k | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 10.7k | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 10.7k | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 10.7k | if (to_scale > from_scale) { | 170 | 144 | multiply_may_overflow &= | 171 | 144 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 144 | } | 173 | 10.7k | return narrow_integral || multiply_may_overflow; | 174 | 10.7k | } | 175 | 0 | return false; | 176 | 10.7k | }); |
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 | 123 | 401 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 401 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 401 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 401 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 401 | using FromFieldType = typename FromDataType::FieldType; | 133 | 401 | using ToFieldType = typename ToDataType::FieldType; | 134 | 401 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 401 | UInt32 from_scale = 0; | 136 | | | 137 | 401 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 401 | const auto* from_decimal_type = | 139 | 401 | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 401 | from_precision = | 141 | 401 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 401 | from_scale = from_decimal_type->get_scale(); | 143 | 401 | } | 144 | | | 145 | 401 | UInt32 to_max_digits = 0; | 146 | 401 | UInt32 to_precision = 0; | 147 | 401 | UInt32 to_scale = 0; | 148 | | | 149 | 401 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 401 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 401 | const auto* to_decimal_type = | 153 | 401 | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 401 | to_precision = to_decimal_type->get_precision(); | 155 | 401 | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 401 | to_scale = to_decimal_type->get_scale(); | 158 | 401 | ToDataType::check_type_scale(to_scale); | 159 | 401 | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | 401 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 401 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 401 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 401 | if (to_scale > from_scale) { | 170 | 137 | multiply_may_overflow &= | 171 | 137 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 137 | } | 173 | 401 | return narrow_integral || multiply_may_overflow; | 174 | 401 | } | 175 | 0 | return false; | 176 | 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 | 123 | 7.93k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 7.93k | using Types2 = std::decay_t<decltype(types2)>; | 125 | 7.93k | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | 7.93k | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | 7.93k | return false; | 130 | 7.93k | } | 131 | 7.93k | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 7.93k | using FromFieldType = typename FromDataType::FieldType; | 133 | 7.93k | using ToFieldType = typename ToDataType::FieldType; | 134 | 7.93k | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 7.93k | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | 7.93k | UInt32 to_max_digits = 0; | 146 | 7.93k | UInt32 to_precision = 0; | 147 | 7.93k | UInt32 to_scale = 0; | 148 | | | 149 | 7.93k | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 7.93k | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 7.93k | const auto* to_decimal_type = | 153 | 7.93k | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 7.93k | to_precision = to_decimal_type->get_precision(); | 155 | 7.93k | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 7.93k | to_scale = to_decimal_type->get_scale(); | 158 | 7.93k | ToDataType::check_type_scale(to_scale); | 159 | 7.93k | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | 7.93k | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 7.93k | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 7.93k | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 7.93k | if (to_scale > from_scale) { | 170 | 0 | multiply_may_overflow &= | 171 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 0 | } | 173 | 7.93k | return narrow_integral || multiply_may_overflow; | 174 | 7.93k | } | 175 | 0 | return false; | 176 | 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 | 123 | 20 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 20 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 20 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 20 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 20 | using FromFieldType = typename FromDataType::FieldType; | 133 | 20 | using ToFieldType = typename ToDataType::FieldType; | 134 | 20 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 20 | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | 20 | UInt32 to_max_digits = 0; | 146 | 20 | UInt32 to_precision = 0; | 147 | 20 | UInt32 to_scale = 0; | 148 | | | 149 | 20 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 20 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 20 | const auto* to_decimal_type = | 153 | 20 | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 20 | to_precision = to_decimal_type->get_precision(); | 155 | 20 | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 20 | to_scale = to_decimal_type->get_scale(); | 158 | 20 | ToDataType::check_type_scale(to_scale); | 159 | 20 | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | 20 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 20 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 20 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 20 | if (to_scale > from_scale) { | 170 | 20 | multiply_may_overflow &= | 171 | 20 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 20 | } | 173 | 20 | return narrow_integral || multiply_may_overflow; | 174 | 20 | } | 175 | 0 | return false; | 176 | 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 | 123 | 16 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 16 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 16 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 16 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 16 | using FromFieldType = typename FromDataType::FieldType; | 133 | 16 | using ToFieldType = typename ToDataType::FieldType; | 134 | 16 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 16 | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | 16 | UInt32 to_max_digits = 0; | 146 | 16 | UInt32 to_precision = 0; | 147 | 16 | UInt32 to_scale = 0; | 148 | | | 149 | 16 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 16 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 16 | const auto* to_decimal_type = | 153 | 16 | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 16 | to_precision = to_decimal_type->get_precision(); | 155 | 16 | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 16 | to_scale = to_decimal_type->get_scale(); | 158 | 16 | ToDataType::check_type_scale(to_scale); | 159 | 16 | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | 16 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 16 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 16 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 16 | if (to_scale > from_scale) { | 170 | 16 | multiply_may_overflow &= | 171 | 16 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 16 | } | 173 | 16 | return narrow_integral || multiply_may_overflow; | 174 | 16 | } | 175 | 0 | return false; | 176 | 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 | 123 | 16 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 16 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 16 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 16 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 16 | using FromFieldType = typename FromDataType::FieldType; | 133 | 16 | using ToFieldType = typename ToDataType::FieldType; | 134 | 16 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 16 | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | 16 | UInt32 to_max_digits = 0; | 146 | 16 | UInt32 to_precision = 0; | 147 | 16 | UInt32 to_scale = 0; | 148 | | | 149 | 16 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 16 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 16 | const auto* to_decimal_type = | 153 | 16 | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 16 | to_precision = to_decimal_type->get_precision(); | 155 | 16 | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 16 | to_scale = to_decimal_type->get_scale(); | 158 | 16 | ToDataType::check_type_scale(to_scale); | 159 | 16 | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | 16 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 16 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 16 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 16 | if (to_scale > from_scale) { | 170 | 16 | multiply_may_overflow &= | 171 | 16 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 16 | } | 173 | 16 | return narrow_integral || multiply_may_overflow; | 174 | 16 | } | 175 | 0 | return false; | 176 | 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 | 123 | 16 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 16 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 16 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 16 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 16 | using FromFieldType = typename FromDataType::FieldType; | 133 | 16 | using ToFieldType = typename ToDataType::FieldType; | 134 | 16 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 16 | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | 16 | UInt32 to_max_digits = 0; | 146 | 16 | UInt32 to_precision = 0; | 147 | 16 | UInt32 to_scale = 0; | 148 | | | 149 | 16 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 16 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 16 | const auto* to_decimal_type = | 153 | 16 | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 16 | to_precision = to_decimal_type->get_precision(); | 155 | 16 | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 16 | to_scale = to_decimal_type->get_scale(); | 158 | 16 | ToDataType::check_type_scale(to_scale); | 159 | 16 | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | 16 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 16 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 16 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 16 | if (to_scale > from_scale) { | 170 | 16 | multiply_may_overflow &= | 171 | 16 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 16 | } | 173 | 16 | return narrow_integral || multiply_may_overflow; | 174 | 16 | } | 175 | 0 | return false; | 176 | 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 | 123 | 32 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 32 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 32 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 32 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 32 | using FromFieldType = typename FromDataType::FieldType; | 133 | 32 | using ToFieldType = typename ToDataType::FieldType; | 134 | 32 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 32 | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | 32 | UInt32 to_max_digits = 0; | 146 | 32 | UInt32 to_precision = 0; | 147 | 32 | UInt32 to_scale = 0; | 148 | | | 149 | 32 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 32 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 32 | const auto* to_decimal_type = | 153 | 32 | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 32 | to_precision = to_decimal_type->get_precision(); | 155 | 32 | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 32 | to_scale = to_decimal_type->get_scale(); | 158 | 32 | ToDataType::check_type_scale(to_scale); | 159 | 32 | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | 32 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 32 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 32 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 32 | if (to_scale > from_scale) { | 170 | 32 | multiply_may_overflow &= | 171 | 32 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 32 | } | 173 | 32 | return narrow_integral || multiply_may_overflow; | 174 | 32 | } | 175 | 0 | return false; | 176 | 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 | 123 | 127 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 127 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 127 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 127 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 127 | using FromFieldType = typename FromDataType::FieldType; | 133 | 127 | using ToFieldType = typename ToDataType::FieldType; | 134 | 127 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 127 | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | 127 | UInt32 to_max_digits = 0; | 146 | 127 | UInt32 to_precision = 0; | 147 | 127 | UInt32 to_scale = 0; | 148 | | | 149 | 127 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 127 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 127 | const auto* to_decimal_type = | 153 | 127 | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 127 | to_precision = to_decimal_type->get_precision(); | 155 | 127 | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 127 | to_scale = to_decimal_type->get_scale(); | 158 | 127 | ToDataType::check_type_scale(to_scale); | 159 | 127 | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | 127 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 128 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 127 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 128 | if (to_scale > from_scale) { | 170 | 128 | multiply_may_overflow &= | 171 | 128 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 128 | } | 173 | 127 | return narrow_integral || multiply_may_overflow; | 174 | 127 | } | 175 | 0 | return false; | 176 | 127 | }); |
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 | 123 | 1 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 1 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 1 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | 1 | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | 1 | return false; | 130 | 1 | } | 131 | 1 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 1 | using FromFieldType = typename FromDataType::FieldType; | 133 | 1 | using ToFieldType = typename ToDataType::FieldType; | 134 | 1 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 1 | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | 1 | UInt32 to_max_digits = 0; | 146 | 1 | UInt32 to_precision = 0; | 147 | 1 | UInt32 to_scale = 0; | 148 | | | 149 | 1 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 1 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 1 | const auto* to_decimal_type = | 153 | 1 | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 1 | to_precision = to_decimal_type->get_precision(); | 155 | 1 | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 1 | to_scale = to_decimal_type->get_scale(); | 158 | 1 | ToDataType::check_type_scale(to_scale); | 159 | 1 | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | 1 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 1 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 1 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 1 | if (to_scale > from_scale) { | 170 | 0 | multiply_may_overflow &= | 171 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 0 | } | 173 | 1 | return narrow_integral || multiply_may_overflow; | 174 | 1 | } | 175 | 0 | return false; | 176 | 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 | 123 | 23 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 23 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 23 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 23 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 23 | using FromFieldType = typename FromDataType::FieldType; | 133 | 23 | using ToFieldType = typename ToDataType::FieldType; | 134 | 23 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 23 | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | 23 | UInt32 to_max_digits = 0; | 146 | 23 | UInt32 to_precision = 0; | 147 | 23 | UInt32 to_scale = 0; | 148 | | | 149 | 23 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 23 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 23 | const auto* to_decimal_type = | 153 | 23 | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 23 | to_precision = to_decimal_type->get_precision(); | 155 | 23 | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 23 | to_scale = to_decimal_type->get_scale(); | 158 | 23 | ToDataType::check_type_scale(to_scale); | 159 | 23 | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | 23 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 23 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 23 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 23 | if (to_scale > from_scale) { | 170 | 22 | multiply_may_overflow &= | 171 | 22 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 22 | } | 173 | 23 | return narrow_integral || multiply_may_overflow; | 174 | 23 | } | 175 | 0 | return false; | 176 | 23 | }); |
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 | 123 | 179 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 179 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 179 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 179 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 179 | using FromFieldType = typename FromDataType::FieldType; | 133 | 179 | using ToFieldType = typename ToDataType::FieldType; | 134 | 179 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 179 | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | 179 | UInt32 to_max_digits = 0; | 146 | 179 | UInt32 to_precision = 0; | 147 | 179 | UInt32 to_scale = 0; | 148 | | | 149 | 179 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 179 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 179 | const auto* to_decimal_type = | 153 | 179 | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 179 | to_precision = to_decimal_type->get_precision(); | 155 | 179 | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 179 | to_scale = to_decimal_type->get_scale(); | 158 | 179 | ToDataType::check_type_scale(to_scale); | 159 | 179 | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | 179 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 179 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 179 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 179 | if (to_scale > from_scale) { | 170 | 128 | multiply_may_overflow &= | 171 | 128 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 128 | } | 173 | 179 | return narrow_integral || multiply_may_overflow; | 174 | 179 | } | 175 | 0 | return false; | 176 | 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 | 123 | 166 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 166 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 166 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 166 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 166 | using FromFieldType = typename FromDataType::FieldType; | 133 | 166 | using ToFieldType = typename ToDataType::FieldType; | 134 | 166 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 166 | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | 166 | UInt32 to_max_digits = 0; | 146 | 166 | UInt32 to_precision = 0; | 147 | 166 | UInt32 to_scale = 0; | 148 | | | 149 | 166 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 166 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 166 | const auto* to_decimal_type = | 153 | 166 | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 166 | to_precision = to_decimal_type->get_precision(); | 155 | 166 | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 166 | to_scale = to_decimal_type->get_scale(); | 158 | 166 | ToDataType::check_type_scale(to_scale); | 159 | 166 | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | 166 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 166 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 166 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 166 | if (to_scale > from_scale) { | 170 | 115 | multiply_may_overflow &= | 171 | 115 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 115 | } | 173 | 166 | return narrow_integral || multiply_may_overflow; | 174 | 166 | } | 175 | 0 | return false; | 176 | 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 | 123 | 444 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 444 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 444 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 444 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 444 | using FromFieldType = typename FromDataType::FieldType; | 133 | 444 | using ToFieldType = typename ToDataType::FieldType; | 134 | 444 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 444 | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | 444 | UInt32 to_max_digits = 0; | 146 | 444 | UInt32 to_precision = 0; | 147 | 444 | UInt32 to_scale = 0; | 148 | | | 149 | 444 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 444 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 444 | const auto* to_decimal_type = | 153 | 444 | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 444 | to_precision = to_decimal_type->get_precision(); | 155 | 444 | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 444 | to_scale = to_decimal_type->get_scale(); | 158 | 444 | ToDataType::check_type_scale(to_scale); | 159 | 444 | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | 444 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 444 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 444 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 444 | if (to_scale > from_scale) { | 170 | 388 | multiply_may_overflow &= | 171 | 388 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 388 | } | 173 | 444 | return narrow_integral || multiply_may_overflow; | 174 | 444 | } | 175 | 0 | return false; | 176 | 444 | }); |
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 | 123 | 3.08k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 3.08k | using Types2 = std::decay_t<decltype(types2)>; | 125 | 3.08k | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 3.08k | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 3.08k | using FromFieldType = typename FromDataType::FieldType; | 133 | 3.08k | using ToFieldType = typename ToDataType::FieldType; | 134 | 3.08k | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 3.08k | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | 3.08k | UInt32 to_max_digits = 0; | 146 | 3.08k | UInt32 to_precision = 0; | 147 | 3.08k | UInt32 to_scale = 0; | 148 | | | 149 | 3.08k | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 3.08k | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 3.08k | const auto* to_decimal_type = | 153 | 3.08k | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 3.08k | to_precision = to_decimal_type->get_precision(); | 155 | 3.08k | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 3.08k | to_scale = to_decimal_type->get_scale(); | 158 | 3.08k | ToDataType::check_type_scale(to_scale); | 159 | 3.08k | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | 3.08k | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 3.08k | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 3.08k | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 3.08k | if (to_scale > from_scale) { | 170 | 520 | multiply_may_overflow &= | 171 | 520 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 520 | } | 173 | 3.08k | return narrow_integral || multiply_may_overflow; | 174 | 3.08k | } | 175 | 0 | return false; | 176 | 3.08k | }); |
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 | 123 | 367 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 367 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 367 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 367 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 367 | using FromFieldType = typename FromDataType::FieldType; | 133 | 367 | using ToFieldType = typename ToDataType::FieldType; | 134 | 367 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 367 | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | 367 | UInt32 to_max_digits = 0; | 146 | 367 | UInt32 to_precision = 0; | 147 | 367 | UInt32 to_scale = 0; | 148 | | | 149 | 367 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 367 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 367 | const auto* to_decimal_type = | 153 | 367 | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 367 | to_precision = to_decimal_type->get_precision(); | 155 | 367 | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 367 | to_scale = to_decimal_type->get_scale(); | 158 | 367 | ToDataType::check_type_scale(to_scale); | 159 | 367 | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | 367 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 367 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 367 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 367 | if (to_scale > from_scale) { | 170 | 196 | multiply_may_overflow &= | 171 | 196 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 196 | } | 173 | 367 | return narrow_integral || multiply_may_overflow; | 174 | 367 | } | 175 | 0 | return false; | 176 | 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 | 123 | 248 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 248 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 248 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 248 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 248 | using FromFieldType = typename FromDataType::FieldType; | 133 | 248 | using ToFieldType = typename ToDataType::FieldType; | 134 | 248 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 248 | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | 248 | UInt32 to_max_digits = 0; | 146 | 248 | UInt32 to_precision = 0; | 147 | 248 | UInt32 to_scale = 0; | 148 | | | 149 | 248 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 248 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 248 | const auto* to_decimal_type = | 153 | 248 | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 248 | to_precision = to_decimal_type->get_precision(); | 155 | 248 | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 248 | to_scale = to_decimal_type->get_scale(); | 158 | 248 | ToDataType::check_type_scale(to_scale); | 159 | 248 | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | 248 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 248 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 248 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 248 | if (to_scale > from_scale) { | 170 | 130 | multiply_may_overflow &= | 171 | 130 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 130 | } | 173 | 248 | return narrow_integral || multiply_may_overflow; | 174 | 248 | } | 175 | 0 | return false; | 176 | 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 | 123 | 490 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 490 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 490 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 490 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 490 | using FromFieldType = typename FromDataType::FieldType; | 133 | 490 | using ToFieldType = typename ToDataType::FieldType; | 134 | 490 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 490 | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | 490 | UInt32 to_max_digits = 0; | 146 | 490 | UInt32 to_precision = 0; | 147 | 490 | UInt32 to_scale = 0; | 148 | | | 149 | 490 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 490 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 490 | const auto* to_decimal_type = | 153 | 490 | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 490 | to_precision = to_decimal_type->get_precision(); | 155 | 490 | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 490 | to_scale = to_decimal_type->get_scale(); | 158 | 490 | ToDataType::check_type_scale(to_scale); | 159 | 490 | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | 490 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 490 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 490 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 490 | if (to_scale > from_scale) { | 170 | 380 | multiply_may_overflow &= | 171 | 380 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 380 | } | 173 | 490 | return narrow_integral || multiply_may_overflow; | 174 | 490 | } | 175 | 0 | return false; | 176 | 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 | 123 | 739 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 739 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 739 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 739 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 739 | using FromFieldType = typename FromDataType::FieldType; | 133 | 739 | using ToFieldType = typename ToDataType::FieldType; | 134 | 739 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 739 | UInt32 from_scale = 0; | 136 | | | 137 | 739 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 739 | const auto* from_decimal_type = | 139 | 739 | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 739 | from_precision = | 141 | 739 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 739 | from_scale = from_decimal_type->get_scale(); | 143 | 739 | } | 144 | | | 145 | 739 | UInt32 to_max_digits = 0; | 146 | 739 | UInt32 to_precision = 0; | 147 | 739 | UInt32 to_scale = 0; | 148 | | | 149 | 739 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 739 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 739 | const auto* to_decimal_type = | 153 | 739 | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 739 | to_precision = to_decimal_type->get_precision(); | 155 | 739 | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 739 | to_scale = to_decimal_type->get_scale(); | 158 | 739 | ToDataType::check_type_scale(to_scale); | 159 | 739 | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | 739 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 739 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 739 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 739 | if (to_scale > from_scale) { | 170 | 598 | multiply_may_overflow &= | 171 | 598 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 598 | } | 173 | 739 | return narrow_integral || multiply_may_overflow; | 174 | 739 | } | 175 | 0 | return false; | 176 | 739 | }); |
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 | 123 | 1.60k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 1.60k | using Types2 = std::decay_t<decltype(types2)>; | 125 | 1.60k | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 1.60k | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 1.60k | using FromFieldType = typename FromDataType::FieldType; | 133 | 1.60k | using ToFieldType = typename ToDataType::FieldType; | 134 | 1.60k | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 1.60k | UInt32 from_scale = 0; | 136 | | | 137 | 1.60k | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 1.60k | const auto* from_decimal_type = | 139 | 1.60k | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 1.60k | from_precision = | 141 | 1.60k | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 1.60k | from_scale = from_decimal_type->get_scale(); | 143 | 1.60k | } | 144 | | | 145 | 1.60k | UInt32 to_max_digits = 0; | 146 | 1.60k | UInt32 to_precision = 0; | 147 | 1.60k | UInt32 to_scale = 0; | 148 | | | 149 | 1.60k | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 1.60k | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 1.60k | const auto* to_decimal_type = | 153 | 1.60k | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 1.60k | to_precision = to_decimal_type->get_precision(); | 155 | 1.60k | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 1.60k | to_scale = to_decimal_type->get_scale(); | 158 | 1.60k | ToDataType::check_type_scale(to_scale); | 159 | 1.60k | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | 1.60k | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 1.60k | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 1.60k | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 1.60k | if (to_scale > from_scale) { | 170 | 718 | multiply_may_overflow &= | 171 | 718 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 718 | } | 173 | 1.60k | return narrow_integral || multiply_may_overflow; | 174 | 1.60k | } | 175 | 0 | return false; | 176 | 1.60k | }); |
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 | 123 | 257 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 257 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 257 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 257 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 257 | using FromFieldType = typename FromDataType::FieldType; | 133 | 257 | using ToFieldType = typename ToDataType::FieldType; | 134 | 257 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 257 | UInt32 from_scale = 0; | 136 | | | 137 | 257 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 257 | const auto* from_decimal_type = | 139 | 257 | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 257 | from_precision = | 141 | 257 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 257 | from_scale = from_decimal_type->get_scale(); | 143 | 257 | } | 144 | | | 145 | 257 | UInt32 to_max_digits = 0; | 146 | 257 | UInt32 to_precision = 0; | 147 | 257 | UInt32 to_scale = 0; | 148 | | | 149 | 257 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 257 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 257 | const auto* to_decimal_type = | 153 | 257 | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 257 | to_precision = to_decimal_type->get_precision(); | 155 | 257 | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 257 | to_scale = to_decimal_type->get_scale(); | 158 | 257 | ToDataType::check_type_scale(to_scale); | 159 | 257 | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | 257 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 257 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 257 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 257 | if (to_scale > from_scale) { | 170 | 71 | multiply_may_overflow &= | 171 | 71 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 71 | } | 173 | 257 | return narrow_integral || multiply_may_overflow; | 174 | 257 | } | 175 | 0 | return false; | 176 | 257 | }); |
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 | 123 | 2.92k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 2.92k | using Types2 = std::decay_t<decltype(types2)>; | 125 | 2.92k | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 2.92k | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 2.92k | using FromFieldType = typename FromDataType::FieldType; | 133 | 2.92k | using ToFieldType = typename ToDataType::FieldType; | 134 | 2.92k | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 2.92k | UInt32 from_scale = 0; | 136 | | | 137 | 2.92k | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 2.92k | const auto* from_decimal_type = | 139 | 2.92k | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 2.92k | from_precision = | 141 | 2.92k | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 2.92k | from_scale = from_decimal_type->get_scale(); | 143 | 2.92k | } | 144 | | | 145 | 2.92k | UInt32 to_max_digits = 0; | 146 | 2.92k | UInt32 to_precision = 0; | 147 | 2.92k | UInt32 to_scale = 0; | 148 | | | 149 | 2.92k | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 2.92k | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 2.92k | const auto* to_decimal_type = | 153 | 2.92k | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 2.92k | to_precision = to_decimal_type->get_precision(); | 155 | 2.92k | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 2.92k | to_scale = to_decimal_type->get_scale(); | 158 | 2.92k | ToDataType::check_type_scale(to_scale); | 159 | 2.92k | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | 2.92k | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 2.92k | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 2.92k | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 2.92k | if (to_scale > from_scale) { | 170 | 719 | multiply_may_overflow &= | 171 | 719 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 719 | } | 173 | 2.92k | return narrow_integral || multiply_may_overflow; | 174 | 2.92k | } | 175 | 0 | return false; | 176 | 2.92k | }); |
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 | 123 | 948 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 948 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 948 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 948 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 948 | using FromFieldType = typename FromDataType::FieldType; | 133 | 948 | using ToFieldType = typename ToDataType::FieldType; | 134 | 948 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 948 | UInt32 from_scale = 0; | 136 | | | 137 | 948 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 948 | const auto* from_decimal_type = | 139 | 948 | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 948 | from_precision = | 141 | 948 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 948 | from_scale = from_decimal_type->get_scale(); | 143 | 948 | } | 144 | | | 145 | 948 | UInt32 to_max_digits = 0; | 146 | 948 | UInt32 to_precision = 0; | 147 | 948 | UInt32 to_scale = 0; | 148 | | | 149 | 948 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 948 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 948 | const auto* to_decimal_type = | 153 | 948 | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 948 | to_precision = to_decimal_type->get_precision(); | 155 | 948 | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 948 | to_scale = to_decimal_type->get_scale(); | 158 | 948 | ToDataType::check_type_scale(to_scale); | 159 | 948 | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | 948 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 948 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 948 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 948 | if (to_scale > from_scale) { | 170 | 394 | multiply_may_overflow &= | 171 | 394 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 394 | } | 173 | 948 | return narrow_integral || multiply_may_overflow; | 174 | 948 | } | 175 | 0 | return false; | 176 | 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 | 123 | 144k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 144k | using Types2 = std::decay_t<decltype(types2)>; | 125 | 144k | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | 144k | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | 144k | return false; | 130 | 144k | } | 131 | 144k | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 144k | using FromFieldType = typename FromDataType::FieldType; | 133 | 144k | using ToFieldType = typename ToDataType::FieldType; | 134 | 144k | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 144k | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | 144k | UInt32 to_max_digits = 0; | 146 | 144k | UInt32 to_precision = 0; | 147 | 144k | UInt32 to_scale = 0; | 148 | | | 149 | 144k | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 144k | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 144k | const auto* to_decimal_type = | 153 | 144k | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 144k | to_precision = to_decimal_type->get_precision(); | 155 | 144k | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 144k | to_scale = to_decimal_type->get_scale(); | 158 | 144k | ToDataType::check_type_scale(to_scale); | 159 | 144k | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | 144k | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 144k | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 144k | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 144k | if (to_scale > from_scale) { | 170 | 0 | multiply_may_overflow &= | 171 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 0 | } | 173 | 144k | return narrow_integral || multiply_may_overflow; | 174 | 144k | } | 175 | 0 | return false; | 176 | 144k | }); |
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 | 123 | 7 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 7 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 7 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 7 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 7 | using FromFieldType = typename FromDataType::FieldType; | 133 | 7 | using ToFieldType = typename ToDataType::FieldType; | 134 | 7 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 7 | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | 7 | UInt32 to_max_digits = 0; | 146 | 7 | UInt32 to_precision = 0; | 147 | 7 | UInt32 to_scale = 0; | 148 | | | 149 | 7 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 7 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 7 | const auto* to_decimal_type = | 153 | 7 | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 7 | to_precision = to_decimal_type->get_precision(); | 155 | 7 | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 7 | to_scale = to_decimal_type->get_scale(); | 158 | 7 | ToDataType::check_type_scale(to_scale); | 159 | 7 | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | 7 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 7 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 7 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 7 | if (to_scale > from_scale) { | 170 | 6 | multiply_may_overflow &= | 171 | 6 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 6 | } | 173 | 7 | return narrow_integral || multiply_may_overflow; | 174 | 7 | } | 175 | 0 | return false; | 176 | 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 | 123 | 160 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 160 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 160 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 160 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 160 | using FromFieldType = typename FromDataType::FieldType; | 133 | 160 | using ToFieldType = typename ToDataType::FieldType; | 134 | 160 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 160 | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | 160 | UInt32 to_max_digits = 0; | 146 | 160 | UInt32 to_precision = 0; | 147 | 160 | UInt32 to_scale = 0; | 148 | | | 149 | 160 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 160 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 160 | const auto* to_decimal_type = | 153 | 160 | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 160 | to_precision = to_decimal_type->get_precision(); | 155 | 160 | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 160 | to_scale = to_decimal_type->get_scale(); | 158 | 160 | ToDataType::check_type_scale(to_scale); | 159 | 160 | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | 160 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 160 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 160 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 160 | if (to_scale > from_scale) { | 170 | 109 | multiply_may_overflow &= | 171 | 109 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 109 | } | 173 | 160 | return narrow_integral || multiply_may_overflow; | 174 | 160 | } | 175 | 0 | return false; | 176 | 160 | }); |
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 | 123 | 158 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 158 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 158 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 158 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 158 | using FromFieldType = typename FromDataType::FieldType; | 133 | 158 | using ToFieldType = typename ToDataType::FieldType; | 134 | 158 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 158 | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | 158 | UInt32 to_max_digits = 0; | 146 | 158 | UInt32 to_precision = 0; | 147 | 158 | UInt32 to_scale = 0; | 148 | | | 149 | 158 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 158 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 158 | const auto* to_decimal_type = | 153 | 158 | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 158 | to_precision = to_decimal_type->get_precision(); | 155 | 158 | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 158 | to_scale = to_decimal_type->get_scale(); | 158 | 158 | ToDataType::check_type_scale(to_scale); | 159 | 158 | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | 158 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 158 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 158 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 158 | if (to_scale > from_scale) { | 170 | 107 | multiply_may_overflow &= | 171 | 107 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 107 | } | 173 | 158 | return narrow_integral || multiply_may_overflow; | 174 | 158 | } | 175 | 0 | return false; | 176 | 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 | 123 | 176 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 176 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 176 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 176 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 176 | using FromFieldType = typename FromDataType::FieldType; | 133 | 176 | using ToFieldType = typename ToDataType::FieldType; | 134 | 176 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 176 | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | 176 | UInt32 to_max_digits = 0; | 146 | 176 | UInt32 to_precision = 0; | 147 | 176 | UInt32 to_scale = 0; | 148 | | | 149 | 176 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 176 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 176 | const auto* to_decimal_type = | 153 | 176 | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 176 | to_precision = to_decimal_type->get_precision(); | 155 | 176 | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 176 | to_scale = to_decimal_type->get_scale(); | 158 | 176 | ToDataType::check_type_scale(to_scale); | 159 | 176 | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | 176 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 176 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 176 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 176 | if (to_scale > from_scale) { | 170 | 120 | multiply_may_overflow &= | 171 | 120 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 120 | } | 173 | 176 | return narrow_integral || multiply_may_overflow; | 174 | 176 | } | 175 | 0 | return false; | 176 | 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 | 123 | 158 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 158 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 158 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 158 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 158 | using FromFieldType = typename FromDataType::FieldType; | 133 | 158 | using ToFieldType = typename ToDataType::FieldType; | 134 | 158 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 158 | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | 158 | UInt32 to_max_digits = 0; | 146 | 158 | UInt32 to_precision = 0; | 147 | 158 | UInt32 to_scale = 0; | 148 | | | 149 | 158 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 158 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 158 | const auto* to_decimal_type = | 153 | 158 | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 158 | to_precision = to_decimal_type->get_precision(); | 155 | 158 | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 158 | to_scale = to_decimal_type->get_scale(); | 158 | 158 | ToDataType::check_type_scale(to_scale); | 159 | 158 | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | 158 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 158 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 158 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 158 | if (to_scale > from_scale) { | 170 | 107 | multiply_may_overflow &= | 171 | 107 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 107 | } | 173 | 158 | return narrow_integral || multiply_may_overflow; | 174 | 158 | } | 175 | 0 | return false; | 176 | 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 | 123 | 232 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 232 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 232 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 232 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 232 | using FromFieldType = typename FromDataType::FieldType; | 133 | 232 | using ToFieldType = typename ToDataType::FieldType; | 134 | 232 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 232 | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | 232 | UInt32 to_max_digits = 0; | 146 | 232 | UInt32 to_precision = 0; | 147 | 232 | UInt32 to_scale = 0; | 148 | | | 149 | 232 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 232 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 232 | const auto* to_decimal_type = | 153 | 232 | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 232 | to_precision = to_decimal_type->get_precision(); | 155 | 232 | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 232 | to_scale = to_decimal_type->get_scale(); | 158 | 232 | ToDataType::check_type_scale(to_scale); | 159 | 232 | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | 232 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 232 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 232 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 232 | if (to_scale > from_scale) { | 170 | 170 | multiply_may_overflow &= | 171 | 170 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 170 | } | 173 | 232 | return narrow_integral || multiply_may_overflow; | 174 | 232 | } | 175 | 0 | return false; | 176 | 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 | 123 | 224 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 224 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 224 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 224 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 224 | using FromFieldType = typename FromDataType::FieldType; | 133 | 224 | using ToFieldType = typename ToDataType::FieldType; | 134 | 224 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 224 | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | 224 | UInt32 to_max_digits = 0; | 146 | 224 | UInt32 to_precision = 0; | 147 | 224 | UInt32 to_scale = 0; | 148 | | | 149 | 224 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 224 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 224 | const auto* to_decimal_type = | 153 | 224 | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 224 | to_precision = to_decimal_type->get_precision(); | 155 | 224 | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 224 | to_scale = to_decimal_type->get_scale(); | 158 | 224 | ToDataType::check_type_scale(to_scale); | 159 | 224 | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | 224 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 224 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 224 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 224 | if (to_scale > from_scale) { | 170 | 126 | multiply_may_overflow &= | 171 | 126 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 126 | } | 173 | 224 | return narrow_integral || multiply_may_overflow; | 174 | 224 | } | 175 | 0 | return false; | 176 | 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 | 123 | 318 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 318 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 318 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 318 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 318 | using FromFieldType = typename FromDataType::FieldType; | 133 | 318 | using ToFieldType = typename ToDataType::FieldType; | 134 | 318 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 318 | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | 318 | UInt32 to_max_digits = 0; | 146 | 318 | UInt32 to_precision = 0; | 147 | 318 | UInt32 to_scale = 0; | 148 | | | 149 | 318 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 318 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 318 | const auto* to_decimal_type = | 153 | 318 | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 318 | to_precision = to_decimal_type->get_precision(); | 155 | 318 | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 318 | to_scale = to_decimal_type->get_scale(); | 158 | 318 | ToDataType::check_type_scale(to_scale); | 159 | 318 | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | 318 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 318 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 318 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 318 | if (to_scale > from_scale) { | 170 | 208 | multiply_may_overflow &= | 171 | 208 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 208 | } | 173 | 318 | return narrow_integral || multiply_may_overflow; | 174 | 318 | } | 175 | 0 | return false; | 176 | 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 | 123 | 567 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 567 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 567 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 567 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 567 | using FromFieldType = typename FromDataType::FieldType; | 133 | 567 | using ToFieldType = typename ToDataType::FieldType; | 134 | 567 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 567 | UInt32 from_scale = 0; | 136 | | | 137 | 567 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 567 | const auto* from_decimal_type = | 139 | 567 | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 567 | from_precision = | 141 | 567 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 567 | from_scale = from_decimal_type->get_scale(); | 143 | 567 | } | 144 | | | 145 | 567 | UInt32 to_max_digits = 0; | 146 | 567 | UInt32 to_precision = 0; | 147 | 567 | UInt32 to_scale = 0; | 148 | | | 149 | 567 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 567 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 567 | const auto* to_decimal_type = | 153 | 567 | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 567 | to_precision = to_decimal_type->get_precision(); | 155 | 567 | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 567 | to_scale = to_decimal_type->get_scale(); | 158 | 567 | ToDataType::check_type_scale(to_scale); | 159 | 567 | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | 567 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 567 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 567 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 567 | if (to_scale > from_scale) { | 170 | 499 | multiply_may_overflow &= | 171 | 499 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 499 | } | 173 | 567 | return narrow_integral || multiply_may_overflow; | 174 | 567 | } | 175 | 0 | return false; | 176 | 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 | 123 | 919 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 919 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 919 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 919 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 919 | using FromFieldType = typename FromDataType::FieldType; | 133 | 919 | using ToFieldType = typename ToDataType::FieldType; | 134 | 919 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 919 | UInt32 from_scale = 0; | 136 | | | 137 | 919 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 919 | const auto* from_decimal_type = | 139 | 919 | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 919 | from_precision = | 141 | 919 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 919 | from_scale = from_decimal_type->get_scale(); | 143 | 919 | } | 144 | | | 145 | 919 | UInt32 to_max_digits = 0; | 146 | 919 | UInt32 to_precision = 0; | 147 | 919 | UInt32 to_scale = 0; | 148 | | | 149 | 919 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 919 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 919 | const auto* to_decimal_type = | 153 | 919 | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 919 | to_precision = to_decimal_type->get_precision(); | 155 | 919 | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 919 | to_scale = to_decimal_type->get_scale(); | 158 | 919 | ToDataType::check_type_scale(to_scale); | 159 | 919 | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | 919 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 919 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 919 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 919 | if (to_scale > from_scale) { | 170 | 792 | multiply_may_overflow &= | 171 | 792 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 792 | } | 173 | 919 | return narrow_integral || multiply_may_overflow; | 174 | 919 | } | 175 | 0 | return false; | 176 | 919 | }); |
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 | 123 | 148 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 148 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 148 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 148 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 148 | using FromFieldType = typename FromDataType::FieldType; | 133 | 148 | using ToFieldType = typename ToDataType::FieldType; | 134 | 148 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 148 | UInt32 from_scale = 0; | 136 | | | 137 | 148 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 148 | const auto* from_decimal_type = | 139 | 148 | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 148 | from_precision = | 141 | 148 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 148 | from_scale = from_decimal_type->get_scale(); | 143 | 148 | } | 144 | | | 145 | 148 | UInt32 to_max_digits = 0; | 146 | 148 | UInt32 to_precision = 0; | 147 | 148 | UInt32 to_scale = 0; | 148 | | | 149 | 148 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 148 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 148 | const auto* to_decimal_type = | 153 | 148 | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 148 | to_precision = to_decimal_type->get_precision(); | 155 | 148 | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 148 | to_scale = to_decimal_type->get_scale(); | 158 | 148 | ToDataType::check_type_scale(to_scale); | 159 | 148 | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | 148 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 148 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 148 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 148 | if (to_scale > from_scale) { | 170 | 84 | multiply_may_overflow &= | 171 | 84 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 84 | } | 173 | 148 | return narrow_integral || multiply_may_overflow; | 174 | 148 | } | 175 | 0 | return false; | 176 | 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 | 123 | 1.18k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 1.18k | using Types2 = std::decay_t<decltype(types2)>; | 125 | 1.18k | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 1.18k | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 1.18k | using FromFieldType = typename FromDataType::FieldType; | 133 | 1.18k | using ToFieldType = typename ToDataType::FieldType; | 134 | 1.18k | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 1.18k | UInt32 from_scale = 0; | 136 | | | 137 | 1.18k | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 1.18k | const auto* from_decimal_type = | 139 | 1.18k | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 1.18k | from_precision = | 141 | 1.18k | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 1.18k | from_scale = from_decimal_type->get_scale(); | 143 | 1.18k | } | 144 | | | 145 | 1.18k | UInt32 to_max_digits = 0; | 146 | 1.18k | UInt32 to_precision = 0; | 147 | 1.18k | UInt32 to_scale = 0; | 148 | | | 149 | 1.18k | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 1.18k | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 1.18k | const auto* to_decimal_type = | 153 | 1.18k | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 1.18k | to_precision = to_decimal_type->get_precision(); | 155 | 1.18k | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 1.18k | to_scale = to_decimal_type->get_scale(); | 158 | 1.18k | ToDataType::check_type_scale(to_scale); | 159 | 1.18k | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | 1.18k | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 1.18k | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 1.18k | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 1.18k | if (to_scale > from_scale) { | 170 | 734 | multiply_may_overflow &= | 171 | 734 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 734 | } | 173 | 1.18k | return narrow_integral || multiply_may_overflow; | 174 | 1.18k | } | 175 | 0 | return false; | 176 | 1.18k | }); |
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 | 123 | 919 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 919 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 919 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 919 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 919 | using FromFieldType = typename FromDataType::FieldType; | 133 | 919 | using ToFieldType = typename ToDataType::FieldType; | 134 | 919 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 919 | UInt32 from_scale = 0; | 136 | | | 137 | 919 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 919 | const auto* from_decimal_type = | 139 | 919 | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 919 | from_precision = | 141 | 919 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 919 | from_scale = from_decimal_type->get_scale(); | 143 | 919 | } | 144 | | | 145 | 919 | UInt32 to_max_digits = 0; | 146 | 919 | UInt32 to_precision = 0; | 147 | 919 | UInt32 to_scale = 0; | 148 | | | 149 | 919 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 919 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 919 | const auto* to_decimal_type = | 153 | 919 | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 919 | to_precision = to_decimal_type->get_precision(); | 155 | 919 | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 919 | to_scale = to_decimal_type->get_scale(); | 158 | 919 | ToDataType::check_type_scale(to_scale); | 159 | 919 | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | 919 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 919 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 919 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 919 | if (to_scale > from_scale) { | 170 | 453 | multiply_may_overflow &= | 171 | 453 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 453 | } | 173 | 919 | return narrow_integral || multiply_may_overflow; | 174 | 919 | } | 175 | 0 | return false; | 176 | 919 | }); |
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 | 123 | 5.67k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 5.67k | using Types2 = std::decay_t<decltype(types2)>; | 125 | 5.67k | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | 5.67k | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | 5.67k | return false; | 130 | 5.67k | } | 131 | 5.67k | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 5.67k | using FromFieldType = typename FromDataType::FieldType; | 133 | 5.67k | using ToFieldType = typename ToDataType::FieldType; | 134 | 5.67k | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 5.67k | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | 5.67k | UInt32 to_max_digits = 0; | 146 | 5.67k | UInt32 to_precision = 0; | 147 | 5.67k | UInt32 to_scale = 0; | 148 | | | 149 | 5.67k | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 5.67k | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 5.67k | const auto* to_decimal_type = | 153 | 5.67k | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 5.67k | to_precision = to_decimal_type->get_precision(); | 155 | 5.67k | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 5.67k | to_scale = to_decimal_type->get_scale(); | 158 | 5.67k | ToDataType::check_type_scale(to_scale); | 159 | 5.67k | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | 5.67k | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 5.67k | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 5.67k | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 5.67k | if (to_scale > from_scale) { | 170 | 0 | multiply_may_overflow &= | 171 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 0 | } | 173 | 5.67k | return narrow_integral || multiply_may_overflow; | 174 | 5.67k | } | 175 | 0 | return false; | 176 | 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 | 123 | 1 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 1 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 1 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 1 | return false; | 176 | 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 | 123 | 3 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 3 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 3 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 3 | return false; | 176 | 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 | 123 | 28 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 28 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 28 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | 28 | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | 28 | return false; | 130 | 28 | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 28 | return false; | 176 | 28 | }); |
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 | 123 | 10 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 10 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 10 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 10 | return false; | 176 | 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 | 123 | 7 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 7 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 7 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 7 | return false; | 176 | 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 | 123 | 7 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 7 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 7 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 7 | return false; | 176 | 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 | 123 | 2 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 2 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 2 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 2 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 2 | using FromFieldType = typename FromDataType::FieldType; | 133 | 2 | using ToFieldType = typename ToDataType::FieldType; | 134 | 2 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 2 | UInt32 from_scale = 0; | 136 | | | 137 | 2 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 2 | const auto* from_decimal_type = | 139 | 2 | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 2 | from_precision = | 141 | 2 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 2 | from_scale = from_decimal_type->get_scale(); | 143 | 2 | } | 144 | | | 145 | 2 | UInt32 to_max_digits = 0; | 146 | 2 | UInt32 to_precision = 0; | 147 | 2 | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | 2 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 2 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 2 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 2 | if (to_scale > from_scale) { | 170 | 0 | multiply_may_overflow &= | 171 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 0 | } | 173 | 2 | return narrow_integral || multiply_may_overflow; | 174 | 2 | } | 175 | 0 | return false; | 176 | 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 | 123 | 31 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 31 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 31 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 31 | return false; | 176 | 31 | }); |
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 | 123 | 220 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 220 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 220 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 220 | return false; | 176 | 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 | 123 | 1 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 1 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 1 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 1 | return false; | 176 | 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 | 123 | 2 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 2 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 2 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 2 | return false; | 176 | 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 | 123 | 135k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 135k | using Types2 = std::decay_t<decltype(types2)>; | 125 | 135k | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | 135k | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | 135k | return false; | 130 | 135k | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 135k | return false; | 176 | 135k | }); |
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 | 123 | 13 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 13 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 13 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 13 | return false; | 176 | 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 | 123 | 33 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 33 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 33 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 33 | return false; | 176 | 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 | 123 | 12 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 12 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 12 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 12 | return false; | 176 | 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 | 123 | 12 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 12 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 12 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 12 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 12 | using FromFieldType = typename FromDataType::FieldType; | 133 | 12 | using ToFieldType = typename ToDataType::FieldType; | 134 | 12 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 12 | UInt32 from_scale = 0; | 136 | | | 137 | 12 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 12 | const auto* from_decimal_type = | 139 | 12 | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 12 | from_precision = | 141 | 12 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 12 | from_scale = from_decimal_type->get_scale(); | 143 | 12 | } | 144 | | | 145 | 12 | UInt32 to_max_digits = 0; | 146 | 12 | UInt32 to_precision = 0; | 147 | 12 | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | 12 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 12 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 12 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 12 | if (to_scale > from_scale) { | 170 | 0 | multiply_may_overflow &= | 171 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 0 | } | 173 | 12 | return narrow_integral || multiply_may_overflow; | 174 | 12 | } | 175 | 0 | return false; | 176 | 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 | 123 | 4 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 4 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 4 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 4 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 4 | using FromFieldType = typename FromDataType::FieldType; | 133 | 4 | using ToFieldType = typename ToDataType::FieldType; | 134 | 4 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 4 | UInt32 from_scale = 0; | 136 | | | 137 | 4 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 4 | const auto* from_decimal_type = | 139 | 4 | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 4 | from_precision = | 141 | 4 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 4 | from_scale = from_decimal_type->get_scale(); | 143 | 4 | } | 144 | | | 145 | 4 | UInt32 to_max_digits = 0; | 146 | 4 | UInt32 to_precision = 0; | 147 | 4 | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | 4 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 4 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 4 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 4 | if (to_scale > from_scale) { | 170 | 0 | multiply_may_overflow &= | 171 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 0 | } | 173 | 4 | return narrow_integral || multiply_may_overflow; | 174 | 4 | } | 175 | 0 | return false; | 176 | 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 | 123 | 5 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 5 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 5 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 5 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 5 | using FromFieldType = typename FromDataType::FieldType; | 133 | 5 | using ToFieldType = typename ToDataType::FieldType; | 134 | 5 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 5 | UInt32 from_scale = 0; | 136 | | | 137 | 5 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 5 | const auto* from_decimal_type = | 139 | 5 | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 5 | from_precision = | 141 | 5 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 5 | from_scale = from_decimal_type->get_scale(); | 143 | 5 | } | 144 | | | 145 | 5 | UInt32 to_max_digits = 0; | 146 | 5 | UInt32 to_precision = 0; | 147 | 5 | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | 5 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 5 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 5 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 5 | if (to_scale > from_scale) { | 170 | 0 | multiply_may_overflow &= | 171 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 0 | } | 173 | 5 | return narrow_integral || multiply_may_overflow; | 174 | 5 | } | 175 | 0 | return false; | 176 | 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 | 123 | 379 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 379 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 379 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 379 | return false; | 176 | 379 | }); |
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 | 123 | 545 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 545 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 545 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 545 | return false; | 176 | 545 | }); |
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 | 123 | 40 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 40 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 40 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 40 | return false; | 176 | 40 | }); |
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 | 123 | 6 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 6 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 6 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 6 | return false; | 176 | 6 | }); |
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 | 123 | 45 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 45 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 45 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | 45 | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | 45 | return false; | 130 | 45 | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 45 | return false; | 176 | 45 | }); |
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 | 123 | 133k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 133k | using Types2 = std::decay_t<decltype(types2)>; | 125 | 133k | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | 133k | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | 133k | return false; | 130 | 133k | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 133k | return false; | 176 | 133k | }); |
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 | 123 | 26 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 26 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 26 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | 26 | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | 26 | return false; | 130 | 26 | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 26 | return false; | 176 | 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 | 123 | 32 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 32 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 32 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 32 | return false; | 176 | 32 | }); |
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 | 123 | 21 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 21 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 21 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 21 | return false; | 176 | 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 | 123 | 33 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 33 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 33 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 33 | return false; | 176 | 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 | 123 | 9 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 9 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 9 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 9 | return false; | 176 | 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 | 123 | 3 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 3 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 3 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 3 | return false; | 176 | 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 | 123 | 7 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 7 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 7 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 7 | return false; | 176 | 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 | 123 | 18 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 18 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 18 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 18 | return false; | 176 | 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 | 123 | 2 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 2 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 2 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 2 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 2 | using FromFieldType = typename FromDataType::FieldType; | 133 | 2 | using ToFieldType = typename ToDataType::FieldType; | 134 | 2 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 2 | UInt32 from_scale = 0; | 136 | | | 137 | 2 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 2 | const auto* from_decimal_type = | 139 | 2 | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 2 | from_precision = | 141 | 2 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 2 | from_scale = from_decimal_type->get_scale(); | 143 | 2 | } | 144 | | | 145 | 2 | UInt32 to_max_digits = 0; | 146 | 2 | UInt32 to_precision = 0; | 147 | 2 | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | 2 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | 2 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | 2 | to_precision = to_max_digits; | 163 | 2 | } | 164 | | | 165 | 2 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 2 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 2 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 2 | if (to_scale > from_scale) { | 170 | 0 | multiply_may_overflow &= | 171 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 0 | } | 173 | 2 | return narrow_integral || multiply_may_overflow; | 174 | 2 | } | 175 | 0 | return false; | 176 | 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 | 123 | 1 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 1 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 1 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 1 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 1 | using FromFieldType = typename FromDataType::FieldType; | 133 | 1 | using ToFieldType = typename ToDataType::FieldType; | 134 | 1 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 1 | UInt32 from_scale = 0; | 136 | | | 137 | 1 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 1 | const auto* from_decimal_type = | 139 | 1 | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 1 | from_precision = | 141 | 1 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 1 | from_scale = from_decimal_type->get_scale(); | 143 | 1 | } | 144 | | | 145 | 1 | UInt32 to_max_digits = 0; | 146 | 1 | UInt32 to_precision = 0; | 147 | 1 | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | 1 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | 1 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | 1 | to_precision = to_max_digits; | 163 | 1 | } | 164 | | | 165 | 1 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 1 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 1 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 1 | if (to_scale > from_scale) { | 170 | 0 | multiply_may_overflow &= | 171 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 0 | } | 173 | 1 | return narrow_integral || multiply_may_overflow; | 174 | 1 | } | 175 | 0 | return false; | 176 | 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 | 123 | 1 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 1 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 1 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 1 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 1 | using FromFieldType = typename FromDataType::FieldType; | 133 | 1 | using ToFieldType = typename ToDataType::FieldType; | 134 | 1 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 1 | UInt32 from_scale = 0; | 136 | | | 137 | 1 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 1 | const auto* from_decimal_type = | 139 | 1 | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 1 | from_precision = | 141 | 1 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 1 | from_scale = from_decimal_type->get_scale(); | 143 | 1 | } | 144 | | | 145 | 1 | UInt32 to_max_digits = 0; | 146 | 1 | UInt32 to_precision = 0; | 147 | 1 | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | 1 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | 1 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | 1 | to_precision = to_max_digits; | 163 | 1 | } | 164 | | | 165 | 1 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 1 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 1 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 1 | if (to_scale > from_scale) { | 170 | 0 | multiply_may_overflow &= | 171 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 0 | } | 173 | 1 | return narrow_integral || multiply_may_overflow; | 174 | 1 | } | 175 | 0 | return false; | 176 | 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 | 123 | 11 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 11 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 11 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | 11 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 11 | using FromFieldType = typename FromDataType::FieldType; | 133 | 11 | using ToFieldType = typename ToDataType::FieldType; | 134 | 11 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 11 | UInt32 from_scale = 0; | 136 | | | 137 | 11 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 11 | const auto* from_decimal_type = | 139 | 11 | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 11 | from_precision = | 141 | 11 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 11 | from_scale = from_decimal_type->get_scale(); | 143 | 11 | } | 144 | | | 145 | 11 | UInt32 to_max_digits = 0; | 146 | 11 | UInt32 to_precision = 0; | 147 | 11 | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | 11 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | 11 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | 11 | to_precision = to_max_digits; | 163 | 11 | } | 164 | | | 165 | 11 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 11 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 11 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 11 | if (to_scale > from_scale) { | 170 | 0 | multiply_may_overflow &= | 171 | 0 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 0 | } | 173 | 11 | return narrow_integral || multiply_may_overflow; | 174 | 11 | } | 175 | 0 | return false; | 176 | 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 | 123 | 8 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 8 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 8 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 8 | return false; | 176 | 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 | 123 | 21 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 21 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 21 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | | return false; | 130 | | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 21 | return false; | 176 | 21 | }); |
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 | 123 | 301 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 301 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 301 | using FromDataType = typename Types2::LeftType; | 126 | | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | 301 | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | 301 | return false; | 130 | 301 | } | 131 | | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | | using FromFieldType = typename FromDataType::FieldType; | 133 | | using ToFieldType = typename ToDataType::FieldType; | 134 | | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | | UInt32 from_scale = 0; | 136 | | | 137 | | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | | const auto* from_decimal_type = | 139 | | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | | from_precision = | 141 | | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | | from_scale = from_decimal_type->get_scale(); | 143 | | } | 144 | | | 145 | | UInt32 to_max_digits = 0; | 146 | | UInt32 to_precision = 0; | 147 | | UInt32 to_scale = 0; | 148 | | | 149 | | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | | const auto* to_decimal_type = | 153 | | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | | to_precision = to_decimal_type->get_precision(); | 155 | | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | | to_scale = to_decimal_type->get_scale(); | 158 | | ToDataType::check_type_scale(to_scale); | 159 | | } | 160 | | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | | to_precision = to_max_digits; | 163 | | } | 164 | | | 165 | | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | | if (to_scale > from_scale) { | 170 | | multiply_may_overflow &= | 171 | | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | | } | 173 | | return narrow_integral || multiply_may_overflow; | 174 | | } | 175 | 301 | return false; | 176 | 301 | }); |
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_ |
177 | 1.11M | }; function_cast.cpp:_ZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE2EEEvEEEEbRKT_ Line | Count | Source | 113 | 2.48k | auto make_default_wrapper = [&](const auto& types) -> bool { | 114 | 2.48k | using Types = std::decay_t<decltype(types)>; | 115 | 2.48k | using ToDataType = typename Types::LeftType; | 116 | | | 117 | | if constexpr (!(IsDataTypeDecimalOrNumber<ToDataType> || IsDatelikeV1Types<ToDataType> || | 118 | | IsDatelikeV2Types<ToDataType> || | 119 | | std::is_same_v<ToDataType, DataTypeTimeV2>)) { | 120 | | return false; | 121 | | } | 122 | 2.48k | return call_on_index_and_data_type< | 123 | 2.48k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 2.48k | using Types2 = std::decay_t<decltype(types2)>; | 125 | 2.48k | using FromDataType = typename Types2::LeftType; | 126 | 2.48k | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | 2.48k | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | 2.48k | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | 2.48k | return false; | 130 | 2.48k | } | 131 | 2.48k | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 2.48k | using FromFieldType = typename FromDataType::FieldType; | 133 | 2.48k | using ToFieldType = typename ToDataType::FieldType; | 134 | 2.48k | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 2.48k | UInt32 from_scale = 0; | 136 | | | 137 | 2.48k | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 2.48k | const auto* from_decimal_type = | 139 | 2.48k | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 2.48k | from_precision = | 141 | 2.48k | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 2.48k | from_scale = from_decimal_type->get_scale(); | 143 | 2.48k | } | 144 | | | 145 | 2.48k | UInt32 to_max_digits = 0; | 146 | 2.48k | UInt32 to_precision = 0; | 147 | 2.48k | UInt32 to_scale = 0; | 148 | | | 149 | 2.48k | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 2.48k | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 2.48k | const auto* to_decimal_type = | 153 | 2.48k | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 2.48k | to_precision = to_decimal_type->get_precision(); | 155 | 2.48k | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 2.48k | to_scale = to_decimal_type->get_scale(); | 158 | 2.48k | ToDataType::check_type_scale(to_scale); | 159 | 2.48k | } | 160 | 2.48k | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | 2.48k | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | 2.48k | to_precision = to_max_digits; | 163 | 2.48k | } | 164 | | | 165 | 2.48k | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 2.48k | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 2.48k | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 2.48k | if (to_scale > from_scale) { | 170 | 2.48k | multiply_may_overflow &= | 171 | 2.48k | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 2.48k | } | 173 | 2.48k | return narrow_integral || multiply_may_overflow; | 174 | 2.48k | } | 175 | 2.48k | return false; | 176 | 2.48k | }); | 177 | 2.48k | }; |
function_cast.cpp:_ZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE3EEEvEEEEbRKT_ Line | Count | Source | 113 | 8.87k | auto make_default_wrapper = [&](const auto& types) -> bool { | 114 | 8.87k | using Types = std::decay_t<decltype(types)>; | 115 | 8.87k | using ToDataType = typename Types::LeftType; | 116 | | | 117 | | if constexpr (!(IsDataTypeDecimalOrNumber<ToDataType> || IsDatelikeV1Types<ToDataType> || | 118 | | IsDatelikeV2Types<ToDataType> || | 119 | | std::is_same_v<ToDataType, DataTypeTimeV2>)) { | 120 | | return false; | 121 | | } | 122 | 8.87k | return call_on_index_and_data_type< | 123 | 8.87k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 8.87k | using Types2 = std::decay_t<decltype(types2)>; | 125 | 8.87k | using FromDataType = typename Types2::LeftType; | 126 | 8.87k | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | 8.87k | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | 8.87k | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | 8.87k | return false; | 130 | 8.87k | } | 131 | 8.87k | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 8.87k | using FromFieldType = typename FromDataType::FieldType; | 133 | 8.87k | using ToFieldType = typename ToDataType::FieldType; | 134 | 8.87k | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 8.87k | UInt32 from_scale = 0; | 136 | | | 137 | 8.87k | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 8.87k | const auto* from_decimal_type = | 139 | 8.87k | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 8.87k | from_precision = | 141 | 8.87k | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 8.87k | from_scale = from_decimal_type->get_scale(); | 143 | 8.87k | } | 144 | | | 145 | 8.87k | UInt32 to_max_digits = 0; | 146 | 8.87k | UInt32 to_precision = 0; | 147 | 8.87k | UInt32 to_scale = 0; | 148 | | | 149 | 8.87k | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 8.87k | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 8.87k | const auto* to_decimal_type = | 153 | 8.87k | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 8.87k | to_precision = to_decimal_type->get_precision(); | 155 | 8.87k | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 8.87k | to_scale = to_decimal_type->get_scale(); | 158 | 8.87k | ToDataType::check_type_scale(to_scale); | 159 | 8.87k | } | 160 | 8.87k | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | 8.87k | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | 8.87k | to_precision = to_max_digits; | 163 | 8.87k | } | 164 | | | 165 | 8.87k | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 8.87k | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 8.87k | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 8.87k | if (to_scale > from_scale) { | 170 | 8.87k | multiply_may_overflow &= | 171 | 8.87k | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 8.87k | } | 173 | 8.87k | return narrow_integral || multiply_may_overflow; | 174 | 8.87k | } | 175 | 8.87k | return false; | 176 | 8.87k | }); | 177 | 8.87k | }; |
function_cast.cpp:_ZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE4EEEvEEEEbRKT_ Line | Count | Source | 113 | 5.59k | auto make_default_wrapper = [&](const auto& types) -> bool { | 114 | 5.59k | using Types = std::decay_t<decltype(types)>; | 115 | 5.59k | using ToDataType = typename Types::LeftType; | 116 | | | 117 | | if constexpr (!(IsDataTypeDecimalOrNumber<ToDataType> || IsDatelikeV1Types<ToDataType> || | 118 | | IsDatelikeV2Types<ToDataType> || | 119 | | std::is_same_v<ToDataType, DataTypeTimeV2>)) { | 120 | | return false; | 121 | | } | 122 | 5.59k | return call_on_index_and_data_type< | 123 | 5.59k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 5.59k | using Types2 = std::decay_t<decltype(types2)>; | 125 | 5.59k | using FromDataType = typename Types2::LeftType; | 126 | 5.59k | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | 5.59k | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | 5.59k | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | 5.59k | return false; | 130 | 5.59k | } | 131 | 5.59k | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 5.59k | using FromFieldType = typename FromDataType::FieldType; | 133 | 5.59k | using ToFieldType = typename ToDataType::FieldType; | 134 | 5.59k | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 5.59k | UInt32 from_scale = 0; | 136 | | | 137 | 5.59k | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 5.59k | const auto* from_decimal_type = | 139 | 5.59k | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 5.59k | from_precision = | 141 | 5.59k | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 5.59k | from_scale = from_decimal_type->get_scale(); | 143 | 5.59k | } | 144 | | | 145 | 5.59k | UInt32 to_max_digits = 0; | 146 | 5.59k | UInt32 to_precision = 0; | 147 | 5.59k | UInt32 to_scale = 0; | 148 | | | 149 | 5.59k | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 5.59k | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 5.59k | const auto* to_decimal_type = | 153 | 5.59k | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 5.59k | to_precision = to_decimal_type->get_precision(); | 155 | 5.59k | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 5.59k | to_scale = to_decimal_type->get_scale(); | 158 | 5.59k | ToDataType::check_type_scale(to_scale); | 159 | 5.59k | } | 160 | 5.59k | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | 5.59k | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | 5.59k | to_precision = to_max_digits; | 163 | 5.59k | } | 164 | | | 165 | 5.59k | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 5.59k | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 5.59k | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 5.59k | if (to_scale > from_scale) { | 170 | 5.59k | multiply_may_overflow &= | 171 | 5.59k | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 5.59k | } | 173 | 5.59k | return narrow_integral || multiply_may_overflow; | 174 | 5.59k | } | 175 | 5.59k | return false; | 176 | 5.59k | }); | 177 | 5.59k | }; |
function_cast.cpp:_ZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE5EEEvEEEEbRKT_ Line | Count | Source | 113 | 155k | auto make_default_wrapper = [&](const auto& types) -> bool { | 114 | 155k | using Types = std::decay_t<decltype(types)>; | 115 | 155k | using ToDataType = typename Types::LeftType; | 116 | | | 117 | | if constexpr (!(IsDataTypeDecimalOrNumber<ToDataType> || IsDatelikeV1Types<ToDataType> || | 118 | | IsDatelikeV2Types<ToDataType> || | 119 | | std::is_same_v<ToDataType, DataTypeTimeV2>)) { | 120 | | return false; | 121 | | } | 122 | 155k | return call_on_index_and_data_type< | 123 | 155k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 155k | using Types2 = std::decay_t<decltype(types2)>; | 125 | 155k | using FromDataType = typename Types2::LeftType; | 126 | 155k | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | 155k | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | 155k | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | 155k | return false; | 130 | 155k | } | 131 | 155k | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 155k | using FromFieldType = typename FromDataType::FieldType; | 133 | 155k | using ToFieldType = typename ToDataType::FieldType; | 134 | 155k | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 155k | UInt32 from_scale = 0; | 136 | | | 137 | 155k | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 155k | const auto* from_decimal_type = | 139 | 155k | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 155k | from_precision = | 141 | 155k | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 155k | from_scale = from_decimal_type->get_scale(); | 143 | 155k | } | 144 | | | 145 | 155k | UInt32 to_max_digits = 0; | 146 | 155k | UInt32 to_precision = 0; | 147 | 155k | UInt32 to_scale = 0; | 148 | | | 149 | 155k | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 155k | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 155k | const auto* to_decimal_type = | 153 | 155k | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 155k | to_precision = to_decimal_type->get_precision(); | 155 | 155k | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 155k | to_scale = to_decimal_type->get_scale(); | 158 | 155k | ToDataType::check_type_scale(to_scale); | 159 | 155k | } | 160 | 155k | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | 155k | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | 155k | to_precision = to_max_digits; | 163 | 155k | } | 164 | | | 165 | 155k | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 155k | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 155k | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 155k | if (to_scale > from_scale) { | 170 | 155k | multiply_may_overflow &= | 171 | 155k | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 155k | } | 173 | 155k | return narrow_integral || multiply_may_overflow; | 174 | 155k | } | 175 | 155k | return false; | 176 | 155k | }); | 177 | 155k | }; |
function_cast.cpp:_ZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE6EEEvEEEEbRKT_ Line | Count | Source | 113 | 49.4k | auto make_default_wrapper = [&](const auto& types) -> bool { | 114 | 49.4k | using Types = std::decay_t<decltype(types)>; | 115 | 49.4k | using ToDataType = typename Types::LeftType; | 116 | | | 117 | | if constexpr (!(IsDataTypeDecimalOrNumber<ToDataType> || IsDatelikeV1Types<ToDataType> || | 118 | | IsDatelikeV2Types<ToDataType> || | 119 | | std::is_same_v<ToDataType, DataTypeTimeV2>)) { | 120 | | return false; | 121 | | } | 122 | 49.4k | return call_on_index_and_data_type< | 123 | 49.4k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 49.4k | using Types2 = std::decay_t<decltype(types2)>; | 125 | 49.4k | using FromDataType = typename Types2::LeftType; | 126 | 49.4k | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | 49.4k | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | 49.4k | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | 49.4k | return false; | 130 | 49.4k | } | 131 | 49.4k | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 49.4k | using FromFieldType = typename FromDataType::FieldType; | 133 | 49.4k | using ToFieldType = typename ToDataType::FieldType; | 134 | 49.4k | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 49.4k | UInt32 from_scale = 0; | 136 | | | 137 | 49.4k | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 49.4k | const auto* from_decimal_type = | 139 | 49.4k | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 49.4k | from_precision = | 141 | 49.4k | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 49.4k | from_scale = from_decimal_type->get_scale(); | 143 | 49.4k | } | 144 | | | 145 | 49.4k | UInt32 to_max_digits = 0; | 146 | 49.4k | UInt32 to_precision = 0; | 147 | 49.4k | UInt32 to_scale = 0; | 148 | | | 149 | 49.4k | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 49.4k | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 49.4k | const auto* to_decimal_type = | 153 | 49.4k | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 49.4k | to_precision = to_decimal_type->get_precision(); | 155 | 49.4k | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 49.4k | to_scale = to_decimal_type->get_scale(); | 158 | 49.4k | ToDataType::check_type_scale(to_scale); | 159 | 49.4k | } | 160 | 49.4k | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | 49.4k | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | 49.4k | to_precision = to_max_digits; | 163 | 49.4k | } | 164 | | | 165 | 49.4k | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 49.4k | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 49.4k | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 49.4k | if (to_scale > from_scale) { | 170 | 49.4k | multiply_may_overflow &= | 171 | 49.4k | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 49.4k | } | 173 | 49.4k | return narrow_integral || multiply_may_overflow; | 174 | 49.4k | } | 175 | 49.4k | return false; | 176 | 49.4k | }); | 177 | 49.4k | }; |
function_cast.cpp:_ZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE7EEEvEEEEbRKT_ Line | Count | Source | 113 | 60.3k | auto make_default_wrapper = [&](const auto& types) -> bool { | 114 | 60.3k | using Types = std::decay_t<decltype(types)>; | 115 | 60.3k | using ToDataType = typename Types::LeftType; | 116 | | | 117 | | if constexpr (!(IsDataTypeDecimalOrNumber<ToDataType> || IsDatelikeV1Types<ToDataType> || | 118 | | IsDatelikeV2Types<ToDataType> || | 119 | | std::is_same_v<ToDataType, DataTypeTimeV2>)) { | 120 | | return false; | 121 | | } | 122 | 60.3k | return call_on_index_and_data_type< | 123 | 60.3k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 60.3k | using Types2 = std::decay_t<decltype(types2)>; | 125 | 60.3k | using FromDataType = typename Types2::LeftType; | 126 | 60.3k | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | 60.3k | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | 60.3k | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | 60.3k | return false; | 130 | 60.3k | } | 131 | 60.3k | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 60.3k | using FromFieldType = typename FromDataType::FieldType; | 133 | 60.3k | using ToFieldType = typename ToDataType::FieldType; | 134 | 60.3k | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 60.3k | UInt32 from_scale = 0; | 136 | | | 137 | 60.3k | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 60.3k | const auto* from_decimal_type = | 139 | 60.3k | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 60.3k | from_precision = | 141 | 60.3k | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 60.3k | from_scale = from_decimal_type->get_scale(); | 143 | 60.3k | } | 144 | | | 145 | 60.3k | UInt32 to_max_digits = 0; | 146 | 60.3k | UInt32 to_precision = 0; | 147 | 60.3k | UInt32 to_scale = 0; | 148 | | | 149 | 60.3k | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 60.3k | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 60.3k | const auto* to_decimal_type = | 153 | 60.3k | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 60.3k | to_precision = to_decimal_type->get_precision(); | 155 | 60.3k | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 60.3k | to_scale = to_decimal_type->get_scale(); | 158 | 60.3k | ToDataType::check_type_scale(to_scale); | 159 | 60.3k | } | 160 | 60.3k | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | 60.3k | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | 60.3k | to_precision = to_max_digits; | 163 | 60.3k | } | 164 | | | 165 | 60.3k | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 60.3k | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 60.3k | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 60.3k | if (to_scale > from_scale) { | 170 | 60.3k | multiply_may_overflow &= | 171 | 60.3k | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 60.3k | } | 173 | 60.3k | return narrow_integral || multiply_may_overflow; | 174 | 60.3k | } | 175 | 60.3k | return false; | 176 | 60.3k | }); | 177 | 60.3k | }; |
function_cast.cpp:_ZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE8EEEvEEEEbRKT_ Line | Count | Source | 113 | 10.9k | auto make_default_wrapper = [&](const auto& types) -> bool { | 114 | 10.9k | using Types = std::decay_t<decltype(types)>; | 115 | 10.9k | using ToDataType = typename Types::LeftType; | 116 | | | 117 | | if constexpr (!(IsDataTypeDecimalOrNumber<ToDataType> || IsDatelikeV1Types<ToDataType> || | 118 | | IsDatelikeV2Types<ToDataType> || | 119 | | std::is_same_v<ToDataType, DataTypeTimeV2>)) { | 120 | | return false; | 121 | | } | 122 | 10.9k | return call_on_index_and_data_type< | 123 | 10.9k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 10.9k | using Types2 = std::decay_t<decltype(types2)>; | 125 | 10.9k | using FromDataType = typename Types2::LeftType; | 126 | 10.9k | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | 10.9k | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | 10.9k | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | 10.9k | return false; | 130 | 10.9k | } | 131 | 10.9k | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 10.9k | using FromFieldType = typename FromDataType::FieldType; | 133 | 10.9k | using ToFieldType = typename ToDataType::FieldType; | 134 | 10.9k | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 10.9k | UInt32 from_scale = 0; | 136 | | | 137 | 10.9k | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 10.9k | const auto* from_decimal_type = | 139 | 10.9k | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 10.9k | from_precision = | 141 | 10.9k | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 10.9k | from_scale = from_decimal_type->get_scale(); | 143 | 10.9k | } | 144 | | | 145 | 10.9k | UInt32 to_max_digits = 0; | 146 | 10.9k | UInt32 to_precision = 0; | 147 | 10.9k | UInt32 to_scale = 0; | 148 | | | 149 | 10.9k | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 10.9k | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 10.9k | const auto* to_decimal_type = | 153 | 10.9k | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 10.9k | to_precision = to_decimal_type->get_precision(); | 155 | 10.9k | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 10.9k | to_scale = to_decimal_type->get_scale(); | 158 | 10.9k | ToDataType::check_type_scale(to_scale); | 159 | 10.9k | } | 160 | 10.9k | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | 10.9k | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | 10.9k | to_precision = to_max_digits; | 163 | 10.9k | } | 164 | | | 165 | 10.9k | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 10.9k | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 10.9k | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 10.9k | if (to_scale > from_scale) { | 170 | 10.9k | multiply_may_overflow &= | 171 | 10.9k | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 10.9k | } | 173 | 10.9k | return narrow_integral || multiply_may_overflow; | 174 | 10.9k | } | 175 | 10.9k | return false; | 176 | 10.9k | }); | 177 | 10.9k | }; |
function_cast.cpp:_ZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE9EEEvEEEEbRKT_ Line | Count | Source | 113 | 30.6k | auto make_default_wrapper = [&](const auto& types) -> bool { | 114 | 30.6k | using Types = std::decay_t<decltype(types)>; | 115 | 30.6k | using ToDataType = typename Types::LeftType; | 116 | | | 117 | | if constexpr (!(IsDataTypeDecimalOrNumber<ToDataType> || IsDatelikeV1Types<ToDataType> || | 118 | | IsDatelikeV2Types<ToDataType> || | 119 | | std::is_same_v<ToDataType, DataTypeTimeV2>)) { | 120 | | return false; | 121 | | } | 122 | 30.6k | return call_on_index_and_data_type< | 123 | 30.6k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 30.6k | using Types2 = std::decay_t<decltype(types2)>; | 125 | 30.6k | using FromDataType = typename Types2::LeftType; | 126 | 30.6k | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | 30.6k | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | 30.6k | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | 30.6k | return false; | 130 | 30.6k | } | 131 | 30.6k | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 30.6k | using FromFieldType = typename FromDataType::FieldType; | 133 | 30.6k | using ToFieldType = typename ToDataType::FieldType; | 134 | 30.6k | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 30.6k | UInt32 from_scale = 0; | 136 | | | 137 | 30.6k | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 30.6k | const auto* from_decimal_type = | 139 | 30.6k | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 30.6k | from_precision = | 141 | 30.6k | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 30.6k | from_scale = from_decimal_type->get_scale(); | 143 | 30.6k | } | 144 | | | 145 | 30.6k | UInt32 to_max_digits = 0; | 146 | 30.6k | UInt32 to_precision = 0; | 147 | 30.6k | UInt32 to_scale = 0; | 148 | | | 149 | 30.6k | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 30.6k | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 30.6k | const auto* to_decimal_type = | 153 | 30.6k | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 30.6k | to_precision = to_decimal_type->get_precision(); | 155 | 30.6k | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 30.6k | to_scale = to_decimal_type->get_scale(); | 158 | 30.6k | ToDataType::check_type_scale(to_scale); | 159 | 30.6k | } | 160 | 30.6k | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | 30.6k | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | 30.6k | to_precision = to_max_digits; | 163 | 30.6k | } | 164 | | | 165 | 30.6k | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 30.6k | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 30.6k | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 30.6k | if (to_scale > from_scale) { | 170 | 30.6k | multiply_may_overflow &= | 171 | 30.6k | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 30.6k | } | 173 | 30.6k | return narrow_integral || multiply_may_overflow; | 174 | 30.6k | } | 175 | 30.6k | return false; | 176 | 30.6k | }); | 177 | 30.6k | }; |
function_cast.cpp:_ZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE28EEEvEEEEbRKT_ Line | Count | Source | 113 | 11.9k | auto make_default_wrapper = [&](const auto& types) -> bool { | 114 | 11.9k | using Types = std::decay_t<decltype(types)>; | 115 | 11.9k | using ToDataType = typename Types::LeftType; | 116 | | | 117 | | if constexpr (!(IsDataTypeDecimalOrNumber<ToDataType> || IsDatelikeV1Types<ToDataType> || | 118 | | IsDatelikeV2Types<ToDataType> || | 119 | | std::is_same_v<ToDataType, DataTypeTimeV2>)) { | 120 | | return false; | 121 | | } | 122 | 11.9k | return call_on_index_and_data_type< | 123 | 11.9k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 11.9k | using Types2 = std::decay_t<decltype(types2)>; | 125 | 11.9k | using FromDataType = typename Types2::LeftType; | 126 | 11.9k | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | 11.9k | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | 11.9k | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | 11.9k | return false; | 130 | 11.9k | } | 131 | 11.9k | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 11.9k | using FromFieldType = typename FromDataType::FieldType; | 133 | 11.9k | using ToFieldType = typename ToDataType::FieldType; | 134 | 11.9k | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 11.9k | UInt32 from_scale = 0; | 136 | | | 137 | 11.9k | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 11.9k | const auto* from_decimal_type = | 139 | 11.9k | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 11.9k | from_precision = | 141 | 11.9k | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 11.9k | from_scale = from_decimal_type->get_scale(); | 143 | 11.9k | } | 144 | | | 145 | 11.9k | UInt32 to_max_digits = 0; | 146 | 11.9k | UInt32 to_precision = 0; | 147 | 11.9k | UInt32 to_scale = 0; | 148 | | | 149 | 11.9k | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 11.9k | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 11.9k | const auto* to_decimal_type = | 153 | 11.9k | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 11.9k | to_precision = to_decimal_type->get_precision(); | 155 | 11.9k | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 11.9k | to_scale = to_decimal_type->get_scale(); | 158 | 11.9k | ToDataType::check_type_scale(to_scale); | 159 | 11.9k | } | 160 | 11.9k | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | 11.9k | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | 11.9k | to_precision = to_max_digits; | 163 | 11.9k | } | 164 | | | 165 | 11.9k | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 11.9k | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 11.9k | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 11.9k | if (to_scale > from_scale) { | 170 | 11.9k | multiply_may_overflow &= | 171 | 11.9k | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 11.9k | } | 173 | 11.9k | return narrow_integral || multiply_may_overflow; | 174 | 11.9k | } | 175 | 11.9k | return false; | 176 | 11.9k | }); | 177 | 11.9k | }; |
function_cast.cpp:_ZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE29EEEvEEEEbRKT_ Line | Count | Source | 113 | 31.5k | auto make_default_wrapper = [&](const auto& types) -> bool { | 114 | 31.5k | using Types = std::decay_t<decltype(types)>; | 115 | 31.5k | using ToDataType = typename Types::LeftType; | 116 | | | 117 | | if constexpr (!(IsDataTypeDecimalOrNumber<ToDataType> || IsDatelikeV1Types<ToDataType> || | 118 | | IsDatelikeV2Types<ToDataType> || | 119 | | std::is_same_v<ToDataType, DataTypeTimeV2>)) { | 120 | | return false; | 121 | | } | 122 | 31.5k | return call_on_index_and_data_type< | 123 | 31.5k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 31.5k | using Types2 = std::decay_t<decltype(types2)>; | 125 | 31.5k | using FromDataType = typename Types2::LeftType; | 126 | 31.5k | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | 31.5k | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | 31.5k | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | 31.5k | return false; | 130 | 31.5k | } | 131 | 31.5k | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 31.5k | using FromFieldType = typename FromDataType::FieldType; | 133 | 31.5k | using ToFieldType = typename ToDataType::FieldType; | 134 | 31.5k | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 31.5k | UInt32 from_scale = 0; | 136 | | | 137 | 31.5k | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 31.5k | const auto* from_decimal_type = | 139 | 31.5k | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 31.5k | from_precision = | 141 | 31.5k | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 31.5k | from_scale = from_decimal_type->get_scale(); | 143 | 31.5k | } | 144 | | | 145 | 31.5k | UInt32 to_max_digits = 0; | 146 | 31.5k | UInt32 to_precision = 0; | 147 | 31.5k | UInt32 to_scale = 0; | 148 | | | 149 | 31.5k | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 31.5k | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 31.5k | const auto* to_decimal_type = | 153 | 31.5k | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 31.5k | to_precision = to_decimal_type->get_precision(); | 155 | 31.5k | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 31.5k | to_scale = to_decimal_type->get_scale(); | 158 | 31.5k | ToDataType::check_type_scale(to_scale); | 159 | 31.5k | } | 160 | 31.5k | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | 31.5k | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | 31.5k | to_precision = to_max_digits; | 163 | 31.5k | } | 164 | | | 165 | 31.5k | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 31.5k | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 31.5k | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 31.5k | if (to_scale > from_scale) { | 170 | 31.5k | multiply_may_overflow &= | 171 | 31.5k | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 31.5k | } | 173 | 31.5k | return narrow_integral || multiply_may_overflow; | 174 | 31.5k | } | 175 | 31.5k | return false; | 176 | 31.5k | }); | 177 | 31.5k | }; |
function_cast.cpp:_ZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE20EEEvEEEEbRKT_ Line | Count | Source | 113 | 228 | auto make_default_wrapper = [&](const auto& types) -> bool { | 114 | 228 | using Types = std::decay_t<decltype(types)>; | 115 | 228 | using ToDataType = typename Types::LeftType; | 116 | | | 117 | | if constexpr (!(IsDataTypeDecimalOrNumber<ToDataType> || IsDatelikeV1Types<ToDataType> || | 118 | | IsDatelikeV2Types<ToDataType> || | 119 | | std::is_same_v<ToDataType, DataTypeTimeV2>)) { | 120 | | return false; | 121 | | } | 122 | 228 | return call_on_index_and_data_type< | 123 | 228 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 228 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 228 | using FromDataType = typename Types2::LeftType; | 126 | 228 | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | 228 | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | 228 | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | 228 | return false; | 130 | 228 | } | 131 | 228 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 228 | using FromFieldType = typename FromDataType::FieldType; | 133 | 228 | using ToFieldType = typename ToDataType::FieldType; | 134 | 228 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 228 | UInt32 from_scale = 0; | 136 | | | 137 | 228 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 228 | const auto* from_decimal_type = | 139 | 228 | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 228 | from_precision = | 141 | 228 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 228 | from_scale = from_decimal_type->get_scale(); | 143 | 228 | } | 144 | | | 145 | 228 | UInt32 to_max_digits = 0; | 146 | 228 | UInt32 to_precision = 0; | 147 | 228 | UInt32 to_scale = 0; | 148 | | | 149 | 228 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 228 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 228 | const auto* to_decimal_type = | 153 | 228 | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 228 | to_precision = to_decimal_type->get_precision(); | 155 | 228 | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 228 | to_scale = to_decimal_type->get_scale(); | 158 | 228 | ToDataType::check_type_scale(to_scale); | 159 | 228 | } | 160 | 228 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | 228 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | 228 | to_precision = to_max_digits; | 163 | 228 | } | 164 | | | 165 | 228 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 228 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 228 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 228 | if (to_scale > from_scale) { | 170 | 228 | multiply_may_overflow &= | 171 | 228 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 228 | } | 173 | 228 | return narrow_integral || multiply_may_overflow; | 174 | 228 | } | 175 | 228 | return false; | 176 | 228 | }); | 177 | 228 | }; |
function_cast.cpp:_ZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE30EEEvEEEEbRKT_ Line | Count | Source | 113 | 156k | auto make_default_wrapper = [&](const auto& types) -> bool { | 114 | 156k | using Types = std::decay_t<decltype(types)>; | 115 | 156k | using ToDataType = typename Types::LeftType; | 116 | | | 117 | | if constexpr (!(IsDataTypeDecimalOrNumber<ToDataType> || IsDatelikeV1Types<ToDataType> || | 118 | | IsDatelikeV2Types<ToDataType> || | 119 | | std::is_same_v<ToDataType, DataTypeTimeV2>)) { | 120 | | return false; | 121 | | } | 122 | 156k | return call_on_index_and_data_type< | 123 | 156k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 156k | using Types2 = std::decay_t<decltype(types2)>; | 125 | 156k | using FromDataType = typename Types2::LeftType; | 126 | 156k | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | 156k | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | 156k | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | 156k | return false; | 130 | 156k | } | 131 | 156k | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 156k | using FromFieldType = typename FromDataType::FieldType; | 133 | 156k | using ToFieldType = typename ToDataType::FieldType; | 134 | 156k | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 156k | UInt32 from_scale = 0; | 136 | | | 137 | 156k | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 156k | const auto* from_decimal_type = | 139 | 156k | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 156k | from_precision = | 141 | 156k | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 156k | from_scale = from_decimal_type->get_scale(); | 143 | 156k | } | 144 | | | 145 | 156k | UInt32 to_max_digits = 0; | 146 | 156k | UInt32 to_precision = 0; | 147 | 156k | UInt32 to_scale = 0; | 148 | | | 149 | 156k | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 156k | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 156k | const auto* to_decimal_type = | 153 | 156k | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 156k | to_precision = to_decimal_type->get_precision(); | 155 | 156k | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 156k | to_scale = to_decimal_type->get_scale(); | 158 | 156k | ToDataType::check_type_scale(to_scale); | 159 | 156k | } | 160 | 156k | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | 156k | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | 156k | to_precision = to_max_digits; | 163 | 156k | } | 164 | | | 165 | 156k | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 156k | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 156k | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 156k | if (to_scale > from_scale) { | 170 | 156k | multiply_may_overflow &= | 171 | 156k | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 156k | } | 173 | 156k | return narrow_integral || multiply_may_overflow; | 174 | 156k | } | 175 | 156k | return false; | 176 | 156k | }); | 177 | 156k | }; |
function_cast.cpp:_ZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE35EEEvEEEEbRKT_ Line | Count | Source | 113 | 10.8k | auto make_default_wrapper = [&](const auto& types) -> bool { | 114 | 10.8k | using Types = std::decay_t<decltype(types)>; | 115 | 10.8k | using ToDataType = typename Types::LeftType; | 116 | | | 117 | | if constexpr (!(IsDataTypeDecimalOrNumber<ToDataType> || IsDatelikeV1Types<ToDataType> || | 118 | | IsDatelikeV2Types<ToDataType> || | 119 | | std::is_same_v<ToDataType, DataTypeTimeV2>)) { | 120 | | return false; | 121 | | } | 122 | 10.8k | return call_on_index_and_data_type< | 123 | 10.8k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 10.8k | using Types2 = std::decay_t<decltype(types2)>; | 125 | 10.8k | using FromDataType = typename Types2::LeftType; | 126 | 10.8k | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | 10.8k | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | 10.8k | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | 10.8k | return false; | 130 | 10.8k | } | 131 | 10.8k | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 10.8k | using FromFieldType = typename FromDataType::FieldType; | 133 | 10.8k | using ToFieldType = typename ToDataType::FieldType; | 134 | 10.8k | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 10.8k | UInt32 from_scale = 0; | 136 | | | 137 | 10.8k | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 10.8k | const auto* from_decimal_type = | 139 | 10.8k | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 10.8k | from_precision = | 141 | 10.8k | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 10.8k | from_scale = from_decimal_type->get_scale(); | 143 | 10.8k | } | 144 | | | 145 | 10.8k | UInt32 to_max_digits = 0; | 146 | 10.8k | UInt32 to_precision = 0; | 147 | 10.8k | UInt32 to_scale = 0; | 148 | | | 149 | 10.8k | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 10.8k | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 10.8k | const auto* to_decimal_type = | 153 | 10.8k | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 10.8k | to_precision = to_decimal_type->get_precision(); | 155 | 10.8k | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 10.8k | to_scale = to_decimal_type->get_scale(); | 158 | 10.8k | ToDataType::check_type_scale(to_scale); | 159 | 10.8k | } | 160 | 10.8k | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | 10.8k | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | 10.8k | to_precision = to_max_digits; | 163 | 10.8k | } | 164 | | | 165 | 10.8k | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 10.8k | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 10.8k | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 10.8k | if (to_scale > from_scale) { | 170 | 10.8k | multiply_may_overflow &= | 171 | 10.8k | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 10.8k | } | 173 | 10.8k | return narrow_integral || multiply_may_overflow; | 174 | 10.8k | } | 175 | 10.8k | return false; | 176 | 10.8k | }); | 177 | 10.8k | }; |
function_cast.cpp:_ZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_12DataTypeDateEvEEEEbRKT_ Line | Count | Source | 113 | 32 | auto make_default_wrapper = [&](const auto& types) -> bool { | 114 | 32 | using Types = std::decay_t<decltype(types)>; | 115 | 32 | using ToDataType = typename Types::LeftType; | 116 | | | 117 | | if constexpr (!(IsDataTypeDecimalOrNumber<ToDataType> || IsDatelikeV1Types<ToDataType> || | 118 | | IsDatelikeV2Types<ToDataType> || | 119 | | std::is_same_v<ToDataType, DataTypeTimeV2>)) { | 120 | | return false; | 121 | | } | 122 | 32 | return call_on_index_and_data_type< | 123 | 32 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 32 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 32 | using FromDataType = typename Types2::LeftType; | 126 | 32 | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | 32 | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | 32 | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | 32 | return false; | 130 | 32 | } | 131 | 32 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 32 | using FromFieldType = typename FromDataType::FieldType; | 133 | 32 | using ToFieldType = typename ToDataType::FieldType; | 134 | 32 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 32 | UInt32 from_scale = 0; | 136 | | | 137 | 32 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 32 | const auto* from_decimal_type = | 139 | 32 | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 32 | from_precision = | 141 | 32 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 32 | from_scale = from_decimal_type->get_scale(); | 143 | 32 | } | 144 | | | 145 | 32 | UInt32 to_max_digits = 0; | 146 | 32 | UInt32 to_precision = 0; | 147 | 32 | UInt32 to_scale = 0; | 148 | | | 149 | 32 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 32 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 32 | const auto* to_decimal_type = | 153 | 32 | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 32 | to_precision = to_decimal_type->get_precision(); | 155 | 32 | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 32 | to_scale = to_decimal_type->get_scale(); | 158 | 32 | ToDataType::check_type_scale(to_scale); | 159 | 32 | } | 160 | 32 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | 32 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | 32 | to_precision = to_max_digits; | 163 | 32 | } | 164 | | | 165 | 32 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 32 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 32 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 32 | if (to_scale > from_scale) { | 170 | 32 | multiply_may_overflow &= | 171 | 32 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 32 | } | 173 | 32 | return narrow_integral || multiply_may_overflow; | 174 | 32 | } | 175 | 32 | return false; | 176 | 32 | }); | 177 | 32 | }; |
function_cast.cpp:_ZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeDateV2EvEEEEbRKT_ Line | Count | Source | 113 | 137k | auto make_default_wrapper = [&](const auto& types) -> bool { | 114 | 137k | using Types = std::decay_t<decltype(types)>; | 115 | 137k | using ToDataType = typename Types::LeftType; | 116 | | | 117 | | if constexpr (!(IsDataTypeDecimalOrNumber<ToDataType> || IsDatelikeV1Types<ToDataType> || | 118 | | IsDatelikeV2Types<ToDataType> || | 119 | | std::is_same_v<ToDataType, DataTypeTimeV2>)) { | 120 | | return false; | 121 | | } | 122 | 137k | return call_on_index_and_data_type< | 123 | 137k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 137k | using Types2 = std::decay_t<decltype(types2)>; | 125 | 137k | using FromDataType = typename Types2::LeftType; | 126 | 137k | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | 137k | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | 137k | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | 137k | return false; | 130 | 137k | } | 131 | 137k | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 137k | using FromFieldType = typename FromDataType::FieldType; | 133 | 137k | using ToFieldType = typename ToDataType::FieldType; | 134 | 137k | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 137k | UInt32 from_scale = 0; | 136 | | | 137 | 137k | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 137k | const auto* from_decimal_type = | 139 | 137k | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 137k | from_precision = | 141 | 137k | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 137k | from_scale = from_decimal_type->get_scale(); | 143 | 137k | } | 144 | | | 145 | 137k | UInt32 to_max_digits = 0; | 146 | 137k | UInt32 to_precision = 0; | 147 | 137k | UInt32 to_scale = 0; | 148 | | | 149 | 137k | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 137k | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 137k | const auto* to_decimal_type = | 153 | 137k | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 137k | to_precision = to_decimal_type->get_precision(); | 155 | 137k | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 137k | to_scale = to_decimal_type->get_scale(); | 158 | 137k | ToDataType::check_type_scale(to_scale); | 159 | 137k | } | 160 | 137k | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | 137k | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | 137k | to_precision = to_max_digits; | 163 | 137k | } | 164 | | | 165 | 137k | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 137k | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 137k | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 137k | if (to_scale > from_scale) { | 170 | 137k | multiply_may_overflow &= | 171 | 137k | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 137k | } | 173 | 137k | return narrow_integral || multiply_may_overflow; | 174 | 137k | } | 175 | 137k | return false; | 176 | 137k | }); | 177 | 137k | }; |
function_cast.cpp:_ZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_18DataTypeDateTimeV2EvEEEEbRKT_ Line | Count | Source | 113 | 135k | auto make_default_wrapper = [&](const auto& types) -> bool { | 114 | 135k | using Types = std::decay_t<decltype(types)>; | 115 | 135k | using ToDataType = typename Types::LeftType; | 116 | | | 117 | | if constexpr (!(IsDataTypeDecimalOrNumber<ToDataType> || IsDatelikeV1Types<ToDataType> || | 118 | | IsDatelikeV2Types<ToDataType> || | 119 | | std::is_same_v<ToDataType, DataTypeTimeV2>)) { | 120 | | return false; | 121 | | } | 122 | 135k | return call_on_index_and_data_type< | 123 | 135k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 135k | using Types2 = std::decay_t<decltype(types2)>; | 125 | 135k | using FromDataType = typename Types2::LeftType; | 126 | 135k | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | 135k | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | 135k | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | 135k | return false; | 130 | 135k | } | 131 | 135k | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 135k | using FromFieldType = typename FromDataType::FieldType; | 133 | 135k | using ToFieldType = typename ToDataType::FieldType; | 134 | 135k | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 135k | UInt32 from_scale = 0; | 136 | | | 137 | 135k | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 135k | const auto* from_decimal_type = | 139 | 135k | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 135k | from_precision = | 141 | 135k | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 135k | from_scale = from_decimal_type->get_scale(); | 143 | 135k | } | 144 | | | 145 | 135k | UInt32 to_max_digits = 0; | 146 | 135k | UInt32 to_precision = 0; | 147 | 135k | UInt32 to_scale = 0; | 148 | | | 149 | 135k | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 135k | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 135k | const auto* to_decimal_type = | 153 | 135k | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 135k | to_precision = to_decimal_type->get_precision(); | 155 | 135k | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 135k | to_scale = to_decimal_type->get_scale(); | 158 | 135k | ToDataType::check_type_scale(to_scale); | 159 | 135k | } | 160 | 135k | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | 135k | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | 135k | to_precision = to_max_digits; | 163 | 135k | } | 164 | | | 165 | 135k | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 135k | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 135k | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 135k | if (to_scale > from_scale) { | 170 | 135k | multiply_may_overflow &= | 171 | 135k | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 135k | } | 173 | 135k | return narrow_integral || multiply_may_overflow; | 174 | 135k | } | 175 | 135k | return false; | 176 | 135k | }); | 177 | 135k | }; |
function_cast.cpp:_ZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_16DataTypeDateTimeEvEEEEbRKT_ Line | Count | Source | 113 | 26 | auto make_default_wrapper = [&](const auto& types) -> bool { | 114 | 26 | using Types = std::decay_t<decltype(types)>; | 115 | 26 | using ToDataType = typename Types::LeftType; | 116 | | | 117 | | if constexpr (!(IsDataTypeDecimalOrNumber<ToDataType> || IsDatelikeV1Types<ToDataType> || | 118 | | IsDatelikeV2Types<ToDataType> || | 119 | | std::is_same_v<ToDataType, DataTypeTimeV2>)) { | 120 | | return false; | 121 | | } | 122 | 26 | return call_on_index_and_data_type< | 123 | 26 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 26 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 26 | using FromDataType = typename Types2::LeftType; | 126 | 26 | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | 26 | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | 26 | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | 26 | return false; | 130 | 26 | } | 131 | 26 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 26 | using FromFieldType = typename FromDataType::FieldType; | 133 | 26 | using ToFieldType = typename ToDataType::FieldType; | 134 | 26 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 26 | UInt32 from_scale = 0; | 136 | | | 137 | 26 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 26 | const auto* from_decimal_type = | 139 | 26 | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 26 | from_precision = | 141 | 26 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 26 | from_scale = from_decimal_type->get_scale(); | 143 | 26 | } | 144 | | | 145 | 26 | UInt32 to_max_digits = 0; | 146 | 26 | UInt32 to_precision = 0; | 147 | 26 | UInt32 to_scale = 0; | 148 | | | 149 | 26 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 26 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 26 | const auto* to_decimal_type = | 153 | 26 | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 26 | to_precision = to_decimal_type->get_precision(); | 155 | 26 | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 26 | to_scale = to_decimal_type->get_scale(); | 158 | 26 | ToDataType::check_type_scale(to_scale); | 159 | 26 | } | 160 | 26 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | 26 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | 26 | to_precision = to_max_digits; | 163 | 26 | } | 164 | | | 165 | 26 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 26 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 26 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 26 | if (to_scale > from_scale) { | 170 | 26 | multiply_may_overflow &= | 171 | 26 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 26 | } | 173 | 26 | return narrow_integral || multiply_may_overflow; | 174 | 26 | } | 175 | 26 | return false; | 176 | 26 | }); | 177 | 26 | }; |
function_cast.cpp:_ZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeTimeV2EvEEEEbRKT_ Line | Count | Source | 113 | 468 | auto make_default_wrapper = [&](const auto& types) -> bool { | 114 | 468 | using Types = std::decay_t<decltype(types)>; | 115 | 468 | using ToDataType = typename Types::LeftType; | 116 | | | 117 | | if constexpr (!(IsDataTypeDecimalOrNumber<ToDataType> || IsDatelikeV1Types<ToDataType> || | 118 | | IsDatelikeV2Types<ToDataType> || | 119 | | std::is_same_v<ToDataType, DataTypeTimeV2>)) { | 120 | | return false; | 121 | | } | 122 | 468 | return call_on_index_and_data_type< | 123 | 468 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 468 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 468 | using FromDataType = typename Types2::LeftType; | 126 | 468 | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | 468 | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | 468 | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | 468 | return false; | 130 | 468 | } | 131 | 468 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 468 | using FromFieldType = typename FromDataType::FieldType; | 133 | 468 | using ToFieldType = typename ToDataType::FieldType; | 134 | 468 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 468 | UInt32 from_scale = 0; | 136 | | | 137 | 468 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 468 | const auto* from_decimal_type = | 139 | 468 | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 468 | from_precision = | 141 | 468 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 468 | from_scale = from_decimal_type->get_scale(); | 143 | 468 | } | 144 | | | 145 | 468 | UInt32 to_max_digits = 0; | 146 | 468 | UInt32 to_precision = 0; | 147 | 468 | UInt32 to_scale = 0; | 148 | | | 149 | 468 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 468 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 468 | const auto* to_decimal_type = | 153 | 468 | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 468 | to_precision = to_decimal_type->get_precision(); | 155 | 468 | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 468 | to_scale = to_decimal_type->get_scale(); | 158 | 468 | ToDataType::check_type_scale(to_scale); | 159 | 468 | } | 160 | 468 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | 468 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | 468 | to_precision = to_max_digits; | 163 | 468 | } | 164 | | | 165 | 468 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 468 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 468 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 468 | if (to_scale > from_scale) { | 170 | 468 | multiply_may_overflow &= | 171 | 468 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 468 | } | 173 | 468 | return narrow_integral || multiply_may_overflow; | 174 | 468 | } | 175 | 468 | return false; | 176 | 468 | }); | 177 | 468 | }; |
function_cast.cpp:_ZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_19DataTypeTimeStampTzEvEEEEbRKT_ Line | Count | Source | 113 | 590 | auto make_default_wrapper = [&](const auto& types) -> bool { | 114 | 590 | using Types = std::decay_t<decltype(types)>; | 115 | 590 | using ToDataType = typename Types::LeftType; | 116 | | | 117 | | if constexpr (!(IsDataTypeDecimalOrNumber<ToDataType> || IsDatelikeV1Types<ToDataType> || | 118 | | IsDatelikeV2Types<ToDataType> || | 119 | 590 | std::is_same_v<ToDataType, DataTypeTimeV2>)) { | 120 | 590 | return false; | 121 | 590 | } | 122 | 0 | return call_on_index_and_data_type< | 123 | 590 | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 590 | using Types2 = std::decay_t<decltype(types2)>; | 125 | 590 | using FromDataType = typename Types2::LeftType; | 126 | 590 | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | 590 | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | 590 | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | 590 | return false; | 130 | 590 | } | 131 | 590 | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 590 | using FromFieldType = typename FromDataType::FieldType; | 133 | 590 | using ToFieldType = typename ToDataType::FieldType; | 134 | 590 | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 590 | UInt32 from_scale = 0; | 136 | | | 137 | 590 | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 590 | const auto* from_decimal_type = | 139 | 590 | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 590 | from_precision = | 141 | 590 | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 590 | from_scale = from_decimal_type->get_scale(); | 143 | 590 | } | 144 | | | 145 | 590 | UInt32 to_max_digits = 0; | 146 | 590 | UInt32 to_precision = 0; | 147 | 590 | UInt32 to_scale = 0; | 148 | | | 149 | 590 | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 590 | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 590 | const auto* to_decimal_type = | 153 | 590 | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 590 | to_precision = to_decimal_type->get_precision(); | 155 | 590 | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 590 | to_scale = to_decimal_type->get_scale(); | 158 | 590 | ToDataType::check_type_scale(to_scale); | 159 | 590 | } | 160 | 590 | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | 590 | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | 590 | to_precision = to_max_digits; | 163 | 590 | } | 164 | | | 165 | 590 | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 590 | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 590 | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 590 | if (to_scale > from_scale) { | 170 | 590 | multiply_may_overflow &= | 171 | 590 | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 590 | } | 173 | 590 | return narrow_integral || multiply_may_overflow; | 174 | 590 | } | 175 | 590 | return false; | 176 | 590 | }); | 177 | 590 | }; |
function_cast.cpp:_ZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_12DataTypeIPv4EvEEEEbRKT_ Line | Count | Source | 113 | 65.4k | auto make_default_wrapper = [&](const auto& types) -> bool { | 114 | 65.4k | using Types = std::decay_t<decltype(types)>; | 115 | 65.4k | using ToDataType = typename Types::LeftType; | 116 | | | 117 | | if constexpr (!(IsDataTypeDecimalOrNumber<ToDataType> || IsDatelikeV1Types<ToDataType> || | 118 | | IsDatelikeV2Types<ToDataType> || | 119 | 65.4k | std::is_same_v<ToDataType, DataTypeTimeV2>)) { | 120 | 65.4k | return false; | 121 | 65.4k | } | 122 | 0 | return call_on_index_and_data_type< | 123 | 65.4k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 65.4k | using Types2 = std::decay_t<decltype(types2)>; | 125 | 65.4k | using FromDataType = typename Types2::LeftType; | 126 | 65.4k | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | 65.4k | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | 65.4k | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | 65.4k | return false; | 130 | 65.4k | } | 131 | 65.4k | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 65.4k | using FromFieldType = typename FromDataType::FieldType; | 133 | 65.4k | using ToFieldType = typename ToDataType::FieldType; | 134 | 65.4k | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 65.4k | UInt32 from_scale = 0; | 136 | | | 137 | 65.4k | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 65.4k | const auto* from_decimal_type = | 139 | 65.4k | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 65.4k | from_precision = | 141 | 65.4k | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 65.4k | from_scale = from_decimal_type->get_scale(); | 143 | 65.4k | } | 144 | | | 145 | 65.4k | UInt32 to_max_digits = 0; | 146 | 65.4k | UInt32 to_precision = 0; | 147 | 65.4k | UInt32 to_scale = 0; | 148 | | | 149 | 65.4k | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 65.4k | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 65.4k | const auto* to_decimal_type = | 153 | 65.4k | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 65.4k | to_precision = to_decimal_type->get_precision(); | 155 | 65.4k | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 65.4k | to_scale = to_decimal_type->get_scale(); | 158 | 65.4k | ToDataType::check_type_scale(to_scale); | 159 | 65.4k | } | 160 | 65.4k | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | 65.4k | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | 65.4k | to_precision = to_max_digits; | 163 | 65.4k | } | 164 | | | 165 | 65.4k | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 65.4k | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 65.4k | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 65.4k | if (to_scale > from_scale) { | 170 | 65.4k | multiply_may_overflow &= | 171 | 65.4k | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 65.4k | } | 173 | 65.4k | return narrow_integral || multiply_may_overflow; | 174 | 65.4k | } | 175 | 65.4k | return false; | 176 | 65.4k | }); | 177 | 65.4k | }; |
function_cast.cpp:_ZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_12DataTypeIPv6EvEEEEbRKT_ Line | Count | Source | 113 | 144k | auto make_default_wrapper = [&](const auto& types) -> bool { | 114 | 144k | using Types = std::decay_t<decltype(types)>; | 115 | 144k | using ToDataType = typename Types::LeftType; | 116 | | | 117 | | if constexpr (!(IsDataTypeDecimalOrNumber<ToDataType> || IsDatelikeV1Types<ToDataType> || | 118 | | IsDatelikeV2Types<ToDataType> || | 119 | 144k | std::is_same_v<ToDataType, DataTypeTimeV2>)) { | 120 | 144k | return false; | 121 | 144k | } | 122 | 0 | return call_on_index_and_data_type< | 123 | 144k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 144k | using Types2 = std::decay_t<decltype(types2)>; | 125 | 144k | using FromDataType = typename Types2::LeftType; | 126 | 144k | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | 144k | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | 144k | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | 144k | return false; | 130 | 144k | } | 131 | 144k | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 144k | using FromFieldType = typename FromDataType::FieldType; | 133 | 144k | using ToFieldType = typename ToDataType::FieldType; | 134 | 144k | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 144k | UInt32 from_scale = 0; | 136 | | | 137 | 144k | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 144k | const auto* from_decimal_type = | 139 | 144k | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 144k | from_precision = | 141 | 144k | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 144k | from_scale = from_decimal_type->get_scale(); | 143 | 144k | } | 144 | | | 145 | 144k | UInt32 to_max_digits = 0; | 146 | 144k | UInt32 to_precision = 0; | 147 | 144k | UInt32 to_scale = 0; | 148 | | | 149 | 144k | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 144k | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 144k | const auto* to_decimal_type = | 153 | 144k | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 144k | to_precision = to_decimal_type->get_precision(); | 155 | 144k | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 144k | to_scale = to_decimal_type->get_scale(); | 158 | 144k | ToDataType::check_type_scale(to_scale); | 159 | 144k | } | 160 | 144k | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | 144k | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | 144k | to_precision = to_max_digits; | 163 | 144k | } | 164 | | | 165 | 144k | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 144k | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 144k | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 144k | if (to_scale > from_scale) { | 170 | 144k | multiply_may_overflow &= | 171 | 144k | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 144k | } | 173 | 144k | return narrow_integral || multiply_may_overflow; | 174 | 144k | } | 175 | 144k | return false; | 176 | 144k | }); | 177 | 144k | }; |
function_cast.cpp:_ZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeStringEvEEEEbRKT_ Line | Count | Source | 113 | 98.6k | auto make_default_wrapper = [&](const auto& types) -> bool { | 114 | 98.6k | using Types = std::decay_t<decltype(types)>; | 115 | 98.6k | using ToDataType = typename Types::LeftType; | 116 | | | 117 | | if constexpr (!(IsDataTypeDecimalOrNumber<ToDataType> || IsDatelikeV1Types<ToDataType> || | 118 | | IsDatelikeV2Types<ToDataType> || | 119 | 98.6k | std::is_same_v<ToDataType, DataTypeTimeV2>)) { | 120 | 98.6k | return false; | 121 | 98.6k | } | 122 | 0 | return call_on_index_and_data_type< | 123 | 98.6k | ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool { | 124 | 98.6k | using Types2 = std::decay_t<decltype(types2)>; | 125 | 98.6k | using FromDataType = typename Types2::LeftType; | 126 | 98.6k | if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || | 127 | 98.6k | IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> || | 128 | 98.6k | std::is_same_v<FromDataType, DataTypeTimeV2>)) { | 129 | 98.6k | return false; | 130 | 98.6k | } | 131 | 98.6k | if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) { | 132 | 98.6k | using FromFieldType = typename FromDataType::FieldType; | 133 | 98.6k | using ToFieldType = typename ToDataType::FieldType; | 134 | 98.6k | UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>(); | 135 | 98.6k | UInt32 from_scale = 0; | 136 | | | 137 | 98.6k | if constexpr (IsDataTypeDecimal<FromDataType>) { | 138 | 98.6k | const auto* from_decimal_type = | 139 | 98.6k | check_and_get_data_type<FromDataType>(from_type.get()); | 140 | 98.6k | from_precision = | 141 | 98.6k | NumberTraits::max_ascii_len<typename FromFieldType::NativeType>(); | 142 | 98.6k | from_scale = from_decimal_type->get_scale(); | 143 | 98.6k | } | 144 | | | 145 | 98.6k | UInt32 to_max_digits = 0; | 146 | 98.6k | UInt32 to_precision = 0; | 147 | 98.6k | UInt32 to_scale = 0; | 148 | | | 149 | 98.6k | if constexpr (IsDataTypeDecimal<ToDataType>) { | 150 | 98.6k | to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>(); | 151 | | | 152 | 98.6k | const auto* to_decimal_type = | 153 | 98.6k | check_and_get_data_type<ToDataType>(to_type.get()); | 154 | 98.6k | to_precision = to_decimal_type->get_precision(); | 155 | 98.6k | ToDataType::check_type_precision(to_precision); | 156 | | | 157 | 98.6k | to_scale = to_decimal_type->get_scale(); | 158 | 98.6k | ToDataType::check_type_scale(to_scale); | 159 | 98.6k | } | 160 | 98.6k | if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) { | 161 | 98.6k | to_max_digits = NumberTraits::max_ascii_len<ToFieldType>(); | 162 | 98.6k | to_precision = to_max_digits; | 163 | 98.6k | } | 164 | | | 165 | 98.6k | bool narrow_integral = context->check_overflow_for_decimal() && | 166 | 98.6k | (to_precision - to_scale) <= (from_precision - from_scale); | 167 | | | 168 | 98.6k | bool multiply_may_overflow = context->check_overflow_for_decimal(); | 169 | 98.6k | if (to_scale > from_scale) { | 170 | 98.6k | multiply_may_overflow &= | 171 | 98.6k | (from_precision + to_scale - from_scale) >= to_max_digits; | 172 | 98.6k | } | 173 | 98.6k | return narrow_integral || multiply_may_overflow; | 174 | 98.6k | } | 175 | 98.6k | return false; | 176 | 98.6k | }); | 177 | 98.6k | }; |
|
178 | | |
179 | 1.34M | return call_on_index_and_data_type<void>(to_type->get_primitive_type(), make_default_wrapper); |
180 | 1.43M | } |
181 | | |
182 | | WrapperType prepare_remove_nullable(FunctionContext* context, const DataTypePtr& from_type, |
183 | 1.47M | const DataTypePtr& to_type) { |
184 | | /// Determine whether pre-processing and/or post-processing must take place during conversion. |
185 | 1.47M | bool result_is_nullable = to_type->is_nullable(); |
186 | | |
187 | 1.47M | if (result_is_nullable) { |
188 | 1.43M | return [from_type, to_type](FunctionContext* context, Block& block, |
189 | 1.43M | const ColumnNumbers& arguments, uint32_t result, |
190 | 1.43M | size_t input_rows_count, |
191 | 1.43M | const NullMap::value_type* null_map = nullptr) { |
192 | 1.43M | auto from_type_not_nullable = remove_nullable(from_type); |
193 | 1.43M | auto to_type_not_nullable = remove_nullable(to_type); |
194 | | |
195 | 1.43M | bool replace_null_data_to_default = need_replace_null_data_to_default( |
196 | 1.43M | context, from_type_not_nullable, to_type_not_nullable); |
197 | | |
198 | 1.43M | auto nested_result_index = block.columns(); |
199 | 1.43M | block.insert(block.get_by_position(result).unnest_nullable()); |
200 | 1.43M | auto nested_source_index = block.columns(); |
201 | 1.43M | block.insert(block.get_by_position(arguments[0]) |
202 | 1.43M | .unnest_nullable(replace_null_data_to_default)); |
203 | | |
204 | 1.43M | const auto& arg_col = block.get_by_position(arguments[0]); |
205 | 1.43M | const NullMap::value_type* arg_null_map = nullptr; |
206 | 1.43M | if (const auto* nullable = check_and_get_column<ColumnNullable>(*arg_col.column)) { |
207 | 1.38M | arg_null_map = nullable->get_null_map_data().data(); |
208 | 1.38M | } |
209 | 1.43M | RETURN_IF_ERROR(prepare_impl(context, from_type_not_nullable, to_type_not_nullable)( |
210 | 1.43M | context, block, {nested_source_index}, nested_result_index, input_rows_count, |
211 | 1.43M | arg_null_map)); |
212 | | |
213 | 1.40M | block.get_by_position(result).column = |
214 | 1.40M | wrap_in_nullable(block.get_by_position(nested_result_index).column, block, |
215 | 1.40M | arguments, input_rows_count); |
216 | | |
217 | 1.40M | block.erase(nested_source_index); |
218 | 1.40M | block.erase(nested_result_index); |
219 | 1.40M | return Status::OK(); |
220 | 1.43M | }; |
221 | 1.43M | } else { |
222 | 42.8k | return prepare_impl(context, from_type, to_type); |
223 | 42.8k | } |
224 | 1.47M | } |
225 | | |
226 | | /// 'from_type' and 'to_type' are nested types in case of Nullable. |
227 | | /// 'requested_result_is_nullable' is true if CAST to Nullable type is requested. |
228 | | // NOLINTNEXTLINE(readability-function-size) |
229 | | WrapperType prepare_impl(FunctionContext* context, const DataTypePtr& origin_from_type, |
230 | 1.49M | const DataTypePtr& origin_to_type) { |
231 | 1.49M | auto to_type = get_serialized_type(origin_to_type); |
232 | 1.49M | auto from_type = get_serialized_type(origin_from_type); |
233 | 1.49M | if (from_type->equals(*to_type)) { |
234 | 102k | return create_identity_wrapper(from_type); |
235 | 102k | } |
236 | | |
237 | 1.39M | const auto* from_variant_v1 = |
238 | 1.39M | dynamic_cast<const DataTypeVariant*>(remove_nullable(from_type).get()); |
239 | 1.39M | const auto* to_variant_v1 = |
240 | 1.39M | dynamic_cast<const DataTypeVariant*>(remove_nullable(to_type).get()); |
241 | 1.39M | const auto* from_variant_v2 = |
242 | 1.39M | dynamic_cast<const DataTypeVariantV2*>(remove_nullable(from_type).get()); |
243 | 1.39M | const auto* to_variant_v2 = |
244 | 1.39M | dynamic_cast<const DataTypeVariantV2*>(remove_nullable(to_type).get()); |
245 | 1.39M | if ((from_variant_v1 != nullptr && to_variant_v2 != nullptr) || |
246 | 1.39M | (from_variant_v2 != nullptr && to_variant_v1 != nullptr)) { |
247 | 0 | return CastWrapper::create_unsupport_wrapper( |
248 | 0 | "Cast between legacy Variant and compute-only Variant V2 is not supported"); |
249 | 0 | } |
250 | | |
251 | | // variant needs to be judged first |
252 | 1.39M | if (to_type->get_primitive_type() == PrimitiveType::TYPE_VARIANT) { |
253 | 11.8k | if (to_variant_v2 != nullptr) { |
254 | 0 | return create_cast_to_variant_v2_wrapper(from_type); |
255 | 0 | } |
256 | 11.8k | DORIS_CHECK(to_variant_v1 != nullptr); |
257 | 11.8k | return create_cast_to_variant_wrapper(from_type, *to_variant_v1); |
258 | 11.8k | } |
259 | 1.38M | if (from_type->get_primitive_type() == PrimitiveType::TYPE_VARIANT) { |
260 | 21.0k | if (from_variant_v2 != nullptr) { |
261 | 0 | auto wrapper = create_cast_from_variant_v2_wrapper(to_type); |
262 | 0 | return [wrapper = std::move(wrapper)]( |
263 | 0 | FunctionContext* context, Block& block, const ColumnNumbers& arguments, |
264 | 0 | uint32_t result, size_t rows, const NullMap::value_type* null_map) { |
265 | 0 | RETURN_IF_ERROR(wrapper(context, block, arguments, result, rows, null_map)); |
266 | 0 | auto& result_column = block.get_by_position(result).column; |
267 | 0 | if (null_map == nullptr) { |
268 | 0 | const auto* nullable = check_and_get_column<ColumnNullable>(*result_column); |
269 | 0 | if (nullable != nullptr && !nullable->has_null()) { |
270 | 0 | result_column = nullable->get_nested_column_ptr(); |
271 | 0 | } |
272 | 0 | } |
273 | 0 | return Status::OK(); |
274 | 0 | }; |
275 | 0 | } |
276 | 21.0k | DORIS_CHECK(from_variant_v1 != nullptr); |
277 | 21.0k | return create_cast_from_variant_wrapper(*from_variant_v1, to_type); |
278 | 21.0k | } |
279 | | |
280 | 1.35M | if (from_type->get_primitive_type() == PrimitiveType::TYPE_JSONB) { |
281 | 9.35k | return create_cast_from_jsonb_wrapper(static_cast<const DataTypeJsonb&>(*from_type), |
282 | 9.35k | to_type, |
283 | 18.4E | context ? context->jsonb_string_as_string() : false); |
284 | 9.35k | } |
285 | | |
286 | 1.35M | switch (to_type->get_primitive_type()) { |
287 | 1.09k | case PrimitiveType::TYPE_BOOLEAN: |
288 | 1.09k | return create_boolean_wrapper(context, from_type); |
289 | 8.97k | case PrimitiveType::TYPE_TINYINT: |
290 | 14.5k | case PrimitiveType::TYPE_SMALLINT: |
291 | 168k | case PrimitiveType::TYPE_INT: |
292 | 223k | case PrimitiveType::TYPE_BIGINT: |
293 | 283k | case PrimitiveType::TYPE_LARGEINT: |
294 | 283k | return create_int_wrapper(context, from_type, to_type->get_primitive_type()); |
295 | 11.1k | case PrimitiveType::TYPE_FLOAT: |
296 | 43.5k | case PrimitiveType::TYPE_DOUBLE: |
297 | 43.5k | return create_float_wrapper(context, from_type, to_type->get_primitive_type()); |
298 | 32 | case PrimitiveType::TYPE_DATE: |
299 | 58 | case PrimitiveType::TYPE_DATETIME: |
300 | 137k | case PrimitiveType::TYPE_DATEV2: |
301 | 273k | case PrimitiveType::TYPE_DATETIMEV2: |
302 | 273k | case PrimitiveType::TYPE_TIMEV2: |
303 | 273k | return create_datelike_wrapper(context, from_type, to_type->get_primitive_type()); |
304 | 581 | case PrimitiveType::TYPE_TIMESTAMPTZ: |
305 | 581 | return create_timestamptz_wrapper(context, from_type); |
306 | 65.2k | case PrimitiveType::TYPE_IPV4: |
307 | 210k | case PrimitiveType::TYPE_IPV6: |
308 | 210k | return create_ip_wrapper(context, from_type, to_type->get_primitive_type()); |
309 | 293 | case PrimitiveType::TYPE_DECIMALV2: |
310 | 12.2k | case PrimitiveType::TYPE_DECIMAL32: |
311 | 46.5k | case PrimitiveType::TYPE_DECIMAL64: |
312 | 206k | case PrimitiveType::TYPE_DECIMAL128I: |
313 | 217k | case PrimitiveType::TYPE_DECIMAL256: |
314 | 217k | return create_decimal_wrapper(context, from_type, to_type->get_primitive_type()); |
315 | 20 | case PrimitiveType::TYPE_CHAR: |
316 | 10.4k | case PrimitiveType::TYPE_VARCHAR: |
317 | 106k | case PrimitiveType::TYPE_STRING: |
318 | 106k | return create_string_wrapper(from_type); |
319 | 147k | case PrimitiveType::TYPE_ARRAY: |
320 | 147k | return create_array_wrapper(context, from_type, |
321 | 147k | static_cast<const DataTypeArray&>(*to_type)); |
322 | 3.63k | case PrimitiveType::TYPE_STRUCT: |
323 | 3.63k | return create_struct_wrapper(context, from_type, |
324 | 3.63k | static_cast<const DataTypeStruct&>(*to_type)); |
325 | 3.54k | case PrimitiveType::TYPE_MAP: |
326 | 3.54k | return create_map_wrapper(context, from_type, static_cast<const DataTypeMap&>(*to_type)); |
327 | 6 | case PrimitiveType::TYPE_HLL: |
328 | 6 | return create_hll_wrapper(context, from_type, static_cast<const DataTypeHLL&>(*to_type)); |
329 | 5 | case PrimitiveType::TYPE_BITMAP: |
330 | 5 | return create_bitmap_wrapper(context, from_type, |
331 | 5 | static_cast<const DataTypeBitMap&>(*to_type)); |
332 | 2 | case PrimitiveType::TYPE_QUANTILE_STATE: |
333 | 2 | return create_quantile_state_wrapper(context, from_type, |
334 | 2 | static_cast<const DataTypeQuantileState&>(*to_type)); |
335 | 59.7k | case PrimitiveType::TYPE_JSONB: |
336 | 59.7k | return create_cast_to_jsonb_wrapper(from_type, static_cast<const DataTypeJsonb&>(*to_type), |
337 | 59.7k | context ? context->string_as_jsonb_string() : false); |
338 | 316 | case PrimitiveType::TYPE_VARBINARY: |
339 | 316 | return create_varbinary_wrapper(from_type); |
340 | 0 | default: |
341 | 0 | break; |
342 | 1.35M | } |
343 | | |
344 | 0 | return create_unsupport_wrapper(from_type->get_name(), to_type->get_name()); |
345 | 1.35M | } |
346 | | |
347 | | } // namespace CastWrapper |
348 | | |
349 | | class PreparedFunctionCast : public PreparedFunctionImpl { |
350 | | public: |
351 | | explicit PreparedFunctionCast(CastWrapper::WrapperType&& wrapper_function_, const char* name_) |
352 | 1.31M | : wrapper_function(std::move(wrapper_function_)), name(name_) {} |
353 | | |
354 | 0 | String get_name() const override { return name; } |
355 | | |
356 | | protected: |
357 | | Status execute_impl(FunctionContext* context, Block& block, const ColumnNumbers& arguments, |
358 | 1.31M | uint32_t result, size_t input_rows_count) const override { |
359 | 1.31M | return wrapper_function(context, block, arguments, result, input_rows_count, nullptr); |
360 | 1.31M | } |
361 | | |
362 | 1.31M | bool use_default_implementation_for_nulls() const override { return false; } |
363 | 1.31M | ColumnNumbers get_arguments_that_are_always_constant() const override { return {1}; } |
364 | | |
365 | | private: |
366 | | CastWrapper::WrapperType wrapper_function; |
367 | | const char* name; |
368 | | }; |
369 | | |
370 | | class FunctionCast final : public IFunctionBase { |
371 | | public: |
372 | | FunctionCast(const char* name_, DataTypes argument_types_, DataTypePtr return_type_) |
373 | 1.20M | : name(name_), |
374 | 1.20M | argument_types(std::move(argument_types_)), |
375 | 1.20M | return_type(std::move(return_type_)) {} |
376 | | |
377 | 1.31M | const DataTypes& get_argument_types() const override { return argument_types; } |
378 | 1.31M | const DataTypePtr& get_return_type() const override { return return_type; } |
379 | | |
380 | | PreparedFunctionPtr prepare(FunctionContext* context, const Block& /*sample_block*/, |
381 | | const ColumnNumbers& /*arguments*/, |
382 | 1.31M | uint32_t /*result*/) const override { |
383 | 1.31M | return std::make_shared<PreparedFunctionCast>( |
384 | 1.31M | CastWrapper::prepare_unpack_dictionaries(context, get_argument_types()[0], |
385 | 1.31M | get_return_type()), |
386 | 1.31M | name); |
387 | 1.31M | } |
388 | | |
389 | 0 | String get_name() const override { return name; } |
390 | | |
391 | 0 | bool is_use_default_implementation_for_constants() const override { return true; } |
392 | | |
393 | | private: |
394 | | const char* name = nullptr; |
395 | | |
396 | | DataTypes argument_types; |
397 | | DataTypePtr return_type; |
398 | | }; |
399 | | |
400 | | class FunctionBuilderCast : public FunctionBuilderImpl { |
401 | | public: |
402 | | static constexpr auto name = "CAST"; |
403 | 1.20M | static FunctionBuilderPtr create() { return std::make_shared<FunctionBuilderCast>(); } |
404 | | |
405 | 1.20M | FunctionBuilderCast() = default; |
406 | | |
407 | 1 | String get_name() const override { return name; } |
408 | | |
409 | 0 | size_t get_number_of_arguments() const override { return 2; } |
410 | | |
411 | 0 | ColumnNumbers get_arguments_that_are_always_constant() const override { return {1}; } |
412 | | |
413 | | protected: |
414 | | FunctionBasePtr build_impl(const ColumnsWithTypeAndName& arguments, |
415 | 1.20M | const DataTypePtr& return_type) const override { |
416 | 1.20M | DataTypes data_types(arguments.size()); |
417 | | |
418 | 3.58M | for (size_t i = 0; i < arguments.size(); ++i) { |
419 | 2.37M | data_types[i] = arguments[i].type; |
420 | 2.37M | } |
421 | | |
422 | 1.20M | return std::make_shared<FunctionCast>(name, data_types, return_type); |
423 | 1.20M | } |
424 | | |
425 | 1.20M | bool skip_return_type_check() const override { return true; } |
426 | 0 | DataTypePtr get_return_type_impl(const ColumnsWithTypeAndName& arguments) const override { |
427 | 0 | return nullptr; |
428 | 0 | } |
429 | | |
430 | 0 | bool use_default_implementation_for_nulls() const override { return false; } |
431 | | }; |
432 | | |
433 | 8 | void register_function_cast(SimpleFunctionFactory& factory) { |
434 | 8 | factory.register_function<FunctionBuilderCast>(); |
435 | 8 | } |
436 | | } // namespace doris |