Coverage Report

Created: 2026-03-13 12:42

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
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/primitive_type.h"
24
#include "exprs/function/cast/cast_to_array.h"
25
#include "exprs/function/cast/cast_to_boolean.h"
26
#include "exprs/function/cast/cast_to_date.h"
27
#include "exprs/function/cast/cast_to_decimal.h"
28
#include "exprs/function/cast/cast_to_float.h"
29
#include "exprs/function/cast/cast_to_int.h"
30
#include "exprs/function/cast/cast_to_ip.h"
31
#include "exprs/function/cast/cast_to_jsonb.h"
32
#include "exprs/function/cast/cast_to_map.h"
33
#include "exprs/function/cast/cast_to_string.h"
34
#include "exprs/function/cast/cast_to_struct.h"
35
#include "exprs/function/cast/cast_to_timestamptz.h"
36
#include "exprs/function/cast/cast_to_variant.h"
37
#include "exprs/function/simple_function_factory.h"
38
39
namespace doris {
40
41
namespace CastWrapper {
42
43
WrapperType create_hll_wrapper(FunctionContext* context, const DataTypePtr& from_type_untyped,
44
4
                               const DataTypeHLL& to_type) {
45
    /// Conversion from String through parsing.
46
4
    if (check_and_get_data_type<DataTypeString>(from_type_untyped.get())) {
47
4
        return cast_from_string_to_generic;
48
4
    }
49
50
0
    return CastWrapper::create_unsupport_wrapper("Cast to HLL only support from String type");
51
4
}
52
53
WrapperType create_bitmap_wrapper(FunctionContext* context, const DataTypePtr& from_type_untyped,
54
4
                                  const DataTypeBitMap& to_type) {
55
    /// Conversion from String through parsing.
56
4
    if (check_and_get_data_type<DataTypeString>(from_type_untyped.get())) {
57
4
        return cast_from_string_to_generic;
58
4
    }
59
60
0
    return CastWrapper::create_unsupport_wrapper("Cast to BitMap only support from String type");
61
4
}
62
63
0
WrapperType create_varbinary_wrapper(const DataTypePtr& from_type_untyped) {
64
    /// Conversion from String through parsing.
65
0
    if (check_and_get_data_type<DataTypeString>(from_type_untyped.get())) {
66
0
        return cast_from_string_to_generic;
67
0
    }
68
69
0
    return CastWrapper::create_unsupport_wrapper("Cast to Varbinary only support from String type");
70
0
}
71
72
WrapperType prepare_unpack_dictionaries(FunctionContext* context, const DataTypePtr& from_type,
73
126k
                                        const DataTypePtr& to_type) {
74
126k
    const auto& from_nested = from_type;
75
126k
    const auto& to_nested = to_type;
76
77
126k
    if (from_type->is_null_literal()) {
78
894
        if (!to_nested->is_nullable()) {
79
0
            return CastWrapper::create_unsupport_wrapper(
80
0
                    "Cannot convert NULL to a non-nullable type");
81
0
        }
82
83
894
        return [](FunctionContext* context, Block& block, const ColumnNumbers&, uint32_t result,
84
894
                  size_t input_rows_count, const NullMap::value_type* null_map = nullptr) {
85
            /// TODO: remove this in the future.
86
894
            auto& res = block.get_by_position(result);
87
894
            res.column = res.type->create_column_const_with_default_value(input_rows_count)
88
894
                                 ->convert_to_full_column_if_const();
89
894
            return Status::OK();
90
894
        };
91
894
    }
92
93
125k
    auto wrapper = prepare_remove_nullable(context, from_nested, to_nested);
94
95
125k
    return wrapper;
96
126k
}
97
98
bool need_replace_null_data_to_default(FunctionContext* context, const DataTypePtr& from_type,
99
118k
                                       const DataTypePtr& to_type) {
100
118k
    if (from_type->equals(*to_type)) {
101
7.12k
        return false;
102
7.12k
    }
103
104
111k
    auto make_default_wrapper = [&](const auto& types) -> bool {
105
59.7k
        using Types = std::decay_t<decltype(types)>;
106
59.7k
        using ToDataType = typename Types::LeftType;
107
108
        if constexpr (!(IsDataTypeDecimalOrNumber<ToDataType> || IsDatelikeV1Types<ToDataType> ||
109
                        IsDatelikeV2Types<ToDataType> ||
110
6.60k
                        std::is_same_v<ToDataType, DataTypeTimeV2>)) {
111
6.60k
            return false;
112
6.60k
        }
113
0
        return call_on_index_and_data_type<
114
59.7k
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
53.0k
            using Types2 = std::decay_t<decltype(types2)>;
116
53.0k
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
14.5k
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
14.5k
                return false;
121
14.5k
            }
122
20.6k
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
20.6k
                using FromFieldType = typename FromDataType::FieldType;
124
20.6k
                using ToFieldType = typename ToDataType::FieldType;
125
20.6k
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
20.6k
                UInt32 from_scale = 0;
127
128
20.6k
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
11.0k
                    const auto* from_decimal_type =
130
11.0k
                            check_and_get_data_type<FromDataType>(from_type.get());
131
11.0k
                    from_precision =
132
11.0k
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
11.0k
                    from_scale = from_decimal_type->get_scale();
134
11.0k
                }
135
136
20.6k
                UInt32 to_max_digits = 0;
137
20.6k
                UInt32 to_precision = 0;
138
20.6k
                UInt32 to_scale = 0;
139
140
20.6k
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
20.0k
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
20.0k
                    const auto* to_decimal_type =
144
20.0k
                            check_and_get_data_type<ToDataType>(to_type.get());
145
20.0k
                    to_precision = to_decimal_type->get_precision();
146
20.0k
                    ToDataType::check_type_precision(to_precision);
147
148
20.0k
                    to_scale = to_decimal_type->get_scale();
149
20.0k
                    ToDataType::check_type_scale(to_scale);
150
20.0k
                }
151
20.6k
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
577
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
577
                    to_precision = to_max_digits;
154
577
                }
155
156
20.6k
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
20.6k
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
20.6k
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
20.6k
                if (to_scale > from_scale) {
161
3.55k
                    multiply_may_overflow &=
162
3.55k
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
3.55k
                }
164
20.6k
                return narrow_integral || multiply_may_overflow;
165
20.6k
            }
166
0
            return false;
167
53.0k
        });
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
114
4
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
4
            using Types2 = std::decay_t<decltype(types2)>;
116
4
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
4
            return false;
167
4
        });
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE2EEEvEEEEbRKT_ENKUlSI_E_clINSB_INSC_ILSD_4EEESE_EEEEbSI_
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
114
2
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
2
            using Types2 = std::decay_t<decltype(types2)>;
116
2
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
2
            return false;
167
2
        });
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
114
2
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
2
            using Types2 = std::decay_t<decltype(types2)>;
116
2
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
2
            return false;
167
2
        });
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
114
2
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
2
            using Types2 = std::decay_t<decltype(types2)>;
116
2
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
2
            return false;
167
2
        });
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
114
2
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
2
            using Types2 = std::decay_t<decltype(types2)>;
116
2
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
2
            return false;
167
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
114
2
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
2
            using Types2 = std::decay_t<decltype(types2)>;
116
2
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
2
            return false;
167
2
        });
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
114
2
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
2
            using Types2 = std::decay_t<decltype(types2)>;
116
2
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
2
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
2
                using FromFieldType = typename FromDataType::FieldType;
124
2
                using ToFieldType = typename ToDataType::FieldType;
125
2
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
2
                UInt32 from_scale = 0;
127
128
2
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
2
                    const auto* from_decimal_type =
130
2
                            check_and_get_data_type<FromDataType>(from_type.get());
131
2
                    from_precision =
132
2
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
2
                    from_scale = from_decimal_type->get_scale();
134
2
                }
135
136
2
                UInt32 to_max_digits = 0;
137
2
                UInt32 to_precision = 0;
138
2
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
2
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
2
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
2
                    to_precision = to_max_digits;
154
2
                }
155
156
2
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
2
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
2
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
2
                if (to_scale > from_scale) {
161
0
                    multiply_may_overflow &=
162
0
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
0
                }
164
2
                return narrow_integral || multiply_may_overflow;
165
2
            }
166
0
            return false;
167
2
        });
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
114
2
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
2
            using Types2 = std::decay_t<decltype(types2)>;
116
2
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
2
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
2
                using FromFieldType = typename FromDataType::FieldType;
124
2
                using ToFieldType = typename ToDataType::FieldType;
125
2
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
2
                UInt32 from_scale = 0;
127
128
2
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
2
                    const auto* from_decimal_type =
130
2
                            check_and_get_data_type<FromDataType>(from_type.get());
131
2
                    from_precision =
132
2
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
2
                    from_scale = from_decimal_type->get_scale();
134
2
                }
135
136
2
                UInt32 to_max_digits = 0;
137
2
                UInt32 to_precision = 0;
138
2
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
2
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
2
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
2
                    to_precision = to_max_digits;
154
2
                }
155
156
2
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
2
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
2
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
2
                if (to_scale > from_scale) {
161
0
                    multiply_may_overflow &=
162
0
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
0
                }
164
2
                return narrow_integral || multiply_may_overflow;
165
2
            }
166
0
            return false;
167
2
        });
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
114
2
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
2
            using Types2 = std::decay_t<decltype(types2)>;
116
2
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
2
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
2
                using FromFieldType = typename FromDataType::FieldType;
124
2
                using ToFieldType = typename ToDataType::FieldType;
125
2
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
2
                UInt32 from_scale = 0;
127
128
2
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
2
                    const auto* from_decimal_type =
130
2
                            check_and_get_data_type<FromDataType>(from_type.get());
131
2
                    from_precision =
132
2
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
2
                    from_scale = from_decimal_type->get_scale();
134
2
                }
135
136
2
                UInt32 to_max_digits = 0;
137
2
                UInt32 to_precision = 0;
138
2
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
2
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
2
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
2
                    to_precision = to_max_digits;
154
2
                }
155
156
2
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
2
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
2
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
2
                if (to_scale > from_scale) {
161
0
                    multiply_may_overflow &=
162
0
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
0
                }
164
2
                return narrow_integral || multiply_may_overflow;
165
2
            }
166
0
            return false;
167
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
114
2
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
2
            using Types2 = std::decay_t<decltype(types2)>;
116
2
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
2
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
2
                using FromFieldType = typename FromDataType::FieldType;
124
2
                using ToFieldType = typename ToDataType::FieldType;
125
2
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
2
                UInt32 from_scale = 0;
127
128
2
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
2
                    const auto* from_decimal_type =
130
2
                            check_and_get_data_type<FromDataType>(from_type.get());
131
2
                    from_precision =
132
2
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
2
                    from_scale = from_decimal_type->get_scale();
134
2
                }
135
136
2
                UInt32 to_max_digits = 0;
137
2
                UInt32 to_precision = 0;
138
2
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
2
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
2
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
2
                    to_precision = to_max_digits;
154
2
                }
155
156
2
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
2
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
2
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
2
                if (to_scale > from_scale) {
161
0
                    multiply_may_overflow &=
162
0
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
0
                }
164
2
                return narrow_integral || multiply_may_overflow;
165
2
            }
166
0
            return false;
167
2
        });
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
114
2
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
2
            using Types2 = std::decay_t<decltype(types2)>;
116
2
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
2
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
2
                using FromFieldType = typename FromDataType::FieldType;
124
2
                using ToFieldType = typename ToDataType::FieldType;
125
2
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
2
                UInt32 from_scale = 0;
127
128
2
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
2
                    const auto* from_decimal_type =
130
2
                            check_and_get_data_type<FromDataType>(from_type.get());
131
2
                    from_precision =
132
2
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
2
                    from_scale = from_decimal_type->get_scale();
134
2
                }
135
136
2
                UInt32 to_max_digits = 0;
137
2
                UInt32 to_precision = 0;
138
2
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
2
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
2
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
2
                    to_precision = to_max_digits;
154
2
                }
155
156
2
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
2
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
2
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
2
                if (to_scale > from_scale) {
161
0
                    multiply_may_overflow &=
162
0
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
0
                }
164
2
                return narrow_integral || multiply_may_overflow;
165
2
            }
166
0
            return false;
167
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
114
34
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
34
            using Types2 = std::decay_t<decltype(types2)>;
116
34
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
34
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
34
                return false;
121
34
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
34
            return false;
167
34
        });
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
114
516
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
516
            using Types2 = std::decay_t<decltype(types2)>;
116
516
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
516
            return false;
167
516
        });
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
114
7
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
7
            using Types2 = std::decay_t<decltype(types2)>;
116
7
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
7
            return false;
167
7
        });
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
114
23
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
23
            using Types2 = std::decay_t<decltype(types2)>;
116
23
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
23
            return false;
167
23
        });
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
114
7
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
7
            using Types2 = std::decay_t<decltype(types2)>;
116
7
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
7
            return false;
167
7
        });
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
114
7
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
7
            using Types2 = std::decay_t<decltype(types2)>;
116
7
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
7
            return false;
167
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
114
23
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
23
            using Types2 = std::decay_t<decltype(types2)>;
116
23
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
23
            return false;
167
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
114
27
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
27
            using Types2 = std::decay_t<decltype(types2)>;
116
27
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
27
            return false;
167
27
        });
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
114
14
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
14
            using Types2 = std::decay_t<decltype(types2)>;
116
14
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
14
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
14
                using FromFieldType = typename FromDataType::FieldType;
124
14
                using ToFieldType = typename ToDataType::FieldType;
125
14
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
14
                UInt32 from_scale = 0;
127
128
14
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
14
                    const auto* from_decimal_type =
130
14
                            check_and_get_data_type<FromDataType>(from_type.get());
131
14
                    from_precision =
132
14
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
14
                    from_scale = from_decimal_type->get_scale();
134
14
                }
135
136
14
                UInt32 to_max_digits = 0;
137
14
                UInt32 to_precision = 0;
138
14
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
14
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
14
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
14
                    to_precision = to_max_digits;
154
14
                }
155
156
14
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
14
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
14
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
14
                if (to_scale > from_scale) {
161
0
                    multiply_may_overflow &=
162
0
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
0
                }
164
14
                return narrow_integral || multiply_may_overflow;
165
14
            }
166
0
            return false;
167
14
        });
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
114
18
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
18
            using Types2 = std::decay_t<decltype(types2)>;
116
18
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
18
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
18
                using FromFieldType = typename FromDataType::FieldType;
124
18
                using ToFieldType = typename ToDataType::FieldType;
125
18
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
18
                UInt32 from_scale = 0;
127
128
18
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
18
                    const auto* from_decimal_type =
130
18
                            check_and_get_data_type<FromDataType>(from_type.get());
131
18
                    from_precision =
132
18
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
18
                    from_scale = from_decimal_type->get_scale();
134
18
                }
135
136
18
                UInt32 to_max_digits = 0;
137
18
                UInt32 to_precision = 0;
138
18
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
18
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
18
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
18
                    to_precision = to_max_digits;
154
18
                }
155
156
18
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
18
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
18
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
18
                if (to_scale > from_scale) {
161
0
                    multiply_may_overflow &=
162
0
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
0
                }
164
18
                return narrow_integral || multiply_may_overflow;
165
18
            }
166
0
            return false;
167
18
        });
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
114
8
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
8
            using Types2 = std::decay_t<decltype(types2)>;
116
8
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
8
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
8
                using FromFieldType = typename FromDataType::FieldType;
124
8
                using ToFieldType = typename ToDataType::FieldType;
125
8
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
8
                UInt32 from_scale = 0;
127
128
8
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
8
                    const auto* from_decimal_type =
130
8
                            check_and_get_data_type<FromDataType>(from_type.get());
131
8
                    from_precision =
132
8
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
8
                    from_scale = from_decimal_type->get_scale();
134
8
                }
135
136
8
                UInt32 to_max_digits = 0;
137
8
                UInt32 to_precision = 0;
138
8
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
8
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
8
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
8
                    to_precision = to_max_digits;
154
8
                }
155
156
8
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
8
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
8
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
8
                if (to_scale > from_scale) {
161
0
                    multiply_may_overflow &=
162
0
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
0
                }
164
8
                return narrow_integral || multiply_may_overflow;
165
8
            }
166
0
            return false;
167
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
114
18
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
18
            using Types2 = std::decay_t<decltype(types2)>;
116
18
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
18
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
18
                using FromFieldType = typename FromDataType::FieldType;
124
18
                using ToFieldType = typename ToDataType::FieldType;
125
18
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
18
                UInt32 from_scale = 0;
127
128
18
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
18
                    const auto* from_decimal_type =
130
18
                            check_and_get_data_type<FromDataType>(from_type.get());
131
18
                    from_precision =
132
18
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
18
                    from_scale = from_decimal_type->get_scale();
134
18
                }
135
136
18
                UInt32 to_max_digits = 0;
137
18
                UInt32 to_precision = 0;
138
18
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
18
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
18
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
18
                    to_precision = to_max_digits;
154
18
                }
155
156
18
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
18
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
18
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
18
                if (to_scale > from_scale) {
161
0
                    multiply_may_overflow &=
162
0
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
0
                }
164
18
                return narrow_integral || multiply_may_overflow;
165
18
            }
166
0
            return false;
167
18
        });
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
114
18
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
18
            using Types2 = std::decay_t<decltype(types2)>;
116
18
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
18
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
18
                using FromFieldType = typename FromDataType::FieldType;
124
18
                using ToFieldType = typename ToDataType::FieldType;
125
18
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
18
                UInt32 from_scale = 0;
127
128
18
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
18
                    const auto* from_decimal_type =
130
18
                            check_and_get_data_type<FromDataType>(from_type.get());
131
18
                    from_precision =
132
18
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
18
                    from_scale = from_decimal_type->get_scale();
134
18
                }
135
136
18
                UInt32 to_max_digits = 0;
137
18
                UInt32 to_precision = 0;
138
18
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
18
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
18
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
18
                    to_precision = to_max_digits;
154
18
                }
155
156
18
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
18
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
18
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
18
                if (to_scale > from_scale) {
161
0
                    multiply_may_overflow &=
162
0
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
0
                }
164
18
                return narrow_integral || multiply_may_overflow;
165
18
            }
166
0
            return false;
167
18
        });
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
114
72
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
72
            using Types2 = std::decay_t<decltype(types2)>;
116
72
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
72
            return false;
167
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
114
24
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
24
            using Types2 = std::decay_t<decltype(types2)>;
116
24
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
24
            return false;
167
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
114
320
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
320
            using Types2 = std::decay_t<decltype(types2)>;
116
320
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
320
            return false;
167
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
114
1.41k
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
1.41k
            using Types2 = std::decay_t<decltype(types2)>;
116
1.41k
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
1.41k
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
1.41k
                return false;
121
1.41k
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
1.41k
            return false;
167
1.41k
        });
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
114
84
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
84
            using Types2 = std::decay_t<decltype(types2)>;
116
84
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
84
            return false;
167
84
        });
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
114
2
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
2
            using Types2 = std::decay_t<decltype(types2)>;
116
2
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
2
            return false;
167
2
        });
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
114
7
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
7
            using Types2 = std::decay_t<decltype(types2)>;
116
7
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
7
            return false;
167
7
        });
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
114
7
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
7
            using Types2 = std::decay_t<decltype(types2)>;
116
7
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
7
            return false;
167
7
        });
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
114
7
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
7
            using Types2 = std::decay_t<decltype(types2)>;
116
7
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
7
            return false;
167
7
        });
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
114
21
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
21
            using Types2 = std::decay_t<decltype(types2)>;
116
21
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
21
            return false;
167
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
114
25
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
25
            using Types2 = std::decay_t<decltype(types2)>;
116
25
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
25
            return false;
167
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
114
14
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
14
            using Types2 = std::decay_t<decltype(types2)>;
116
14
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
14
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
14
                using FromFieldType = typename FromDataType::FieldType;
124
14
                using ToFieldType = typename ToDataType::FieldType;
125
14
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
14
                UInt32 from_scale = 0;
127
128
14
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
14
                    const auto* from_decimal_type =
130
14
                            check_and_get_data_type<FromDataType>(from_type.get());
131
14
                    from_precision =
132
14
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
14
                    from_scale = from_decimal_type->get_scale();
134
14
                }
135
136
14
                UInt32 to_max_digits = 0;
137
14
                UInt32 to_precision = 0;
138
14
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
14
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
14
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
14
                    to_precision = to_max_digits;
154
14
                }
155
156
14
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
14
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
14
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
14
                if (to_scale > from_scale) {
161
0
                    multiply_may_overflow &=
162
0
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
0
                }
164
14
                return narrow_integral || multiply_may_overflow;
165
14
            }
166
0
            return false;
167
14
        });
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
114
18
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
18
            using Types2 = std::decay_t<decltype(types2)>;
116
18
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
18
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
18
                using FromFieldType = typename FromDataType::FieldType;
124
18
                using ToFieldType = typename ToDataType::FieldType;
125
18
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
18
                UInt32 from_scale = 0;
127
128
18
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
18
                    const auto* from_decimal_type =
130
18
                            check_and_get_data_type<FromDataType>(from_type.get());
131
18
                    from_precision =
132
18
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
18
                    from_scale = from_decimal_type->get_scale();
134
18
                }
135
136
18
                UInt32 to_max_digits = 0;
137
18
                UInt32 to_precision = 0;
138
18
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
18
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
18
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
18
                    to_precision = to_max_digits;
154
18
                }
155
156
18
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
18
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
18
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
18
                if (to_scale > from_scale) {
161
0
                    multiply_may_overflow &=
162
0
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
0
                }
164
18
                return narrow_integral || multiply_may_overflow;
165
18
            }
166
0
            return false;
167
18
        });
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
114
8
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
8
            using Types2 = std::decay_t<decltype(types2)>;
116
8
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
8
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
8
                using FromFieldType = typename FromDataType::FieldType;
124
8
                using ToFieldType = typename ToDataType::FieldType;
125
8
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
8
                UInt32 from_scale = 0;
127
128
8
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
8
                    const auto* from_decimal_type =
130
8
                            check_and_get_data_type<FromDataType>(from_type.get());
131
8
                    from_precision =
132
8
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
8
                    from_scale = from_decimal_type->get_scale();
134
8
                }
135
136
8
                UInt32 to_max_digits = 0;
137
8
                UInt32 to_precision = 0;
138
8
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
8
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
8
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
8
                    to_precision = to_max_digits;
154
8
                }
155
156
8
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
8
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
8
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
8
                if (to_scale > from_scale) {
161
0
                    multiply_may_overflow &=
162
0
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
0
                }
164
8
                return narrow_integral || multiply_may_overflow;
165
8
            }
166
0
            return false;
167
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
114
18
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
18
            using Types2 = std::decay_t<decltype(types2)>;
116
18
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
18
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
18
                using FromFieldType = typename FromDataType::FieldType;
124
18
                using ToFieldType = typename ToDataType::FieldType;
125
18
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
18
                UInt32 from_scale = 0;
127
128
18
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
18
                    const auto* from_decimal_type =
130
18
                            check_and_get_data_type<FromDataType>(from_type.get());
131
18
                    from_precision =
132
18
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
18
                    from_scale = from_decimal_type->get_scale();
134
18
                }
135
136
18
                UInt32 to_max_digits = 0;
137
18
                UInt32 to_precision = 0;
138
18
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
18
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
18
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
18
                    to_precision = to_max_digits;
154
18
                }
155
156
18
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
18
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
18
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
18
                if (to_scale > from_scale) {
161
0
                    multiply_may_overflow &=
162
0
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
0
                }
164
18
                return narrow_integral || multiply_may_overflow;
165
18
            }
166
0
            return false;
167
18
        });
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
114
18
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
18
            using Types2 = std::decay_t<decltype(types2)>;
116
18
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
18
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
18
                using FromFieldType = typename FromDataType::FieldType;
124
18
                using ToFieldType = typename ToDataType::FieldType;
125
18
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
18
                UInt32 from_scale = 0;
127
128
18
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
18
                    const auto* from_decimal_type =
130
18
                            check_and_get_data_type<FromDataType>(from_type.get());
131
18
                    from_precision =
132
18
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
18
                    from_scale = from_decimal_type->get_scale();
134
18
                }
135
136
18
                UInt32 to_max_digits = 0;
137
18
                UInt32 to_precision = 0;
138
18
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
18
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
18
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
18
                    to_precision = to_max_digits;
154
18
                }
155
156
18
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
18
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
18
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
18
                if (to_scale > from_scale) {
161
0
                    multiply_may_overflow &=
162
0
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
0
                }
164
18
                return narrow_integral || multiply_may_overflow;
165
18
            }
166
0
            return false;
167
18
        });
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
114
72
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
72
            using Types2 = std::decay_t<decltype(types2)>;
116
72
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
72
            return false;
167
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
114
24
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
24
            using Types2 = std::decay_t<decltype(types2)>;
116
24
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
24
            return false;
167
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
114
320
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
320
            using Types2 = std::decay_t<decltype(types2)>;
116
320
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
320
            return false;
167
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
114
905
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
905
            using Types2 = std::decay_t<decltype(types2)>;
116
905
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
905
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
905
                return false;
121
905
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
905
            return false;
167
905
        });
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
114
4
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
4
            using Types2 = std::decay_t<decltype(types2)>;
116
4
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
4
            return false;
167
4
        });
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
114
1.98k
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
1.98k
            using Types2 = std::decay_t<decltype(types2)>;
116
1.98k
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
1.98k
            return false;
167
1.98k
        });
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
114
28
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
28
            using Types2 = std::decay_t<decltype(types2)>;
116
28
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
28
            return false;
167
28
        });
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
114
31
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
31
            using Types2 = std::decay_t<decltype(types2)>;
116
31
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
31
            return false;
167
31
        });
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
114
7
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
7
            using Types2 = std::decay_t<decltype(types2)>;
116
7
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
7
            return false;
167
7
        });
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
114
17
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
17
            using Types2 = std::decay_t<decltype(types2)>;
116
17
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
17
            return false;
167
17
        });
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
114
55
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
55
            using Types2 = std::decay_t<decltype(types2)>;
116
55
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
55
            return false;
167
55
        });
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
114
14
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
14
            using Types2 = std::decay_t<decltype(types2)>;
116
14
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
14
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
14
                using FromFieldType = typename FromDataType::FieldType;
124
14
                using ToFieldType = typename ToDataType::FieldType;
125
14
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
14
                UInt32 from_scale = 0;
127
128
14
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
14
                    const auto* from_decimal_type =
130
14
                            check_and_get_data_type<FromDataType>(from_type.get());
131
14
                    from_precision =
132
14
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
14
                    from_scale = from_decimal_type->get_scale();
134
14
                }
135
136
14
                UInt32 to_max_digits = 0;
137
14
                UInt32 to_precision = 0;
138
14
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
14
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
14
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
14
                    to_precision = to_max_digits;
154
14
                }
155
156
14
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
14
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
14
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
14
                if (to_scale > from_scale) {
161
0
                    multiply_may_overflow &=
162
0
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
0
                }
164
14
                return narrow_integral || multiply_may_overflow;
165
14
            }
166
0
            return false;
167
14
        });
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
114
18
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
18
            using Types2 = std::decay_t<decltype(types2)>;
116
18
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
18
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
18
                using FromFieldType = typename FromDataType::FieldType;
124
18
                using ToFieldType = typename ToDataType::FieldType;
125
18
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
18
                UInt32 from_scale = 0;
127
128
18
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
18
                    const auto* from_decimal_type =
130
18
                            check_and_get_data_type<FromDataType>(from_type.get());
131
18
                    from_precision =
132
18
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
18
                    from_scale = from_decimal_type->get_scale();
134
18
                }
135
136
18
                UInt32 to_max_digits = 0;
137
18
                UInt32 to_precision = 0;
138
18
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
18
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
18
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
18
                    to_precision = to_max_digits;
154
18
                }
155
156
18
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
18
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
18
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
18
                if (to_scale > from_scale) {
161
0
                    multiply_may_overflow &=
162
0
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
0
                }
164
18
                return narrow_integral || multiply_may_overflow;
165
18
            }
166
0
            return false;
167
18
        });
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
114
8
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
8
            using Types2 = std::decay_t<decltype(types2)>;
116
8
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
8
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
8
                using FromFieldType = typename FromDataType::FieldType;
124
8
                using ToFieldType = typename ToDataType::FieldType;
125
8
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
8
                UInt32 from_scale = 0;
127
128
8
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
8
                    const auto* from_decimal_type =
130
8
                            check_and_get_data_type<FromDataType>(from_type.get());
131
8
                    from_precision =
132
8
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
8
                    from_scale = from_decimal_type->get_scale();
134
8
                }
135
136
8
                UInt32 to_max_digits = 0;
137
8
                UInt32 to_precision = 0;
138
8
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
8
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
8
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
8
                    to_precision = to_max_digits;
154
8
                }
155
156
8
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
8
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
8
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
8
                if (to_scale > from_scale) {
161
0
                    multiply_may_overflow &=
162
0
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
0
                }
164
8
                return narrow_integral || multiply_may_overflow;
165
8
            }
166
0
            return false;
167
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
114
18
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
18
            using Types2 = std::decay_t<decltype(types2)>;
116
18
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
18
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
18
                using FromFieldType = typename FromDataType::FieldType;
124
18
                using ToFieldType = typename ToDataType::FieldType;
125
18
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
18
                UInt32 from_scale = 0;
127
128
18
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
18
                    const auto* from_decimal_type =
130
18
                            check_and_get_data_type<FromDataType>(from_type.get());
131
18
                    from_precision =
132
18
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
18
                    from_scale = from_decimal_type->get_scale();
134
18
                }
135
136
18
                UInt32 to_max_digits = 0;
137
18
                UInt32 to_precision = 0;
138
18
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
18
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
18
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
18
                    to_precision = to_max_digits;
154
18
                }
155
156
18
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
18
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
18
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
18
                if (to_scale > from_scale) {
161
0
                    multiply_may_overflow &=
162
0
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
0
                }
164
18
                return narrow_integral || multiply_may_overflow;
165
18
            }
166
0
            return false;
167
18
        });
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
114
18
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
18
            using Types2 = std::decay_t<decltype(types2)>;
116
18
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
18
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
18
                using FromFieldType = typename FromDataType::FieldType;
124
18
                using ToFieldType = typename ToDataType::FieldType;
125
18
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
18
                UInt32 from_scale = 0;
127
128
18
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
18
                    const auto* from_decimal_type =
130
18
                            check_and_get_data_type<FromDataType>(from_type.get());
131
18
                    from_precision =
132
18
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
18
                    from_scale = from_decimal_type->get_scale();
134
18
                }
135
136
18
                UInt32 to_max_digits = 0;
137
18
                UInt32 to_precision = 0;
138
18
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
18
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
18
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
18
                    to_precision = to_max_digits;
154
18
                }
155
156
18
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
18
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
18
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
18
                if (to_scale > from_scale) {
161
0
                    multiply_may_overflow &=
162
0
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
0
                }
164
18
                return narrow_integral || multiply_may_overflow;
165
18
            }
166
0
            return false;
167
18
        });
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
114
2
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
2
            using Types2 = std::decay_t<decltype(types2)>;
116
2
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
2
            return false;
167
2
        });
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
114
24
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
24
            using Types2 = std::decay_t<decltype(types2)>;
116
24
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
24
            return false;
167
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
114
276
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
276
            using Types2 = std::decay_t<decltype(types2)>;
116
276
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
276
            return false;
167
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
114
1.31k
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
1.31k
            using Types2 = std::decay_t<decltype(types2)>;
116
1.31k
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
1.31k
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
1.31k
                return false;
121
1.31k
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
1.31k
            return false;
167
1.31k
        });
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
114
226
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
226
            using Types2 = std::decay_t<decltype(types2)>;
116
226
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
226
            return false;
167
226
        });
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
114
292
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
292
            using Types2 = std::decay_t<decltype(types2)>;
116
292
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
292
            return false;
167
292
        });
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
114
8
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
8
            using Types2 = std::decay_t<decltype(types2)>;
116
8
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
8
            return false;
167
8
        });
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
114
2.43k
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
2.43k
            using Types2 = std::decay_t<decltype(types2)>;
116
2.43k
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
2.43k
            return false;
167
2.43k
        });
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
114
7
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
7
            using Types2 = std::decay_t<decltype(types2)>;
116
7
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
7
            return false;
167
7
        });
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
114
13
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
13
            using Types2 = std::decay_t<decltype(types2)>;
116
13
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
13
            return false;
167
13
        });
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
114
21
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
21
            using Types2 = std::decay_t<decltype(types2)>;
116
21
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
21
            return false;
167
21
        });
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
114
14
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
14
            using Types2 = std::decay_t<decltype(types2)>;
116
14
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
14
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
14
                using FromFieldType = typename FromDataType::FieldType;
124
14
                using ToFieldType = typename ToDataType::FieldType;
125
14
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
14
                UInt32 from_scale = 0;
127
128
14
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
14
                    const auto* from_decimal_type =
130
14
                            check_and_get_data_type<FromDataType>(from_type.get());
131
14
                    from_precision =
132
14
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
14
                    from_scale = from_decimal_type->get_scale();
134
14
                }
135
136
14
                UInt32 to_max_digits = 0;
137
14
                UInt32 to_precision = 0;
138
14
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
14
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
14
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
14
                    to_precision = to_max_digits;
154
14
                }
155
156
14
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
14
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
14
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
14
                if (to_scale > from_scale) {
161
0
                    multiply_may_overflow &=
162
0
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
0
                }
164
14
                return narrow_integral || multiply_may_overflow;
165
14
            }
166
0
            return false;
167
14
        });
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
114
18
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
18
            using Types2 = std::decay_t<decltype(types2)>;
116
18
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
18
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
18
                using FromFieldType = typename FromDataType::FieldType;
124
18
                using ToFieldType = typename ToDataType::FieldType;
125
18
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
18
                UInt32 from_scale = 0;
127
128
18
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
18
                    const auto* from_decimal_type =
130
18
                            check_and_get_data_type<FromDataType>(from_type.get());
131
18
                    from_precision =
132
18
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
18
                    from_scale = from_decimal_type->get_scale();
134
18
                }
135
136
18
                UInt32 to_max_digits = 0;
137
18
                UInt32 to_precision = 0;
138
18
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
18
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
18
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
18
                    to_precision = to_max_digits;
154
18
                }
155
156
18
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
18
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
18
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
18
                if (to_scale > from_scale) {
161
0
                    multiply_may_overflow &=
162
0
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
0
                }
164
18
                return narrow_integral || multiply_may_overflow;
165
18
            }
166
0
            return false;
167
18
        });
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
114
8
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
8
            using Types2 = std::decay_t<decltype(types2)>;
116
8
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
8
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
8
                using FromFieldType = typename FromDataType::FieldType;
124
8
                using ToFieldType = typename ToDataType::FieldType;
125
8
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
8
                UInt32 from_scale = 0;
127
128
8
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
8
                    const auto* from_decimal_type =
130
8
                            check_and_get_data_type<FromDataType>(from_type.get());
131
8
                    from_precision =
132
8
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
8
                    from_scale = from_decimal_type->get_scale();
134
8
                }
135
136
8
                UInt32 to_max_digits = 0;
137
8
                UInt32 to_precision = 0;
138
8
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
8
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
8
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
8
                    to_precision = to_max_digits;
154
8
                }
155
156
8
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
8
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
8
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
8
                if (to_scale > from_scale) {
161
0
                    multiply_may_overflow &=
162
0
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
0
                }
164
8
                return narrow_integral || multiply_may_overflow;
165
8
            }
166
0
            return false;
167
8
        });
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
114
18
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
18
            using Types2 = std::decay_t<decltype(types2)>;
116
18
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
18
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
18
                using FromFieldType = typename FromDataType::FieldType;
124
18
                using ToFieldType = typename ToDataType::FieldType;
125
18
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
18
                UInt32 from_scale = 0;
127
128
18
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
18
                    const auto* from_decimal_type =
130
18
                            check_and_get_data_type<FromDataType>(from_type.get());
131
18
                    from_precision =
132
18
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
18
                    from_scale = from_decimal_type->get_scale();
134
18
                }
135
136
18
                UInt32 to_max_digits = 0;
137
18
                UInt32 to_precision = 0;
138
18
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
18
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
18
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
18
                    to_precision = to_max_digits;
154
18
                }
155
156
18
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
18
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
18
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
18
                if (to_scale > from_scale) {
161
0
                    multiply_may_overflow &=
162
0
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
0
                }
164
18
                return narrow_integral || multiply_may_overflow;
165
18
            }
166
0
            return false;
167
18
        });
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
114
18
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
18
            using Types2 = std::decay_t<decltype(types2)>;
116
18
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
18
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
18
                using FromFieldType = typename FromDataType::FieldType;
124
18
                using ToFieldType = typename ToDataType::FieldType;
125
18
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
18
                UInt32 from_scale = 0;
127
128
18
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
18
                    const auto* from_decimal_type =
130
18
                            check_and_get_data_type<FromDataType>(from_type.get());
131
18
                    from_precision =
132
18
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
18
                    from_scale = from_decimal_type->get_scale();
134
18
                }
135
136
18
                UInt32 to_max_digits = 0;
137
18
                UInt32 to_precision = 0;
138
18
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
18
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
18
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
18
                    to_precision = to_max_digits;
154
18
                }
155
156
18
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
18
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
18
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
18
                if (to_scale > from_scale) {
161
0
                    multiply_may_overflow &=
162
0
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
0
                }
164
18
                return narrow_integral || multiply_may_overflow;
165
18
            }
166
0
            return false;
167
18
        });
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
114
2
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
2
            using Types2 = std::decay_t<decltype(types2)>;
116
2
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
2
            return false;
167
2
        });
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
114
8
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
8
            using Types2 = std::decay_t<decltype(types2)>;
116
8
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
8
            return false;
167
8
        });
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
114
4
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
4
            using Types2 = std::decay_t<decltype(types2)>;
116
4
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
4
            return false;
167
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
114
2.29k
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
2.29k
            using Types2 = std::decay_t<decltype(types2)>;
116
2.29k
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
2.29k
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
2.29k
                return false;
121
2.29k
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
2.29k
            return false;
167
2.29k
        });
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
114
80
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
80
            using Types2 = std::decay_t<decltype(types2)>;
116
80
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
80
            return false;
167
80
        });
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
114
2
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
2
            using Types2 = std::decay_t<decltype(types2)>;
116
2
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
2
            return false;
167
2
        });
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
114
2
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
2
            using Types2 = std::decay_t<decltype(types2)>;
116
2
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
2
            return false;
167
2
        });
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
114
2
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
2
            using Types2 = std::decay_t<decltype(types2)>;
116
2
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
2
            return false;
167
2
        });
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
114
89
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
89
            using Types2 = std::decay_t<decltype(types2)>;
116
89
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
89
            return false;
167
89
        });
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
114
9
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
9
            using Types2 = std::decay_t<decltype(types2)>;
116
9
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
9
            return false;
167
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
114
13
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
13
            using Types2 = std::decay_t<decltype(types2)>;
116
13
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
13
            return false;
167
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
114
14
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
14
            using Types2 = std::decay_t<decltype(types2)>;
116
14
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
14
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
14
                using FromFieldType = typename FromDataType::FieldType;
124
14
                using ToFieldType = typename ToDataType::FieldType;
125
14
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
14
                UInt32 from_scale = 0;
127
128
14
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
14
                    const auto* from_decimal_type =
130
14
                            check_and_get_data_type<FromDataType>(from_type.get());
131
14
                    from_precision =
132
14
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
14
                    from_scale = from_decimal_type->get_scale();
134
14
                }
135
136
14
                UInt32 to_max_digits = 0;
137
14
                UInt32 to_precision = 0;
138
14
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
14
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
14
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
14
                    to_precision = to_max_digits;
154
14
                }
155
156
14
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
14
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
14
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
14
                if (to_scale > from_scale) {
161
0
                    multiply_may_overflow &=
162
0
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
0
                }
164
14
                return narrow_integral || multiply_may_overflow;
165
14
            }
166
0
            return false;
167
14
        });
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
114
18
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
18
            using Types2 = std::decay_t<decltype(types2)>;
116
18
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
18
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
18
                using FromFieldType = typename FromDataType::FieldType;
124
18
                using ToFieldType = typename ToDataType::FieldType;
125
18
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
18
                UInt32 from_scale = 0;
127
128
18
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
18
                    const auto* from_decimal_type =
130
18
                            check_and_get_data_type<FromDataType>(from_type.get());
131
18
                    from_precision =
132
18
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
18
                    from_scale = from_decimal_type->get_scale();
134
18
                }
135
136
18
                UInt32 to_max_digits = 0;
137
18
                UInt32 to_precision = 0;
138
18
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
18
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
18
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
18
                    to_precision = to_max_digits;
154
18
                }
155
156
18
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
18
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
18
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
18
                if (to_scale > from_scale) {
161
0
                    multiply_may_overflow &=
162
0
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
0
                }
164
18
                return narrow_integral || multiply_may_overflow;
165
18
            }
166
0
            return false;
167
18
        });
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
114
8
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
8
            using Types2 = std::decay_t<decltype(types2)>;
116
8
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
8
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
8
                using FromFieldType = typename FromDataType::FieldType;
124
8
                using ToFieldType = typename ToDataType::FieldType;
125
8
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
8
                UInt32 from_scale = 0;
127
128
8
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
8
                    const auto* from_decimal_type =
130
8
                            check_and_get_data_type<FromDataType>(from_type.get());
131
8
                    from_precision =
132
8
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
8
                    from_scale = from_decimal_type->get_scale();
134
8
                }
135
136
8
                UInt32 to_max_digits = 0;
137
8
                UInt32 to_precision = 0;
138
8
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
8
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
8
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
8
                    to_precision = to_max_digits;
154
8
                }
155
156
8
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
8
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
8
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
8
                if (to_scale > from_scale) {
161
0
                    multiply_may_overflow &=
162
0
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
0
                }
164
8
                return narrow_integral || multiply_may_overflow;
165
8
            }
166
0
            return false;
167
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
114
18
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
18
            using Types2 = std::decay_t<decltype(types2)>;
116
18
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
18
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
18
                using FromFieldType = typename FromDataType::FieldType;
124
18
                using ToFieldType = typename ToDataType::FieldType;
125
18
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
18
                UInt32 from_scale = 0;
127
128
18
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
18
                    const auto* from_decimal_type =
130
18
                            check_and_get_data_type<FromDataType>(from_type.get());
131
18
                    from_precision =
132
18
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
18
                    from_scale = from_decimal_type->get_scale();
134
18
                }
135
136
18
                UInt32 to_max_digits = 0;
137
18
                UInt32 to_precision = 0;
138
18
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
18
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
18
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
18
                    to_precision = to_max_digits;
154
18
                }
155
156
18
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
18
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
18
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
18
                if (to_scale > from_scale) {
161
0
                    multiply_may_overflow &=
162
0
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
0
                }
164
18
                return narrow_integral || multiply_may_overflow;
165
18
            }
166
0
            return false;
167
18
        });
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
114
18
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
18
            using Types2 = std::decay_t<decltype(types2)>;
116
18
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
18
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
18
                using FromFieldType = typename FromDataType::FieldType;
124
18
                using ToFieldType = typename ToDataType::FieldType;
125
18
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
18
                UInt32 from_scale = 0;
127
128
18
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
18
                    const auto* from_decimal_type =
130
18
                            check_and_get_data_type<FromDataType>(from_type.get());
131
18
                    from_precision =
132
18
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
18
                    from_scale = from_decimal_type->get_scale();
134
18
                }
135
136
18
                UInt32 to_max_digits = 0;
137
18
                UInt32 to_precision = 0;
138
18
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
18
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
18
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
18
                    to_precision = to_max_digits;
154
18
                }
155
156
18
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
18
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
18
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
18
                if (to_scale > from_scale) {
161
0
                    multiply_may_overflow &=
162
0
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
0
                }
164
18
                return narrow_integral || multiply_may_overflow;
165
18
            }
166
0
            return false;
167
18
        });
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
114
2
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
2
            using Types2 = std::decay_t<decltype(types2)>;
116
2
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
2
            return false;
167
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
114
8
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
8
            using Types2 = std::decay_t<decltype(types2)>;
116
8
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
8
            return false;
167
8
        });
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
114
4
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
4
            using Types2 = std::decay_t<decltype(types2)>;
116
4
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
4
            return false;
167
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
114
797
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
797
            using Types2 = std::decay_t<decltype(types2)>;
116
797
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
797
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
797
                return false;
121
797
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
797
            return false;
167
797
        });
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
114
2
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
2
            using Types2 = std::decay_t<decltype(types2)>;
116
2
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
2
            return false;
167
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
114
2
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
2
            using Types2 = std::decay_t<decltype(types2)>;
116
2
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
2
            return false;
167
2
        });
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
114
2
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
2
            using Types2 = std::decay_t<decltype(types2)>;
116
2
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
2
            return false;
167
2
        });
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
114
2
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
2
            using Types2 = std::decay_t<decltype(types2)>;
116
2
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
2
            return false;
167
2
        });
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
114
2
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
2
            using Types2 = std::decay_t<decltype(types2)>;
116
2
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
2
            return false;
167
2
        });
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
114
2
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
2
            using Types2 = std::decay_t<decltype(types2)>;
116
2
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
2
            return false;
167
2
        });
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
114
2
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
2
            using Types2 = std::decay_t<decltype(types2)>;
116
2
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
2
            return false;
167
2
        });
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
114
14
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
14
            using Types2 = std::decay_t<decltype(types2)>;
116
14
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
14
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
14
                using FromFieldType = typename FromDataType::FieldType;
124
14
                using ToFieldType = typename ToDataType::FieldType;
125
14
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
14
                UInt32 from_scale = 0;
127
128
14
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
14
                    const auto* from_decimal_type =
130
14
                            check_and_get_data_type<FromDataType>(from_type.get());
131
14
                    from_precision =
132
14
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
14
                    from_scale = from_decimal_type->get_scale();
134
14
                }
135
136
14
                UInt32 to_max_digits = 0;
137
14
                UInt32 to_precision = 0;
138
14
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
14
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
14
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
14
                    to_precision = to_max_digits;
154
14
                }
155
156
14
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
14
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
14
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
14
                if (to_scale > from_scale) {
161
0
                    multiply_may_overflow &=
162
0
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
0
                }
164
14
                return narrow_integral || multiply_may_overflow;
165
14
            }
166
0
            return false;
167
14
        });
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
114
18
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
18
            using Types2 = std::decay_t<decltype(types2)>;
116
18
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
18
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
18
                using FromFieldType = typename FromDataType::FieldType;
124
18
                using ToFieldType = typename ToDataType::FieldType;
125
18
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
18
                UInt32 from_scale = 0;
127
128
18
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
18
                    const auto* from_decimal_type =
130
18
                            check_and_get_data_type<FromDataType>(from_type.get());
131
18
                    from_precision =
132
18
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
18
                    from_scale = from_decimal_type->get_scale();
134
18
                }
135
136
18
                UInt32 to_max_digits = 0;
137
18
                UInt32 to_precision = 0;
138
18
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
18
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
18
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
18
                    to_precision = to_max_digits;
154
18
                }
155
156
18
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
18
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
18
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
18
                if (to_scale > from_scale) {
161
0
                    multiply_may_overflow &=
162
0
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
0
                }
164
18
                return narrow_integral || multiply_may_overflow;
165
18
            }
166
0
            return false;
167
18
        });
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
114
14
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
14
            using Types2 = std::decay_t<decltype(types2)>;
116
14
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
14
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
14
                using FromFieldType = typename FromDataType::FieldType;
124
14
                using ToFieldType = typename ToDataType::FieldType;
125
14
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
14
                UInt32 from_scale = 0;
127
128
14
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
14
                    const auto* from_decimal_type =
130
14
                            check_and_get_data_type<FromDataType>(from_type.get());
131
14
                    from_precision =
132
14
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
14
                    from_scale = from_decimal_type->get_scale();
134
14
                }
135
136
14
                UInt32 to_max_digits = 0;
137
14
                UInt32 to_precision = 0;
138
14
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
14
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
14
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
14
                    to_precision = to_max_digits;
154
14
                }
155
156
14
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
14
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
14
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
14
                if (to_scale > from_scale) {
161
0
                    multiply_may_overflow &=
162
0
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
0
                }
164
14
                return narrow_integral || multiply_may_overflow;
165
14
            }
166
0
            return false;
167
14
        });
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
114
18
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
18
            using Types2 = std::decay_t<decltype(types2)>;
116
18
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
18
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
18
                using FromFieldType = typename FromDataType::FieldType;
124
18
                using ToFieldType = typename ToDataType::FieldType;
125
18
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
18
                UInt32 from_scale = 0;
127
128
18
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
18
                    const auto* from_decimal_type =
130
18
                            check_and_get_data_type<FromDataType>(from_type.get());
131
18
                    from_precision =
132
18
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
18
                    from_scale = from_decimal_type->get_scale();
134
18
                }
135
136
18
                UInt32 to_max_digits = 0;
137
18
                UInt32 to_precision = 0;
138
18
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
18
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
18
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
18
                    to_precision = to_max_digits;
154
18
                }
155
156
18
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
18
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
18
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
18
                if (to_scale > from_scale) {
161
0
                    multiply_may_overflow &=
162
0
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
0
                }
164
18
                return narrow_integral || multiply_may_overflow;
165
18
            }
166
0
            return false;
167
18
        });
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
114
36
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
36
            using Types2 = std::decay_t<decltype(types2)>;
116
36
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
36
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
36
                using FromFieldType = typename FromDataType::FieldType;
124
36
                using ToFieldType = typename ToDataType::FieldType;
125
36
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
36
                UInt32 from_scale = 0;
127
128
36
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
36
                    const auto* from_decimal_type =
130
36
                            check_and_get_data_type<FromDataType>(from_type.get());
131
36
                    from_precision =
132
36
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
36
                    from_scale = from_decimal_type->get_scale();
134
36
                }
135
136
36
                UInt32 to_max_digits = 0;
137
36
                UInt32 to_precision = 0;
138
36
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
36
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
36
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
36
                    to_precision = to_max_digits;
154
36
                }
155
156
36
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
36
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
36
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
36
                if (to_scale > from_scale) {
161
0
                    multiply_may_overflow &=
162
0
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
0
                }
164
36
                return narrow_integral || multiply_may_overflow;
165
36
            }
166
0
            return false;
167
36
        });
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
114
37
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
37
            using Types2 = std::decay_t<decltype(types2)>;
116
37
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
37
            return false;
167
37
        });
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
114
7.78k
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
7.78k
            using Types2 = std::decay_t<decltype(types2)>;
116
7.78k
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
7.78k
            return false;
167
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
114
162
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
162
            using Types2 = std::decay_t<decltype(types2)>;
116
162
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
162
            return false;
167
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
114
102
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
102
            using Types2 = std::decay_t<decltype(types2)>;
116
102
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
102
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
102
                return false;
121
102
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
102
            return false;
167
102
        });
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
114
226
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
226
            using Types2 = std::decay_t<decltype(types2)>;
116
226
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
226
            return false;
167
226
        });
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
114
2
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
2
            using Types2 = std::decay_t<decltype(types2)>;
116
2
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
2
            return false;
167
2
        });
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
114
2
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
2
            using Types2 = std::decay_t<decltype(types2)>;
116
2
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
2
            return false;
167
2
        });
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
114
18
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
18
            using Types2 = std::decay_t<decltype(types2)>;
116
18
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
18
            return false;
167
18
        });
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
114
202
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
202
            using Types2 = std::decay_t<decltype(types2)>;
116
202
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
202
            return false;
167
202
        });
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
114
2
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
2
            using Types2 = std::decay_t<decltype(types2)>;
116
2
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
2
            return false;
167
2
        });
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
114
62
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
62
            using Types2 = std::decay_t<decltype(types2)>;
116
62
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
62
            return false;
167
62
        });
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
114
14
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
14
            using Types2 = std::decay_t<decltype(types2)>;
116
14
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
14
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
14
                using FromFieldType = typename FromDataType::FieldType;
124
14
                using ToFieldType = typename ToDataType::FieldType;
125
14
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
14
                UInt32 from_scale = 0;
127
128
14
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
14
                    const auto* from_decimal_type =
130
14
                            check_and_get_data_type<FromDataType>(from_type.get());
131
14
                    from_precision =
132
14
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
14
                    from_scale = from_decimal_type->get_scale();
134
14
                }
135
136
14
                UInt32 to_max_digits = 0;
137
14
                UInt32 to_precision = 0;
138
14
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
14
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
14
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
14
                    to_precision = to_max_digits;
154
14
                }
155
156
14
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
14
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
14
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
14
                if (to_scale > from_scale) {
161
0
                    multiply_may_overflow &=
162
0
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
0
                }
164
14
                return narrow_integral || multiply_may_overflow;
165
14
            }
166
0
            return false;
167
14
        });
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
114
18
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
18
            using Types2 = std::decay_t<decltype(types2)>;
116
18
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
18
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
18
                using FromFieldType = typename FromDataType::FieldType;
124
18
                using ToFieldType = typename ToDataType::FieldType;
125
18
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
18
                UInt32 from_scale = 0;
127
128
18
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
18
                    const auto* from_decimal_type =
130
18
                            check_and_get_data_type<FromDataType>(from_type.get());
131
18
                    from_precision =
132
18
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
18
                    from_scale = from_decimal_type->get_scale();
134
18
                }
135
136
18
                UInt32 to_max_digits = 0;
137
18
                UInt32 to_precision = 0;
138
18
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
18
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
18
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
18
                    to_precision = to_max_digits;
154
18
                }
155
156
18
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
18
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
18
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
18
                if (to_scale > from_scale) {
161
0
                    multiply_may_overflow &=
162
0
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
0
                }
164
18
                return narrow_integral || multiply_may_overflow;
165
18
            }
166
0
            return false;
167
18
        });
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
114
14
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
14
            using Types2 = std::decay_t<decltype(types2)>;
116
14
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
14
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
14
                using FromFieldType = typename FromDataType::FieldType;
124
14
                using ToFieldType = typename ToDataType::FieldType;
125
14
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
14
                UInt32 from_scale = 0;
127
128
14
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
14
                    const auto* from_decimal_type =
130
14
                            check_and_get_data_type<FromDataType>(from_type.get());
131
14
                    from_precision =
132
14
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
14
                    from_scale = from_decimal_type->get_scale();
134
14
                }
135
136
14
                UInt32 to_max_digits = 0;
137
14
                UInt32 to_precision = 0;
138
14
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
14
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
14
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
14
                    to_precision = to_max_digits;
154
14
                }
155
156
14
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
14
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
14
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
14
                if (to_scale > from_scale) {
161
0
                    multiply_may_overflow &=
162
0
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
0
                }
164
14
                return narrow_integral || multiply_may_overflow;
165
14
            }
166
0
            return false;
167
14
        });
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
114
22
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
22
            using Types2 = std::decay_t<decltype(types2)>;
116
22
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
22
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
22
                using FromFieldType = typename FromDataType::FieldType;
124
22
                using ToFieldType = typename ToDataType::FieldType;
125
22
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
22
                UInt32 from_scale = 0;
127
128
22
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
22
                    const auto* from_decimal_type =
130
22
                            check_and_get_data_type<FromDataType>(from_type.get());
131
22
                    from_precision =
132
22
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
22
                    from_scale = from_decimal_type->get_scale();
134
22
                }
135
136
22
                UInt32 to_max_digits = 0;
137
22
                UInt32 to_precision = 0;
138
22
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
22
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
22
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
22
                    to_precision = to_max_digits;
154
22
                }
155
156
22
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
22
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
22
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
22
                if (to_scale > from_scale) {
161
0
                    multiply_may_overflow &=
162
0
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
0
                }
164
22
                return narrow_integral || multiply_may_overflow;
165
22
            }
166
0
            return false;
167
22
        });
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
114
18
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
18
            using Types2 = std::decay_t<decltype(types2)>;
116
18
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
18
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
18
                using FromFieldType = typename FromDataType::FieldType;
124
18
                using ToFieldType = typename ToDataType::FieldType;
125
18
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
18
                UInt32 from_scale = 0;
127
128
18
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
18
                    const auto* from_decimal_type =
130
18
                            check_and_get_data_type<FromDataType>(from_type.get());
131
18
                    from_precision =
132
18
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
18
                    from_scale = from_decimal_type->get_scale();
134
18
                }
135
136
18
                UInt32 to_max_digits = 0;
137
18
                UInt32 to_precision = 0;
138
18
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
18
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
18
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
18
                    to_precision = to_max_digits;
154
18
                }
155
156
18
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
18
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
18
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
18
                if (to_scale > from_scale) {
161
0
                    multiply_may_overflow &=
162
0
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
0
                }
164
18
                return narrow_integral || multiply_may_overflow;
165
18
            }
166
0
            return false;
167
18
        });
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
114
181
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
181
            using Types2 = std::decay_t<decltype(types2)>;
116
181
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
181
            return false;
167
181
        });
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
114
7.91k
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
7.91k
            using Types2 = std::decay_t<decltype(types2)>;
116
7.91k
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
7.91k
            return false;
167
7.91k
        });
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
114
162
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
162
            using Types2 = std::decay_t<decltype(types2)>;
116
162
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
162
            return false;
167
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
114
1.03k
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
1.03k
            using Types2 = std::decay_t<decltype(types2)>;
116
1.03k
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
1.03k
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
1.03k
                return false;
121
1.03k
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
1.03k
            return false;
167
1.03k
        });
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
114
7
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
7
            using Types2 = std::decay_t<decltype(types2)>;
116
7
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
7
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
7
                using FromFieldType = typename FromDataType::FieldType;
124
7
                using ToFieldType = typename ToDataType::FieldType;
125
7
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
7
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
7
                UInt32 to_max_digits = 0;
137
7
                UInt32 to_precision = 0;
138
7
                UInt32 to_scale = 0;
139
140
7
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
7
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
7
                    const auto* to_decimal_type =
144
7
                            check_and_get_data_type<ToDataType>(to_type.get());
145
7
                    to_precision = to_decimal_type->get_precision();
146
7
                    ToDataType::check_type_precision(to_precision);
147
148
7
                    to_scale = to_decimal_type->get_scale();
149
7
                    ToDataType::check_type_scale(to_scale);
150
7
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
7
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
7
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
7
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
7
                if (to_scale > from_scale) {
161
6
                    multiply_may_overflow &=
162
6
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
6
                }
164
7
                return narrow_integral || multiply_may_overflow;
165
7
            }
166
0
            return false;
167
7
        });
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
114
34
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
34
            using Types2 = std::decay_t<decltype(types2)>;
116
34
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
34
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
34
                using FromFieldType = typename FromDataType::FieldType;
124
34
                using ToFieldType = typename ToDataType::FieldType;
125
34
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
34
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
34
                UInt32 to_max_digits = 0;
137
34
                UInt32 to_precision = 0;
138
34
                UInt32 to_scale = 0;
139
140
34
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
34
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
34
                    const auto* to_decimal_type =
144
34
                            check_and_get_data_type<ToDataType>(to_type.get());
145
34
                    to_precision = to_decimal_type->get_precision();
146
34
                    ToDataType::check_type_precision(to_precision);
147
148
34
                    to_scale = to_decimal_type->get_scale();
149
34
                    ToDataType::check_type_scale(to_scale);
150
34
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
34
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
34
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
34
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
34
                if (to_scale > from_scale) {
161
23
                    multiply_may_overflow &=
162
23
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
23
                }
164
34
                return narrow_integral || multiply_may_overflow;
165
34
            }
166
0
            return false;
167
34
        });
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
114
39
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
39
            using Types2 = std::decay_t<decltype(types2)>;
116
39
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
39
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
39
                using FromFieldType = typename FromDataType::FieldType;
124
39
                using ToFieldType = typename ToDataType::FieldType;
125
39
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
39
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
39
                UInt32 to_max_digits = 0;
137
39
                UInt32 to_precision = 0;
138
39
                UInt32 to_scale = 0;
139
140
39
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
39
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
39
                    const auto* to_decimal_type =
144
39
                            check_and_get_data_type<ToDataType>(to_type.get());
145
39
                    to_precision = to_decimal_type->get_precision();
146
39
                    ToDataType::check_type_precision(to_precision);
147
148
39
                    to_scale = to_decimal_type->get_scale();
149
39
                    ToDataType::check_type_scale(to_scale);
150
39
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
39
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
39
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
39
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
39
                if (to_scale > from_scale) {
161
23
                    multiply_may_overflow &=
162
23
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
23
                }
164
39
                return narrow_integral || multiply_may_overflow;
165
39
            }
166
0
            return false;
167
39
        });
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
114
49
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
49
            using Types2 = std::decay_t<decltype(types2)>;
116
49
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
49
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
49
                using FromFieldType = typename FromDataType::FieldType;
124
49
                using ToFieldType = typename ToDataType::FieldType;
125
49
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
49
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
49
                UInt32 to_max_digits = 0;
137
49
                UInt32 to_precision = 0;
138
49
                UInt32 to_scale = 0;
139
140
49
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
49
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
49
                    const auto* to_decimal_type =
144
49
                            check_and_get_data_type<ToDataType>(to_type.get());
145
49
                    to_precision = to_decimal_type->get_precision();
146
49
                    ToDataType::check_type_precision(to_precision);
147
148
49
                    to_scale = to_decimal_type->get_scale();
149
49
                    ToDataType::check_type_scale(to_scale);
150
49
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
49
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
49
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
49
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
49
                if (to_scale > from_scale) {
161
28
                    multiply_may_overflow &=
162
28
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
28
                }
164
49
                return narrow_integral || multiply_may_overflow;
165
49
            }
166
0
            return false;
167
49
        });
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
114
49
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
49
            using Types2 = std::decay_t<decltype(types2)>;
116
49
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
49
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
49
                using FromFieldType = typename FromDataType::FieldType;
124
49
                using ToFieldType = typename ToDataType::FieldType;
125
49
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
49
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
49
                UInt32 to_max_digits = 0;
137
49
                UInt32 to_precision = 0;
138
49
                UInt32 to_scale = 0;
139
140
49
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
49
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
49
                    const auto* to_decimal_type =
144
49
                            check_and_get_data_type<ToDataType>(to_type.get());
145
49
                    to_precision = to_decimal_type->get_precision();
146
49
                    ToDataType::check_type_precision(to_precision);
147
148
49
                    to_scale = to_decimal_type->get_scale();
149
49
                    ToDataType::check_type_scale(to_scale);
150
49
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
49
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
49
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
49
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
49
                if (to_scale > from_scale) {
161
28
                    multiply_may_overflow &=
162
28
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
28
                }
164
49
                return narrow_integral || multiply_may_overflow;
165
49
            }
166
0
            return false;
167
49
        });
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
114
49
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
49
            using Types2 = std::decay_t<decltype(types2)>;
116
49
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
49
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
49
                using FromFieldType = typename FromDataType::FieldType;
124
49
                using ToFieldType = typename ToDataType::FieldType;
125
49
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
49
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
49
                UInt32 to_max_digits = 0;
137
49
                UInt32 to_precision = 0;
138
49
                UInt32 to_scale = 0;
139
140
49
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
49
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
49
                    const auto* to_decimal_type =
144
49
                            check_and_get_data_type<ToDataType>(to_type.get());
145
49
                    to_precision = to_decimal_type->get_precision();
146
49
                    ToDataType::check_type_precision(to_precision);
147
148
49
                    to_scale = to_decimal_type->get_scale();
149
49
                    ToDataType::check_type_scale(to_scale);
150
49
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
49
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
49
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
49
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
49
                if (to_scale > from_scale) {
161
28
                    multiply_may_overflow &=
162
28
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
28
                }
164
49
                return narrow_integral || multiply_may_overflow;
165
49
            }
166
0
            return false;
167
49
        });
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
114
99
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
99
            using Types2 = std::decay_t<decltype(types2)>;
116
99
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
99
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
99
                using FromFieldType = typename FromDataType::FieldType;
124
99
                using ToFieldType = typename ToDataType::FieldType;
125
99
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
99
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
99
                UInt32 to_max_digits = 0;
137
99
                UInt32 to_precision = 0;
138
99
                UInt32 to_scale = 0;
139
140
99
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
99
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
99
                    const auto* to_decimal_type =
144
99
                            check_and_get_data_type<ToDataType>(to_type.get());
145
99
                    to_precision = to_decimal_type->get_precision();
146
99
                    ToDataType::check_type_precision(to_precision);
147
148
99
                    to_scale = to_decimal_type->get_scale();
149
99
                    ToDataType::check_type_scale(to_scale);
150
99
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
99
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
99
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
99
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
99
                if (to_scale > from_scale) {
161
66
                    multiply_may_overflow &=
162
66
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
66
                }
164
99
                return narrow_integral || multiply_may_overflow;
165
99
            }
166
0
            return false;
167
99
        });
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
114
103
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
103
            using Types2 = std::decay_t<decltype(types2)>;
116
103
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
103
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
103
                using FromFieldType = typename FromDataType::FieldType;
124
103
                using ToFieldType = typename ToDataType::FieldType;
125
103
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
103
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
103
                UInt32 to_max_digits = 0;
137
103
                UInt32 to_precision = 0;
138
103
                UInt32 to_scale = 0;
139
140
103
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
103
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
103
                    const auto* to_decimal_type =
144
103
                            check_and_get_data_type<ToDataType>(to_type.get());
145
103
                    to_precision = to_decimal_type->get_precision();
146
103
                    ToDataType::check_type_precision(to_precision);
147
148
103
                    to_scale = to_decimal_type->get_scale();
149
103
                    ToDataType::check_type_scale(to_scale);
150
103
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
103
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
103
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
103
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
103
                if (to_scale > from_scale) {
161
66
                    multiply_may_overflow &=
162
66
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
66
                }
164
103
                return narrow_integral || multiply_may_overflow;
165
103
            }
166
0
            return false;
167
103
        });
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
114
128
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
128
            using Types2 = std::decay_t<decltype(types2)>;
116
128
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
128
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
128
                using FromFieldType = typename FromDataType::FieldType;
124
128
                using ToFieldType = typename ToDataType::FieldType;
125
128
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
128
                UInt32 from_scale = 0;
127
128
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
128
                    const auto* from_decimal_type =
130
128
                            check_and_get_data_type<FromDataType>(from_type.get());
131
128
                    from_precision =
132
128
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
128
                    from_scale = from_decimal_type->get_scale();
134
128
                }
135
136
128
                UInt32 to_max_digits = 0;
137
128
                UInt32 to_precision = 0;
138
128
                UInt32 to_scale = 0;
139
140
128
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
128
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
128
                    const auto* to_decimal_type =
144
128
                            check_and_get_data_type<ToDataType>(to_type.get());
145
128
                    to_precision = to_decimal_type->get_precision();
146
128
                    ToDataType::check_type_precision(to_precision);
147
148
128
                    to_scale = to_decimal_type->get_scale();
149
128
                    ToDataType::check_type_scale(to_scale);
150
128
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
128
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
128
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
128
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
128
                if (to_scale > from_scale) {
161
62
                    multiply_may_overflow &=
162
62
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
62
                }
164
128
                return narrow_integral || multiply_may_overflow;
165
128
            }
166
0
            return false;
167
128
        });
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
114
397
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
397
            using Types2 = std::decay_t<decltype(types2)>;
116
397
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
397
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
397
                using FromFieldType = typename FromDataType::FieldType;
124
397
                using ToFieldType = typename ToDataType::FieldType;
125
397
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
397
                UInt32 from_scale = 0;
127
128
397
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
397
                    const auto* from_decimal_type =
130
397
                            check_and_get_data_type<FromDataType>(from_type.get());
131
397
                    from_precision =
132
397
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
397
                    from_scale = from_decimal_type->get_scale();
134
397
                }
135
136
397
                UInt32 to_max_digits = 0;
137
397
                UInt32 to_precision = 0;
138
397
                UInt32 to_scale = 0;
139
140
397
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
397
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
397
                    const auto* to_decimal_type =
144
397
                            check_and_get_data_type<ToDataType>(to_type.get());
145
397
                    to_precision = to_decimal_type->get_precision();
146
397
                    ToDataType::check_type_precision(to_precision);
147
148
397
                    to_scale = to_decimal_type->get_scale();
149
397
                    ToDataType::check_type_scale(to_scale);
150
397
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
397
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
397
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
397
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
397
                if (to_scale > from_scale) {
161
190
                    multiply_may_overflow &=
162
190
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
190
                }
164
397
                return narrow_integral || multiply_may_overflow;
165
397
            }
166
0
            return false;
167
397
        });
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
114
161
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
161
            using Types2 = std::decay_t<decltype(types2)>;
116
161
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
161
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
161
                using FromFieldType = typename FromDataType::FieldType;
124
161
                using ToFieldType = typename ToDataType::FieldType;
125
161
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
161
                UInt32 from_scale = 0;
127
128
161
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
161
                    const auto* from_decimal_type =
130
161
                            check_and_get_data_type<FromDataType>(from_type.get());
131
161
                    from_precision =
132
161
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
161
                    from_scale = from_decimal_type->get_scale();
134
161
                }
135
136
161
                UInt32 to_max_digits = 0;
137
161
                UInt32 to_precision = 0;
138
161
                UInt32 to_scale = 0;
139
140
161
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
161
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
161
                    const auto* to_decimal_type =
144
161
                            check_and_get_data_type<ToDataType>(to_type.get());
145
161
                    to_precision = to_decimal_type->get_precision();
146
161
                    ToDataType::check_type_precision(to_precision);
147
148
161
                    to_scale = to_decimal_type->get_scale();
149
161
                    ToDataType::check_type_scale(to_scale);
150
161
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
161
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
161
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
161
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
161
                if (to_scale > from_scale) {
161
0
                    multiply_may_overflow &=
162
0
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
0
                }
164
161
                return narrow_integral || multiply_may_overflow;
165
161
            }
166
0
            return false;
167
161
        });
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
114
408
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
408
            using Types2 = std::decay_t<decltype(types2)>;
116
408
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
408
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
408
                using FromFieldType = typename FromDataType::FieldType;
124
408
                using ToFieldType = typename ToDataType::FieldType;
125
408
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
408
                UInt32 from_scale = 0;
127
128
408
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
408
                    const auto* from_decimal_type =
130
408
                            check_and_get_data_type<FromDataType>(from_type.get());
131
408
                    from_precision =
132
408
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
408
                    from_scale = from_decimal_type->get_scale();
134
408
                }
135
136
408
                UInt32 to_max_digits = 0;
137
408
                UInt32 to_precision = 0;
138
408
                UInt32 to_scale = 0;
139
140
408
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
408
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
408
                    const auto* to_decimal_type =
144
408
                            check_and_get_data_type<ToDataType>(to_type.get());
145
408
                    to_precision = to_decimal_type->get_precision();
146
408
                    ToDataType::check_type_precision(to_precision);
147
148
408
                    to_scale = to_decimal_type->get_scale();
149
408
                    ToDataType::check_type_scale(to_scale);
150
408
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
408
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
408
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
408
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
408
                if (to_scale > from_scale) {
161
134
                    multiply_may_overflow &=
162
134
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
134
                }
164
408
                return narrow_integral || multiply_may_overflow;
165
408
            }
166
0
            return false;
167
408
        });
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
114
296
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
296
            using Types2 = std::decay_t<decltype(types2)>;
116
296
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
296
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
296
                using FromFieldType = typename FromDataType::FieldType;
124
296
                using ToFieldType = typename ToDataType::FieldType;
125
296
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
296
                UInt32 from_scale = 0;
127
128
296
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
296
                    const auto* from_decimal_type =
130
296
                            check_and_get_data_type<FromDataType>(from_type.get());
131
296
                    from_precision =
132
296
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
296
                    from_scale = from_decimal_type->get_scale();
134
296
                }
135
136
296
                UInt32 to_max_digits = 0;
137
296
                UInt32 to_precision = 0;
138
296
                UInt32 to_scale = 0;
139
140
296
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
296
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
296
                    const auto* to_decimal_type =
144
296
                            check_and_get_data_type<ToDataType>(to_type.get());
145
296
                    to_precision = to_decimal_type->get_precision();
146
296
                    ToDataType::check_type_precision(to_precision);
147
148
296
                    to_scale = to_decimal_type->get_scale();
149
296
                    ToDataType::check_type_scale(to_scale);
150
296
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
296
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
296
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
296
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
296
                if (to_scale > from_scale) {
161
78
                    multiply_may_overflow &=
162
78
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
78
                }
164
296
                return narrow_integral || multiply_may_overflow;
165
296
            }
166
0
            return false;
167
296
        });
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
114
1.66k
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
1.66k
            using Types2 = std::decay_t<decltype(types2)>;
116
1.66k
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
1.66k
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
1.66k
                return false;
121
1.66k
            }
122
1.66k
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
1.66k
                using FromFieldType = typename FromDataType::FieldType;
124
1.66k
                using ToFieldType = typename ToDataType::FieldType;
125
1.66k
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
1.66k
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
1.66k
                UInt32 to_max_digits = 0;
137
1.66k
                UInt32 to_precision = 0;
138
1.66k
                UInt32 to_scale = 0;
139
140
1.66k
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
1.66k
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
1.66k
                    const auto* to_decimal_type =
144
1.66k
                            check_and_get_data_type<ToDataType>(to_type.get());
145
1.66k
                    to_precision = to_decimal_type->get_precision();
146
1.66k
                    ToDataType::check_type_precision(to_precision);
147
148
1.66k
                    to_scale = to_decimal_type->get_scale();
149
1.66k
                    ToDataType::check_type_scale(to_scale);
150
1.66k
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
1.66k
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
1.66k
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
1.66k
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
1.66k
                if (to_scale > from_scale) {
161
0
                    multiply_may_overflow &=
162
0
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
0
                }
164
1.66k
                return narrow_integral || multiply_may_overflow;
165
1.66k
            }
166
0
            return false;
167
1.66k
        });
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
114
7
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
7
            using Types2 = std::decay_t<decltype(types2)>;
116
7
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
7
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
7
                using FromFieldType = typename FromDataType::FieldType;
124
7
                using ToFieldType = typename ToDataType::FieldType;
125
7
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
7
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
7
                UInt32 to_max_digits = 0;
137
7
                UInt32 to_precision = 0;
138
7
                UInt32 to_scale = 0;
139
140
7
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
7
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
7
                    const auto* to_decimal_type =
144
7
                            check_and_get_data_type<ToDataType>(to_type.get());
145
7
                    to_precision = to_decimal_type->get_precision();
146
7
                    ToDataType::check_type_precision(to_precision);
147
148
7
                    to_scale = to_decimal_type->get_scale();
149
7
                    ToDataType::check_type_scale(to_scale);
150
7
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
7
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
7
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
7
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
7
                if (to_scale > from_scale) {
161
6
                    multiply_may_overflow &=
162
6
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
6
                }
164
7
                return narrow_integral || multiply_may_overflow;
165
7
            }
166
0
            return false;
167
7
        });
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
114
29
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
29
            using Types2 = std::decay_t<decltype(types2)>;
116
29
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
29
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
29
                using FromFieldType = typename FromDataType::FieldType;
124
29
                using ToFieldType = typename ToDataType::FieldType;
125
29
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
29
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
29
                UInt32 to_max_digits = 0;
137
29
                UInt32 to_precision = 0;
138
29
                UInt32 to_scale = 0;
139
140
29
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
29
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
29
                    const auto* to_decimal_type =
144
29
                            check_and_get_data_type<ToDataType>(to_type.get());
145
29
                    to_precision = to_decimal_type->get_precision();
146
29
                    ToDataType::check_type_precision(to_precision);
147
148
29
                    to_scale = to_decimal_type->get_scale();
149
29
                    ToDataType::check_type_scale(to_scale);
150
29
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
29
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
29
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
29
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
29
                if (to_scale > from_scale) {
161
18
                    multiply_may_overflow &=
162
18
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
18
                }
164
29
                return narrow_integral || multiply_may_overflow;
165
29
            }
166
0
            return false;
167
29
        });
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
114
29
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
29
            using Types2 = std::decay_t<decltype(types2)>;
116
29
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
29
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
29
                using FromFieldType = typename FromDataType::FieldType;
124
29
                using ToFieldType = typename ToDataType::FieldType;
125
29
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
29
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
29
                UInt32 to_max_digits = 0;
137
29
                UInt32 to_precision = 0;
138
29
                UInt32 to_scale = 0;
139
140
29
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
29
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
29
                    const auto* to_decimal_type =
144
29
                            check_and_get_data_type<ToDataType>(to_type.get());
145
29
                    to_precision = to_decimal_type->get_precision();
146
29
                    ToDataType::check_type_precision(to_precision);
147
148
29
                    to_scale = to_decimal_type->get_scale();
149
29
                    ToDataType::check_type_scale(to_scale);
150
29
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
29
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
29
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
29
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
29
                if (to_scale > from_scale) {
161
18
                    multiply_may_overflow &=
162
18
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
18
                }
164
29
                return narrow_integral || multiply_may_overflow;
165
29
            }
166
0
            return false;
167
29
        });
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
114
44
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
44
            using Types2 = std::decay_t<decltype(types2)>;
116
44
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
44
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
44
                using FromFieldType = typename FromDataType::FieldType;
124
44
                using ToFieldType = typename ToDataType::FieldType;
125
44
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
44
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
44
                UInt32 to_max_digits = 0;
137
44
                UInt32 to_precision = 0;
138
44
                UInt32 to_scale = 0;
139
140
44
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
44
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
44
                    const auto* to_decimal_type =
144
44
                            check_and_get_data_type<ToDataType>(to_type.get());
145
44
                    to_precision = to_decimal_type->get_precision();
146
44
                    ToDataType::check_type_precision(to_precision);
147
148
44
                    to_scale = to_decimal_type->get_scale();
149
44
                    ToDataType::check_type_scale(to_scale);
150
44
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
44
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
44
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
44
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
44
                if (to_scale > from_scale) {
161
28
                    multiply_may_overflow &=
162
28
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
28
                }
164
44
                return narrow_integral || multiply_may_overflow;
165
44
            }
166
0
            return false;
167
44
        });
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
114
49
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
49
            using Types2 = std::decay_t<decltype(types2)>;
116
49
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
49
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
49
                using FromFieldType = typename FromDataType::FieldType;
124
49
                using ToFieldType = typename ToDataType::FieldType;
125
49
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
49
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
49
                UInt32 to_max_digits = 0;
137
49
                UInt32 to_precision = 0;
138
49
                UInt32 to_scale = 0;
139
140
49
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
49
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
49
                    const auto* to_decimal_type =
144
49
                            check_and_get_data_type<ToDataType>(to_type.get());
145
49
                    to_precision = to_decimal_type->get_precision();
146
49
                    ToDataType::check_type_precision(to_precision);
147
148
49
                    to_scale = to_decimal_type->get_scale();
149
49
                    ToDataType::check_type_scale(to_scale);
150
49
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
49
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
49
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
49
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
49
                if (to_scale > from_scale) {
161
28
                    multiply_may_overflow &=
162
28
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
28
                }
164
49
                return narrow_integral || multiply_may_overflow;
165
49
            }
166
0
            return false;
167
49
        });
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
114
49
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
49
            using Types2 = std::decay_t<decltype(types2)>;
116
49
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
49
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
49
                using FromFieldType = typename FromDataType::FieldType;
124
49
                using ToFieldType = typename ToDataType::FieldType;
125
49
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
49
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
49
                UInt32 to_max_digits = 0;
137
49
                UInt32 to_precision = 0;
138
49
                UInt32 to_scale = 0;
139
140
49
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
49
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
49
                    const auto* to_decimal_type =
144
49
                            check_and_get_data_type<ToDataType>(to_type.get());
145
49
                    to_precision = to_decimal_type->get_precision();
146
49
                    ToDataType::check_type_precision(to_precision);
147
148
49
                    to_scale = to_decimal_type->get_scale();
149
49
                    ToDataType::check_type_scale(to_scale);
150
49
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
49
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
49
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
49
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
49
                if (to_scale > from_scale) {
161
28
                    multiply_may_overflow &=
162
28
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
28
                }
164
49
                return narrow_integral || multiply_may_overflow;
165
49
            }
166
0
            return false;
167
49
        });
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
114
99
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
99
            using Types2 = std::decay_t<decltype(types2)>;
116
99
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
99
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
99
                using FromFieldType = typename FromDataType::FieldType;
124
99
                using ToFieldType = typename ToDataType::FieldType;
125
99
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
99
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
99
                UInt32 to_max_digits = 0;
137
99
                UInt32 to_precision = 0;
138
99
                UInt32 to_scale = 0;
139
140
99
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
99
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
99
                    const auto* to_decimal_type =
144
99
                            check_and_get_data_type<ToDataType>(to_type.get());
145
99
                    to_precision = to_decimal_type->get_precision();
146
99
                    ToDataType::check_type_precision(to_precision);
147
148
99
                    to_scale = to_decimal_type->get_scale();
149
99
                    ToDataType::check_type_scale(to_scale);
150
99
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
99
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
99
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
99
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
99
                if (to_scale > from_scale) {
161
58
                    multiply_may_overflow &=
162
58
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
58
                }
164
99
                return narrow_integral || multiply_may_overflow;
165
99
            }
166
0
            return false;
167
99
        });
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
114
99
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
99
            using Types2 = std::decay_t<decltype(types2)>;
116
99
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
99
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
99
                using FromFieldType = typename FromDataType::FieldType;
124
99
                using ToFieldType = typename ToDataType::FieldType;
125
99
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
99
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
99
                UInt32 to_max_digits = 0;
137
99
                UInt32 to_precision = 0;
138
99
                UInt32 to_scale = 0;
139
140
99
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
99
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
99
                    const auto* to_decimal_type =
144
99
                            check_and_get_data_type<ToDataType>(to_type.get());
145
99
                    to_precision = to_decimal_type->get_precision();
146
99
                    ToDataType::check_type_precision(to_precision);
147
148
99
                    to_scale = to_decimal_type->get_scale();
149
99
                    ToDataType::check_type_scale(to_scale);
150
99
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
99
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
99
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
99
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
99
                if (to_scale > from_scale) {
161
66
                    multiply_may_overflow &=
162
66
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
66
                }
164
99
                return narrow_integral || multiply_may_overflow;
165
99
            }
166
0
            return false;
167
99
        });
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
114
168
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
168
            using Types2 = std::decay_t<decltype(types2)>;
116
168
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
168
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
168
                using FromFieldType = typename FromDataType::FieldType;
124
168
                using ToFieldType = typename ToDataType::FieldType;
125
168
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
168
                UInt32 from_scale = 0;
127
128
168
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
168
                    const auto* from_decimal_type =
130
168
                            check_and_get_data_type<FromDataType>(from_type.get());
131
168
                    from_precision =
132
168
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
168
                    from_scale = from_decimal_type->get_scale();
134
168
                }
135
136
168
                UInt32 to_max_digits = 0;
137
168
                UInt32 to_precision = 0;
138
168
                UInt32 to_scale = 0;
139
140
168
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
168
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
168
                    const auto* to_decimal_type =
144
168
                            check_and_get_data_type<ToDataType>(to_type.get());
145
168
                    to_precision = to_decimal_type->get_precision();
146
168
                    ToDataType::check_type_precision(to_precision);
147
148
168
                    to_scale = to_decimal_type->get_scale();
149
168
                    ToDataType::check_type_scale(to_scale);
150
168
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
168
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
168
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
168
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
168
                if (to_scale > from_scale) {
161
105
                    multiply_may_overflow &=
162
105
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
105
                }
164
168
                return narrow_integral || multiply_may_overflow;
165
168
            }
166
0
            return false;
167
168
        });
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
114
3.99k
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
3.99k
            using Types2 = std::decay_t<decltype(types2)>;
116
3.99k
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
3.99k
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
3.99k
                using FromFieldType = typename FromDataType::FieldType;
124
3.99k
                using ToFieldType = typename ToDataType::FieldType;
125
3.99k
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
3.99k
                UInt32 from_scale = 0;
127
128
3.99k
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
3.99k
                    const auto* from_decimal_type =
130
3.99k
                            check_and_get_data_type<FromDataType>(from_type.get());
131
3.99k
                    from_precision =
132
3.99k
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
3.99k
                    from_scale = from_decimal_type->get_scale();
134
3.99k
                }
135
136
3.99k
                UInt32 to_max_digits = 0;
137
3.99k
                UInt32 to_precision = 0;
138
3.99k
                UInt32 to_scale = 0;
139
140
3.99k
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
3.99k
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
3.99k
                    const auto* to_decimal_type =
144
3.99k
                            check_and_get_data_type<ToDataType>(to_type.get());
145
3.99k
                    to_precision = to_decimal_type->get_precision();
146
3.99k
                    ToDataType::check_type_precision(to_precision);
147
148
3.99k
                    to_scale = to_decimal_type->get_scale();
149
3.99k
                    ToDataType::check_type_scale(to_scale);
150
3.99k
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
3.99k
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
3.99k
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
3.99k
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
3.99k
                if (to_scale > from_scale) {
161
152
                    multiply_may_overflow &=
162
152
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
152
                }
164
3.99k
                return narrow_integral || multiply_may_overflow;
165
3.99k
            }
166
0
            return false;
167
3.99k
        });
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
114
180
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
180
            using Types2 = std::decay_t<decltype(types2)>;
116
180
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
180
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
180
                using FromFieldType = typename FromDataType::FieldType;
124
180
                using ToFieldType = typename ToDataType::FieldType;
125
180
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
180
                UInt32 from_scale = 0;
127
128
180
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
180
                    const auto* from_decimal_type =
130
180
                            check_and_get_data_type<FromDataType>(from_type.get());
131
180
                    from_precision =
132
180
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
180
                    from_scale = from_decimal_type->get_scale();
134
180
                }
135
136
180
                UInt32 to_max_digits = 0;
137
180
                UInt32 to_precision = 0;
138
180
                UInt32 to_scale = 0;
139
140
180
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
180
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
180
                    const auto* to_decimal_type =
144
180
                            check_and_get_data_type<ToDataType>(to_type.get());
145
180
                    to_precision = to_decimal_type->get_precision();
146
180
                    ToDataType::check_type_precision(to_precision);
147
148
180
                    to_scale = to_decimal_type->get_scale();
149
180
                    ToDataType::check_type_scale(to_scale);
150
180
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
180
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
180
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
180
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
180
                if (to_scale > from_scale) {
161
50
                    multiply_may_overflow &=
162
50
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
50
                }
164
180
                return narrow_integral || multiply_may_overflow;
165
180
            }
166
0
            return false;
167
180
        });
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
114
385
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
385
            using Types2 = std::decay_t<decltype(types2)>;
116
385
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
385
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
385
                using FromFieldType = typename FromDataType::FieldType;
124
385
                using ToFieldType = typename ToDataType::FieldType;
125
385
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
385
                UInt32 from_scale = 0;
127
128
385
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
385
                    const auto* from_decimal_type =
130
385
                            check_and_get_data_type<FromDataType>(from_type.get());
131
385
                    from_precision =
132
385
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
385
                    from_scale = from_decimal_type->get_scale();
134
385
                }
135
136
385
                UInt32 to_max_digits = 0;
137
385
                UInt32 to_precision = 0;
138
385
                UInt32 to_scale = 0;
139
140
385
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
385
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
385
                    const auto* to_decimal_type =
144
385
                            check_and_get_data_type<ToDataType>(to_type.get());
145
385
                    to_precision = to_decimal_type->get_precision();
146
385
                    ToDataType::check_type_precision(to_precision);
147
148
385
                    to_scale = to_decimal_type->get_scale();
149
385
                    ToDataType::check_type_scale(to_scale);
150
385
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
385
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
385
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
385
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
385
                if (to_scale > from_scale) {
161
136
                    multiply_may_overflow &=
162
136
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
136
                }
164
385
                return narrow_integral || multiply_may_overflow;
165
385
            }
166
0
            return false;
167
385
        });
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
114
392
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
392
            using Types2 = std::decay_t<decltype(types2)>;
116
392
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
392
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
392
                using FromFieldType = typename FromDataType::FieldType;
124
392
                using ToFieldType = typename ToDataType::FieldType;
125
392
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
392
                UInt32 from_scale = 0;
127
128
392
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
392
                    const auto* from_decimal_type =
130
392
                            check_and_get_data_type<FromDataType>(from_type.get());
131
392
                    from_precision =
132
392
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
392
                    from_scale = from_decimal_type->get_scale();
134
392
                }
135
136
392
                UInt32 to_max_digits = 0;
137
392
                UInt32 to_precision = 0;
138
392
                UInt32 to_scale = 0;
139
140
392
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
392
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
392
                    const auto* to_decimal_type =
144
392
                            check_and_get_data_type<ToDataType>(to_type.get());
145
392
                    to_precision = to_decimal_type->get_precision();
146
392
                    ToDataType::check_type_precision(to_precision);
147
148
392
                    to_scale = to_decimal_type->get_scale();
149
392
                    ToDataType::check_type_scale(to_scale);
150
392
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
392
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
392
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
392
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
392
                if (to_scale > from_scale) {
161
136
                    multiply_may_overflow &=
162
136
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
136
                }
164
392
                return narrow_integral || multiply_may_overflow;
165
392
            }
166
0
            return false;
167
392
        });
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
114
1.45k
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
1.45k
            using Types2 = std::decay_t<decltype(types2)>;
116
1.45k
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
1.45k
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
1.45k
                return false;
121
1.45k
            }
122
1.45k
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
1.45k
                using FromFieldType = typename FromDataType::FieldType;
124
1.45k
                using ToFieldType = typename ToDataType::FieldType;
125
1.45k
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
1.45k
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
1.45k
                UInt32 to_max_digits = 0;
137
1.45k
                UInt32 to_precision = 0;
138
1.45k
                UInt32 to_scale = 0;
139
140
1.45k
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
1.45k
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
1.45k
                    const auto* to_decimal_type =
144
1.45k
                            check_and_get_data_type<ToDataType>(to_type.get());
145
1.45k
                    to_precision = to_decimal_type->get_precision();
146
1.45k
                    ToDataType::check_type_precision(to_precision);
147
148
1.45k
                    to_scale = to_decimal_type->get_scale();
149
1.45k
                    ToDataType::check_type_scale(to_scale);
150
1.45k
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
1.45k
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
1.45k
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
1.45k
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
1.45k
                if (to_scale > from_scale) {
161
0
                    multiply_may_overflow &=
162
0
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
0
                }
164
1.45k
                return narrow_integral || multiply_may_overflow;
165
1.45k
            }
166
0
            return false;
167
1.45k
        });
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
114
4
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
4
            using Types2 = std::decay_t<decltype(types2)>;
116
4
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
4
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
4
                using FromFieldType = typename FromDataType::FieldType;
124
4
                using ToFieldType = typename ToDataType::FieldType;
125
4
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
4
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
4
                UInt32 to_max_digits = 0;
137
4
                UInt32 to_precision = 0;
138
4
                UInt32 to_scale = 0;
139
140
4
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
4
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
4
                    const auto* to_decimal_type =
144
4
                            check_and_get_data_type<ToDataType>(to_type.get());
145
4
                    to_precision = to_decimal_type->get_precision();
146
4
                    ToDataType::check_type_precision(to_precision);
147
148
4
                    to_scale = to_decimal_type->get_scale();
149
4
                    ToDataType::check_type_scale(to_scale);
150
4
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
4
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
4
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
4
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
4
                if (to_scale > from_scale) {
161
4
                    multiply_may_overflow &=
162
4
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
4
                }
164
4
                return narrow_integral || multiply_may_overflow;
165
4
            }
166
0
            return false;
167
4
        });
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE20EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeNumberILSD_3EEESE_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_4EEESE_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_5EEESE_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_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_
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE20EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeNumberILSD_8EEESE_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_9EEESE_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_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_
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE20EEEvEEEEbRKT_ENKUlSI_E_clINSB_INS_14DataTypeStringESE_EEEEbSI_
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
114
7
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
7
            using Types2 = std::decay_t<decltype(types2)>;
116
7
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
7
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
7
                using FromFieldType = typename FromDataType::FieldType;
124
7
                using ToFieldType = typename ToDataType::FieldType;
125
7
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
7
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
7
                UInt32 to_max_digits = 0;
137
7
                UInt32 to_precision = 0;
138
7
                UInt32 to_scale = 0;
139
140
7
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
7
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
7
                    const auto* to_decimal_type =
144
7
                            check_and_get_data_type<ToDataType>(to_type.get());
145
7
                    to_precision = to_decimal_type->get_precision();
146
7
                    ToDataType::check_type_precision(to_precision);
147
148
7
                    to_scale = to_decimal_type->get_scale();
149
7
                    ToDataType::check_type_scale(to_scale);
150
7
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
7
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
7
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
7
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
7
                if (to_scale > from_scale) {
161
6
                    multiply_may_overflow &=
162
6
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
6
                }
164
7
                return narrow_integral || multiply_may_overflow;
165
7
            }
166
0
            return false;
167
7
        });
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
114
29
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
29
            using Types2 = std::decay_t<decltype(types2)>;
116
29
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
29
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
29
                using FromFieldType = typename FromDataType::FieldType;
124
29
                using ToFieldType = typename ToDataType::FieldType;
125
29
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
29
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
29
                UInt32 to_max_digits = 0;
137
29
                UInt32 to_precision = 0;
138
29
                UInt32 to_scale = 0;
139
140
29
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
29
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
29
                    const auto* to_decimal_type =
144
29
                            check_and_get_data_type<ToDataType>(to_type.get());
145
29
                    to_precision = to_decimal_type->get_precision();
146
29
                    ToDataType::check_type_precision(to_precision);
147
148
29
                    to_scale = to_decimal_type->get_scale();
149
29
                    ToDataType::check_type_scale(to_scale);
150
29
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
29
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
29
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
29
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
29
                if (to_scale > from_scale) {
161
18
                    multiply_may_overflow &=
162
18
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
18
                }
164
29
                return narrow_integral || multiply_may_overflow;
165
29
            }
166
0
            return false;
167
29
        });
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
114
29
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
29
            using Types2 = std::decay_t<decltype(types2)>;
116
29
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
29
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
29
                using FromFieldType = typename FromDataType::FieldType;
124
29
                using ToFieldType = typename ToDataType::FieldType;
125
29
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
29
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
29
                UInt32 to_max_digits = 0;
137
29
                UInt32 to_precision = 0;
138
29
                UInt32 to_scale = 0;
139
140
29
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
29
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
29
                    const auto* to_decimal_type =
144
29
                            check_and_get_data_type<ToDataType>(to_type.get());
145
29
                    to_precision = to_decimal_type->get_precision();
146
29
                    ToDataType::check_type_precision(to_precision);
147
148
29
                    to_scale = to_decimal_type->get_scale();
149
29
                    ToDataType::check_type_scale(to_scale);
150
29
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
29
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
29
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
29
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
29
                if (to_scale > from_scale) {
161
18
                    multiply_may_overflow &=
162
18
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
18
                }
164
29
                return narrow_integral || multiply_may_overflow;
165
29
            }
166
0
            return false;
167
29
        });
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
114
47
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
47
            using Types2 = std::decay_t<decltype(types2)>;
116
47
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
47
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
47
                using FromFieldType = typename FromDataType::FieldType;
124
47
                using ToFieldType = typename ToDataType::FieldType;
125
47
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
47
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
47
                UInt32 to_max_digits = 0;
137
47
                UInt32 to_precision = 0;
138
47
                UInt32 to_scale = 0;
139
140
47
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
47
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
47
                    const auto* to_decimal_type =
144
47
                            check_and_get_data_type<ToDataType>(to_type.get());
145
47
                    to_precision = to_decimal_type->get_precision();
146
47
                    ToDataType::check_type_precision(to_precision);
147
148
47
                    to_scale = to_decimal_type->get_scale();
149
47
                    ToDataType::check_type_scale(to_scale);
150
47
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
47
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
47
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
47
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
47
                if (to_scale > from_scale) {
161
36
                    multiply_may_overflow &=
162
36
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
36
                }
164
47
                return narrow_integral || multiply_may_overflow;
165
47
            }
166
0
            return false;
167
47
        });
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
114
1.78k
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
1.78k
            using Types2 = std::decay_t<decltype(types2)>;
116
1.78k
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
1.78k
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
1.78k
                using FromFieldType = typename FromDataType::FieldType;
124
1.78k
                using ToFieldType = typename ToDataType::FieldType;
125
1.78k
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
1.78k
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
1.78k
                UInt32 to_max_digits = 0;
137
1.78k
                UInt32 to_precision = 0;
138
1.78k
                UInt32 to_scale = 0;
139
140
1.78k
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
1.78k
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
1.78k
                    const auto* to_decimal_type =
144
1.78k
                            check_and_get_data_type<ToDataType>(to_type.get());
145
1.78k
                    to_precision = to_decimal_type->get_precision();
146
1.78k
                    ToDataType::check_type_precision(to_precision);
147
148
1.78k
                    to_scale = to_decimal_type->get_scale();
149
1.78k
                    ToDataType::check_type_scale(to_scale);
150
1.78k
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
1.78k
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
1.78k
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
1.78k
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
1.78k
                if (to_scale > from_scale) {
161
251
                    multiply_may_overflow &=
162
251
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
251
                }
164
1.78k
                return narrow_integral || multiply_may_overflow;
165
1.78k
            }
166
0
            return false;
167
1.78k
        });
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
114
49
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
49
            using Types2 = std::decay_t<decltype(types2)>;
116
49
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
49
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
49
                using FromFieldType = typename FromDataType::FieldType;
124
49
                using ToFieldType = typename ToDataType::FieldType;
125
49
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
49
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
49
                UInt32 to_max_digits = 0;
137
49
                UInt32 to_precision = 0;
138
49
                UInt32 to_scale = 0;
139
140
49
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
49
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
49
                    const auto* to_decimal_type =
144
49
                            check_and_get_data_type<ToDataType>(to_type.get());
145
49
                    to_precision = to_decimal_type->get_precision();
146
49
                    ToDataType::check_type_precision(to_precision);
147
148
49
                    to_scale = to_decimal_type->get_scale();
149
49
                    ToDataType::check_type_scale(to_scale);
150
49
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
49
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
49
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
49
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
49
                if (to_scale > from_scale) {
161
28
                    multiply_may_overflow &=
162
28
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
28
                }
164
49
                return narrow_integral || multiply_may_overflow;
165
49
            }
166
0
            return false;
167
49
        });
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
114
107
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
107
            using Types2 = std::decay_t<decltype(types2)>;
116
107
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
107
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
107
                using FromFieldType = typename FromDataType::FieldType;
124
107
                using ToFieldType = typename ToDataType::FieldType;
125
107
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
107
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
107
                UInt32 to_max_digits = 0;
137
107
                UInt32 to_precision = 0;
138
107
                UInt32 to_scale = 0;
139
140
107
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
107
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
107
                    const auto* to_decimal_type =
144
107
                            check_and_get_data_type<ToDataType>(to_type.get());
145
107
                    to_precision = to_decimal_type->get_precision();
146
107
                    ToDataType::check_type_precision(to_precision);
147
148
107
                    to_scale = to_decimal_type->get_scale();
149
107
                    ToDataType::check_type_scale(to_scale);
150
107
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
107
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
107
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
107
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
107
                if (to_scale > from_scale) {
161
66
                    multiply_may_overflow &=
162
66
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
66
                }
164
107
                return narrow_integral || multiply_may_overflow;
165
107
            }
166
0
            return false;
167
107
        });
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
114
91
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
91
            using Types2 = std::decay_t<decltype(types2)>;
116
91
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
91
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
91
                using FromFieldType = typename FromDataType::FieldType;
124
91
                using ToFieldType = typename ToDataType::FieldType;
125
91
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
91
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
91
                UInt32 to_max_digits = 0;
137
91
                UInt32 to_precision = 0;
138
91
                UInt32 to_scale = 0;
139
140
91
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
91
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
91
                    const auto* to_decimal_type =
144
91
                            check_and_get_data_type<ToDataType>(to_type.get());
145
91
                    to_precision = to_decimal_type->get_precision();
146
91
                    ToDataType::check_type_precision(to_precision);
147
148
91
                    to_scale = to_decimal_type->get_scale();
149
91
                    ToDataType::check_type_scale(to_scale);
150
91
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
91
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
91
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
91
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
91
                if (to_scale > from_scale) {
161
58
                    multiply_may_overflow &=
162
58
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
58
                }
164
91
                return narrow_integral || multiply_may_overflow;
165
91
            }
166
0
            return false;
167
91
        });
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
114
168
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
168
            using Types2 = std::decay_t<decltype(types2)>;
116
168
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
168
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
168
                using FromFieldType = typename FromDataType::FieldType;
124
168
                using ToFieldType = typename ToDataType::FieldType;
125
168
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
168
                UInt32 from_scale = 0;
127
128
168
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
168
                    const auto* from_decimal_type =
130
168
                            check_and_get_data_type<FromDataType>(from_type.get());
131
168
                    from_precision =
132
168
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
168
                    from_scale = from_decimal_type->get_scale();
134
168
                }
135
136
168
                UInt32 to_max_digits = 0;
137
168
                UInt32 to_precision = 0;
138
168
                UInt32 to_scale = 0;
139
140
168
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
168
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
168
                    const auto* to_decimal_type =
144
168
                            check_and_get_data_type<ToDataType>(to_type.get());
145
168
                    to_precision = to_decimal_type->get_precision();
146
168
                    ToDataType::check_type_precision(to_precision);
147
148
168
                    to_scale = to_decimal_type->get_scale();
149
168
                    ToDataType::check_type_scale(to_scale);
150
168
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
168
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
168
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
168
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
168
                if (to_scale > from_scale) {
161
106
                    multiply_may_overflow &=
162
106
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
106
                }
164
168
                return narrow_integral || multiply_may_overflow;
165
168
            }
166
0
            return false;
167
168
        });
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
114
264
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
264
            using Types2 = std::decay_t<decltype(types2)>;
116
264
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
264
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
264
                using FromFieldType = typename FromDataType::FieldType;
124
264
                using ToFieldType = typename ToDataType::FieldType;
125
264
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
264
                UInt32 from_scale = 0;
127
128
264
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
264
                    const auto* from_decimal_type =
130
264
                            check_and_get_data_type<FromDataType>(from_type.get());
131
264
                    from_precision =
132
264
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
264
                    from_scale = from_decimal_type->get_scale();
134
264
                }
135
136
264
                UInt32 to_max_digits = 0;
137
264
                UInt32 to_precision = 0;
138
264
                UInt32 to_scale = 0;
139
140
264
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
264
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
264
                    const auto* to_decimal_type =
144
264
                            check_and_get_data_type<ToDataType>(to_type.get());
145
264
                    to_precision = to_decimal_type->get_precision();
146
264
                    ToDataType::check_type_precision(to_precision);
147
148
264
                    to_scale = to_decimal_type->get_scale();
149
264
                    ToDataType::check_type_scale(to_scale);
150
264
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
264
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
264
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
264
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
264
                if (to_scale > from_scale) {
161
159
                    multiply_may_overflow &=
162
159
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
159
                }
164
264
                return narrow_integral || multiply_may_overflow;
165
264
            }
166
0
            return false;
167
264
        });
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
114
135
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
135
            using Types2 = std::decay_t<decltype(types2)>;
116
135
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
135
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
135
                using FromFieldType = typename FromDataType::FieldType;
124
135
                using ToFieldType = typename ToDataType::FieldType;
125
135
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
135
                UInt32 from_scale = 0;
127
128
135
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
135
                    const auto* from_decimal_type =
130
135
                            check_and_get_data_type<FromDataType>(from_type.get());
131
135
                    from_precision =
132
135
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
135
                    from_scale = from_decimal_type->get_scale();
134
135
                }
135
136
135
                UInt32 to_max_digits = 0;
137
135
                UInt32 to_precision = 0;
138
135
                UInt32 to_scale = 0;
139
140
135
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
135
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
135
                    const auto* to_decimal_type =
144
135
                            check_and_get_data_type<ToDataType>(to_type.get());
145
135
                    to_precision = to_decimal_type->get_precision();
146
135
                    ToDataType::check_type_precision(to_precision);
147
148
135
                    to_scale = to_decimal_type->get_scale();
149
135
                    ToDataType::check_type_scale(to_scale);
150
135
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
135
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
135
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
135
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
135
                if (to_scale > from_scale) {
161
68
                    multiply_may_overflow &=
162
68
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
68
                }
164
135
                return narrow_integral || multiply_may_overflow;
165
135
            }
166
0
            return false;
167
135
        });
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
114
1.88k
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
1.88k
            using Types2 = std::decay_t<decltype(types2)>;
116
1.88k
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
1.88k
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
1.88k
                using FromFieldType = typename FromDataType::FieldType;
124
1.88k
                using ToFieldType = typename ToDataType::FieldType;
125
1.88k
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
1.88k
                UInt32 from_scale = 0;
127
128
1.88k
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
1.88k
                    const auto* from_decimal_type =
130
1.88k
                            check_and_get_data_type<FromDataType>(from_type.get());
131
1.88k
                    from_precision =
132
1.88k
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
1.88k
                    from_scale = from_decimal_type->get_scale();
134
1.88k
                }
135
136
1.88k
                UInt32 to_max_digits = 0;
137
1.88k
                UInt32 to_precision = 0;
138
1.88k
                UInt32 to_scale = 0;
139
140
1.88k
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
1.88k
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
1.88k
                    const auto* to_decimal_type =
144
1.88k
                            check_and_get_data_type<ToDataType>(to_type.get());
145
1.88k
                    to_precision = to_decimal_type->get_precision();
146
1.88k
                    ToDataType::check_type_precision(to_precision);
147
148
1.88k
                    to_scale = to_decimal_type->get_scale();
149
1.88k
                    ToDataType::check_type_scale(to_scale);
150
1.88k
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
1.88k
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
1.88k
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
1.88k
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
1.88k
                if (to_scale > from_scale) {
161
152
                    multiply_may_overflow &=
162
152
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
152
                }
164
1.88k
                return narrow_integral || multiply_may_overflow;
165
1.88k
            }
166
0
            return false;
167
1.88k
        });
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
114
381
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
381
            using Types2 = std::decay_t<decltype(types2)>;
116
381
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
381
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
381
                using FromFieldType = typename FromDataType::FieldType;
124
381
                using ToFieldType = typename ToDataType::FieldType;
125
381
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
381
                UInt32 from_scale = 0;
127
128
381
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
381
                    const auto* from_decimal_type =
130
381
                            check_and_get_data_type<FromDataType>(from_type.get());
131
381
                    from_precision =
132
381
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
381
                    from_scale = from_decimal_type->get_scale();
134
381
                }
135
136
381
                UInt32 to_max_digits = 0;
137
381
                UInt32 to_precision = 0;
138
381
                UInt32 to_scale = 0;
139
140
381
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
381
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
381
                    const auto* to_decimal_type =
144
381
                            check_and_get_data_type<ToDataType>(to_type.get());
145
381
                    to_precision = to_decimal_type->get_precision();
146
381
                    ToDataType::check_type_precision(to_precision);
147
148
381
                    to_scale = to_decimal_type->get_scale();
149
381
                    ToDataType::check_type_scale(to_scale);
150
381
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
381
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
381
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
381
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
381
                if (to_scale > from_scale) {
161
136
                    multiply_may_overflow &=
162
136
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
136
                }
164
381
                return narrow_integral || multiply_may_overflow;
165
381
            }
166
0
            return false;
167
381
        });
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
114
1.79k
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
1.79k
            using Types2 = std::decay_t<decltype(types2)>;
116
1.79k
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
1.79k
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
1.79k
                return false;
121
1.79k
            }
122
1.79k
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
1.79k
                using FromFieldType = typename FromDataType::FieldType;
124
1.79k
                using ToFieldType = typename ToDataType::FieldType;
125
1.79k
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
1.79k
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
1.79k
                UInt32 to_max_digits = 0;
137
1.79k
                UInt32 to_precision = 0;
138
1.79k
                UInt32 to_scale = 0;
139
140
1.79k
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
1.79k
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
1.79k
                    const auto* to_decimal_type =
144
1.79k
                            check_and_get_data_type<ToDataType>(to_type.get());
145
1.79k
                    to_precision = to_decimal_type->get_precision();
146
1.79k
                    ToDataType::check_type_precision(to_precision);
147
148
1.79k
                    to_scale = to_decimal_type->get_scale();
149
1.79k
                    ToDataType::check_type_scale(to_scale);
150
1.79k
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
1.79k
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
1.79k
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
1.79k
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
1.79k
                if (to_scale > from_scale) {
161
0
                    multiply_may_overflow &=
162
0
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
0
                }
164
1.79k
                return narrow_integral || multiply_may_overflow;
165
1.79k
            }
166
0
            return false;
167
1.79k
        });
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
114
7
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
7
            using Types2 = std::decay_t<decltype(types2)>;
116
7
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
7
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
7
                using FromFieldType = typename FromDataType::FieldType;
124
7
                using ToFieldType = typename ToDataType::FieldType;
125
7
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
7
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
7
                UInt32 to_max_digits = 0;
137
7
                UInt32 to_precision = 0;
138
7
                UInt32 to_scale = 0;
139
140
7
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
7
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
7
                    const auto* to_decimal_type =
144
7
                            check_and_get_data_type<ToDataType>(to_type.get());
145
7
                    to_precision = to_decimal_type->get_precision();
146
7
                    ToDataType::check_type_precision(to_precision);
147
148
7
                    to_scale = to_decimal_type->get_scale();
149
7
                    ToDataType::check_type_scale(to_scale);
150
7
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
7
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
7
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
7
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
7
                if (to_scale > from_scale) {
161
6
                    multiply_may_overflow &=
162
6
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
6
                }
164
7
                return narrow_integral || multiply_may_overflow;
165
7
            }
166
0
            return false;
167
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
114
29
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
29
            using Types2 = std::decay_t<decltype(types2)>;
116
29
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
29
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
29
                using FromFieldType = typename FromDataType::FieldType;
124
29
                using ToFieldType = typename ToDataType::FieldType;
125
29
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
29
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
29
                UInt32 to_max_digits = 0;
137
29
                UInt32 to_precision = 0;
138
29
                UInt32 to_scale = 0;
139
140
29
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
29
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
29
                    const auto* to_decimal_type =
144
29
                            check_and_get_data_type<ToDataType>(to_type.get());
145
29
                    to_precision = to_decimal_type->get_precision();
146
29
                    ToDataType::check_type_precision(to_precision);
147
148
29
                    to_scale = to_decimal_type->get_scale();
149
29
                    ToDataType::check_type_scale(to_scale);
150
29
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
29
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
29
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
29
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
29
                if (to_scale > from_scale) {
161
18
                    multiply_may_overflow &=
162
18
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
18
                }
164
29
                return narrow_integral || multiply_may_overflow;
165
29
            }
166
0
            return false;
167
29
        });
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
114
29
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
29
            using Types2 = std::decay_t<decltype(types2)>;
116
29
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
29
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
29
                using FromFieldType = typename FromDataType::FieldType;
124
29
                using ToFieldType = typename ToDataType::FieldType;
125
29
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
29
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
29
                UInt32 to_max_digits = 0;
137
29
                UInt32 to_precision = 0;
138
29
                UInt32 to_scale = 0;
139
140
29
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
29
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
29
                    const auto* to_decimal_type =
144
29
                            check_and_get_data_type<ToDataType>(to_type.get());
145
29
                    to_precision = to_decimal_type->get_precision();
146
29
                    ToDataType::check_type_precision(to_precision);
147
148
29
                    to_scale = to_decimal_type->get_scale();
149
29
                    ToDataType::check_type_scale(to_scale);
150
29
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
29
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
29
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
29
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
29
                if (to_scale > from_scale) {
161
18
                    multiply_may_overflow &=
162
18
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
18
                }
164
29
                return narrow_integral || multiply_may_overflow;
165
29
            }
166
0
            return false;
167
29
        });
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
114
29
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
29
            using Types2 = std::decay_t<decltype(types2)>;
116
29
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
29
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
29
                using FromFieldType = typename FromDataType::FieldType;
124
29
                using ToFieldType = typename ToDataType::FieldType;
125
29
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
29
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
29
                UInt32 to_max_digits = 0;
137
29
                UInt32 to_precision = 0;
138
29
                UInt32 to_scale = 0;
139
140
29
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
29
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
29
                    const auto* to_decimal_type =
144
29
                            check_and_get_data_type<ToDataType>(to_type.get());
145
29
                    to_precision = to_decimal_type->get_precision();
146
29
                    ToDataType::check_type_precision(to_precision);
147
148
29
                    to_scale = to_decimal_type->get_scale();
149
29
                    ToDataType::check_type_scale(to_scale);
150
29
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
29
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
29
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
29
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
29
                if (to_scale > from_scale) {
161
18
                    multiply_may_overflow &=
162
18
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
18
                }
164
29
                return narrow_integral || multiply_may_overflow;
165
29
            }
166
0
            return false;
167
29
        });
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
114
29
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
29
            using Types2 = std::decay_t<decltype(types2)>;
116
29
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
29
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
29
                using FromFieldType = typename FromDataType::FieldType;
124
29
                using ToFieldType = typename ToDataType::FieldType;
125
29
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
29
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
29
                UInt32 to_max_digits = 0;
137
29
                UInt32 to_precision = 0;
138
29
                UInt32 to_scale = 0;
139
140
29
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
29
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
29
                    const auto* to_decimal_type =
144
29
                            check_and_get_data_type<ToDataType>(to_type.get());
145
29
                    to_precision = to_decimal_type->get_precision();
146
29
                    ToDataType::check_type_precision(to_precision);
147
148
29
                    to_scale = to_decimal_type->get_scale();
149
29
                    ToDataType::check_type_scale(to_scale);
150
29
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
29
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
29
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
29
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
29
                if (to_scale > from_scale) {
161
18
                    multiply_may_overflow &=
162
18
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
18
                }
164
29
                return narrow_integral || multiply_may_overflow;
165
29
            }
166
0
            return false;
167
29
        });
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
114
44
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
44
            using Types2 = std::decay_t<decltype(types2)>;
116
44
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
44
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
44
                using FromFieldType = typename FromDataType::FieldType;
124
44
                using ToFieldType = typename ToDataType::FieldType;
125
44
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
44
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
44
                UInt32 to_max_digits = 0;
137
44
                UInt32 to_precision = 0;
138
44
                UInt32 to_scale = 0;
139
140
44
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
44
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
44
                    const auto* to_decimal_type =
144
44
                            check_and_get_data_type<ToDataType>(to_type.get());
145
44
                    to_precision = to_decimal_type->get_precision();
146
44
                    ToDataType::check_type_precision(to_precision);
147
148
44
                    to_scale = to_decimal_type->get_scale();
149
44
                    ToDataType::check_type_scale(to_scale);
150
44
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
44
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
44
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
44
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
44
                if (to_scale > from_scale) {
161
28
                    multiply_may_overflow &=
162
28
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
28
                }
164
44
                return narrow_integral || multiply_may_overflow;
165
44
            }
166
0
            return false;
167
44
        });
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
114
87
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
87
            using Types2 = std::decay_t<decltype(types2)>;
116
87
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
87
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
87
                using FromFieldType = typename FromDataType::FieldType;
124
87
                using ToFieldType = typename ToDataType::FieldType;
125
87
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
87
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
87
                UInt32 to_max_digits = 0;
137
87
                UInt32 to_precision = 0;
138
87
                UInt32 to_scale = 0;
139
140
87
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
87
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
87
                    const auto* to_decimal_type =
144
87
                            check_and_get_data_type<ToDataType>(to_type.get());
145
87
                    to_precision = to_decimal_type->get_precision();
146
87
                    ToDataType::check_type_precision(to_precision);
147
148
87
                    to_scale = to_decimal_type->get_scale();
149
87
                    ToDataType::check_type_scale(to_scale);
150
87
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
87
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
87
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
87
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
87
                if (to_scale > from_scale) {
161
66
                    multiply_may_overflow &=
162
66
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
66
                }
164
87
                return narrow_integral || multiply_may_overflow;
165
87
            }
166
0
            return false;
167
87
        });
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
114
99
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
99
            using Types2 = std::decay_t<decltype(types2)>;
116
99
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
99
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
99
                using FromFieldType = typename FromDataType::FieldType;
124
99
                using ToFieldType = typename ToDataType::FieldType;
125
99
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
99
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
99
                UInt32 to_max_digits = 0;
137
99
                UInt32 to_precision = 0;
138
99
                UInt32 to_scale = 0;
139
140
99
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
99
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
99
                    const auto* to_decimal_type =
144
99
                            check_and_get_data_type<ToDataType>(to_type.get());
145
99
                    to_precision = to_decimal_type->get_precision();
146
99
                    ToDataType::check_type_precision(to_precision);
147
148
99
                    to_scale = to_decimal_type->get_scale();
149
99
                    ToDataType::check_type_scale(to_scale);
150
99
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
99
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
99
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
99
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
99
                if (to_scale > from_scale) {
161
66
                    multiply_may_overflow &=
162
66
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
66
                }
164
99
                return narrow_integral || multiply_may_overflow;
165
99
            }
166
0
            return false;
167
99
        });
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
114
168
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
168
            using Types2 = std::decay_t<decltype(types2)>;
116
168
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
168
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
168
                using FromFieldType = typename FromDataType::FieldType;
124
168
                using ToFieldType = typename ToDataType::FieldType;
125
168
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
168
                UInt32 from_scale = 0;
127
128
168
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
168
                    const auto* from_decimal_type =
130
168
                            check_and_get_data_type<FromDataType>(from_type.get());
131
168
                    from_precision =
132
168
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
168
                    from_scale = from_decimal_type->get_scale();
134
168
                }
135
136
168
                UInt32 to_max_digits = 0;
137
168
                UInt32 to_precision = 0;
138
168
                UInt32 to_scale = 0;
139
140
168
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
168
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
168
                    const auto* to_decimal_type =
144
168
                            check_and_get_data_type<ToDataType>(to_type.get());
145
168
                    to_precision = to_decimal_type->get_precision();
146
168
                    ToDataType::check_type_precision(to_precision);
147
148
168
                    to_scale = to_decimal_type->get_scale();
149
168
                    ToDataType::check_type_scale(to_scale);
150
168
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
168
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
168
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
168
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
168
                if (to_scale > from_scale) {
161
106
                    multiply_may_overflow &=
162
106
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
106
                }
164
168
                return narrow_integral || multiply_may_overflow;
165
168
            }
166
0
            return false;
167
168
        });
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
114
264
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
264
            using Types2 = std::decay_t<decltype(types2)>;
116
264
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
264
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
264
                using FromFieldType = typename FromDataType::FieldType;
124
264
                using ToFieldType = typename ToDataType::FieldType;
125
264
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
264
                UInt32 from_scale = 0;
127
128
264
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
264
                    const auto* from_decimal_type =
130
264
                            check_and_get_data_type<FromDataType>(from_type.get());
131
264
                    from_precision =
132
264
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
264
                    from_scale = from_decimal_type->get_scale();
134
264
                }
135
136
264
                UInt32 to_max_digits = 0;
137
264
                UInt32 to_precision = 0;
138
264
                UInt32 to_scale = 0;
139
140
264
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
264
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
264
                    const auto* to_decimal_type =
144
264
                            check_and_get_data_type<ToDataType>(to_type.get());
145
264
                    to_precision = to_decimal_type->get_precision();
146
264
                    ToDataType::check_type_precision(to_precision);
147
148
264
                    to_scale = to_decimal_type->get_scale();
149
264
                    ToDataType::check_type_scale(to_scale);
150
264
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
264
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
264
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
264
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
264
                if (to_scale > from_scale) {
161
160
                    multiply_may_overflow &=
162
160
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
160
                }
164
264
                return narrow_integral || multiply_may_overflow;
165
264
            }
166
0
            return false;
167
264
        });
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
114
132
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
132
            using Types2 = std::decay_t<decltype(types2)>;
116
132
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
132
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
132
                using FromFieldType = typename FromDataType::FieldType;
124
132
                using ToFieldType = typename ToDataType::FieldType;
125
132
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
132
                UInt32 from_scale = 0;
127
128
132
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
132
                    const auto* from_decimal_type =
130
132
                            check_and_get_data_type<FromDataType>(from_type.get());
131
132
                    from_precision =
132
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
132
                    from_scale = from_decimal_type->get_scale();
134
132
                }
135
136
132
                UInt32 to_max_digits = 0;
137
132
                UInt32 to_precision = 0;
138
132
                UInt32 to_scale = 0;
139
140
132
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
132
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
132
                    const auto* to_decimal_type =
144
132
                            check_and_get_data_type<ToDataType>(to_type.get());
145
132
                    to_precision = to_decimal_type->get_precision();
146
132
                    ToDataType::check_type_precision(to_precision);
147
148
132
                    to_scale = to_decimal_type->get_scale();
149
132
                    ToDataType::check_type_scale(to_scale);
150
132
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
132
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
132
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
132
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
132
                if (to_scale > from_scale) {
161
68
                    multiply_may_overflow &=
162
68
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
68
                }
164
132
                return narrow_integral || multiply_may_overflow;
165
132
            }
166
0
            return false;
167
132
        });
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
114
264
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
264
            using Types2 = std::decay_t<decltype(types2)>;
116
264
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
264
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
264
                using FromFieldType = typename FromDataType::FieldType;
124
264
                using ToFieldType = typename ToDataType::FieldType;
125
264
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
264
                UInt32 from_scale = 0;
127
128
264
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
264
                    const auto* from_decimal_type =
130
264
                            check_and_get_data_type<FromDataType>(from_type.get());
131
264
                    from_precision =
132
264
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
264
                    from_scale = from_decimal_type->get_scale();
134
264
                }
135
136
264
                UInt32 to_max_digits = 0;
137
264
                UInt32 to_precision = 0;
138
264
                UInt32 to_scale = 0;
139
140
264
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
264
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
264
                    const auto* to_decimal_type =
144
264
                            check_and_get_data_type<ToDataType>(to_type.get());
145
264
                    to_precision = to_decimal_type->get_precision();
146
264
                    ToDataType::check_type_precision(to_precision);
147
148
264
                    to_scale = to_decimal_type->get_scale();
149
264
                    ToDataType::check_type_scale(to_scale);
150
264
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
264
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
264
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
264
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
264
                if (to_scale > from_scale) {
161
159
                    multiply_may_overflow &=
162
159
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
159
                }
164
264
                return narrow_integral || multiply_may_overflow;
165
264
            }
166
0
            return false;
167
264
        });
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
114
272
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
272
            using Types2 = std::decay_t<decltype(types2)>;
116
272
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
272
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
272
                using FromFieldType = typename FromDataType::FieldType;
124
272
                using ToFieldType = typename ToDataType::FieldType;
125
272
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
272
                UInt32 from_scale = 0;
127
128
272
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
272
                    const auto* from_decimal_type =
130
272
                            check_and_get_data_type<FromDataType>(from_type.get());
131
272
                    from_precision =
132
272
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
272
                    from_scale = from_decimal_type->get_scale();
134
272
                }
135
136
272
                UInt32 to_max_digits = 0;
137
272
                UInt32 to_precision = 0;
138
272
                UInt32 to_scale = 0;
139
140
272
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
272
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
272
                    const auto* to_decimal_type =
144
272
                            check_and_get_data_type<ToDataType>(to_type.get());
145
272
                    to_precision = to_decimal_type->get_precision();
146
272
                    ToDataType::check_type_precision(to_precision);
147
148
272
                    to_scale = to_decimal_type->get_scale();
149
272
                    ToDataType::check_type_scale(to_scale);
150
272
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
272
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
272
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
272
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
272
                if (to_scale > from_scale) {
161
152
                    multiply_may_overflow &=
162
152
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
152
                }
164
272
                return narrow_integral || multiply_may_overflow;
165
272
            }
166
0
            return false;
167
272
        });
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
114
1.39k
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
1.39k
            using Types2 = std::decay_t<decltype(types2)>;
116
1.39k
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
1.39k
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
1.39k
                return false;
121
1.39k
            }
122
1.39k
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
1.39k
                using FromFieldType = typename FromDataType::FieldType;
124
1.39k
                using ToFieldType = typename ToDataType::FieldType;
125
1.39k
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
1.39k
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
1.39k
                UInt32 to_max_digits = 0;
137
1.39k
                UInt32 to_precision = 0;
138
1.39k
                UInt32 to_scale = 0;
139
140
1.39k
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
1.39k
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
1.39k
                    const auto* to_decimal_type =
144
1.39k
                            check_and_get_data_type<ToDataType>(to_type.get());
145
1.39k
                    to_precision = to_decimal_type->get_precision();
146
1.39k
                    ToDataType::check_type_precision(to_precision);
147
148
1.39k
                    to_scale = to_decimal_type->get_scale();
149
1.39k
                    ToDataType::check_type_scale(to_scale);
150
1.39k
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
1.39k
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
1.39k
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
1.39k
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
1.39k
                if (to_scale > from_scale) {
161
0
                    multiply_may_overflow &=
162
0
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
0
                }
164
1.39k
                return narrow_integral || multiply_may_overflow;
165
1.39k
            }
166
0
            return false;
167
1.39k
        });
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_
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_12DataTypeDateEvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeDateV2ESC_EEEEbSG_
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_12DataTypeDateEvEEEEbRKT_ENKUlSG_E_clINSB_INS_18DataTypeDateTimeV2ESC_EEEEbSG_
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_12DataTypeDateEvEEEEbRKT_ENKUlSG_E_clINSB_INS_16DataTypeDateTimeESC_EEEEbSG_
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_
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_12DataTypeDateEvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeStringESC_EEEEbSG_
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_
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeDateV2EvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeNumberILNS_13PrimitiveTypeE5EEESC_EEEEbSG_
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
114
7
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
7
            using Types2 = std::decay_t<decltype(types2)>;
116
7
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
7
            return false;
167
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
114
7
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
7
            using Types2 = std::decay_t<decltype(types2)>;
116
7
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
7
            return false;
167
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
114
2
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
2
            using Types2 = std::decay_t<decltype(types2)>;
116
2
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
2
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
2
                using FromFieldType = typename FromDataType::FieldType;
124
2
                using ToFieldType = typename ToDataType::FieldType;
125
2
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
2
                UInt32 from_scale = 0;
127
128
2
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
2
                    const auto* from_decimal_type =
130
2
                            check_and_get_data_type<FromDataType>(from_type.get());
131
2
                    from_precision =
132
2
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
2
                    from_scale = from_decimal_type->get_scale();
134
2
                }
135
136
2
                UInt32 to_max_digits = 0;
137
2
                UInt32 to_precision = 0;
138
2
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
2
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
2
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
2
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
2
                if (to_scale > from_scale) {
161
0
                    multiply_may_overflow &=
162
0
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
0
                }
164
2
                return narrow_integral || multiply_may_overflow;
165
2
            }
166
0
            return false;
167
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_
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeDateV2EvEEEEbRKT_ENKUlSG_E_clINSB_INS_12DataTypeDateESC_EEEEbSG_
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
114
2
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
2
            using Types2 = std::decay_t<decltype(types2)>;
116
2
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
2
            return false;
167
2
        });
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeDateV2EvEEEEbRKT_ENKUlSG_E_clINSB_INS_16DataTypeDateTimeESC_EEEEbSG_
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
114
2
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
2
            using Types2 = std::decay_t<decltype(types2)>;
116
2
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
2
            return false;
167
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
114
165
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
165
            using Types2 = std::decay_t<decltype(types2)>;
116
165
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
165
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
165
                return false;
121
165
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
165
            return false;
167
165
        });
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_
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_18DataTypeDateTimeV2EvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeNumberILNS_13PrimitiveTypeE5EEESC_EEEEbSG_
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
114
7
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
7
            using Types2 = std::decay_t<decltype(types2)>;
116
7
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
7
            return false;
167
7
        });
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
114
7
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
7
            using Types2 = std::decay_t<decltype(types2)>;
116
7
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
7
            return false;
167
7
        });
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_18DataTypeDateTimeV2EvEEEEbRKT_ENKUlSG_E_clINSB_INS_15DataTypeDecimalILNS_13PrimitiveTypeE28EEESC_EEEEbSG_
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
114
4
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
4
            using Types2 = std::decay_t<decltype(types2)>;
116
4
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
4
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
4
                using FromFieldType = typename FromDataType::FieldType;
124
4
                using ToFieldType = typename ToDataType::FieldType;
125
4
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
4
                UInt32 from_scale = 0;
127
128
4
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
4
                    const auto* from_decimal_type =
130
4
                            check_and_get_data_type<FromDataType>(from_type.get());
131
4
                    from_precision =
132
4
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
4
                    from_scale = from_decimal_type->get_scale();
134
4
                }
135
136
4
                UInt32 to_max_digits = 0;
137
4
                UInt32 to_precision = 0;
138
4
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
4
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
4
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
4
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
4
                if (to_scale > from_scale) {
161
0
                    multiply_may_overflow &=
162
0
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
0
                }
164
4
                return narrow_integral || multiply_may_overflow;
165
4
            }
166
0
            return false;
167
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_
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_18DataTypeDateTimeV2EvEEEEbRKT_ENKUlSG_E_clINSB_INS_15DataTypeDecimalILNS_13PrimitiveTypeE30EEESC_EEEEbSG_
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
114
10
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
10
            using Types2 = std::decay_t<decltype(types2)>;
116
10
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
10
            return false;
167
10
        });
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
114
6
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
6
            using Types2 = std::decay_t<decltype(types2)>;
116
6
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
6
            return false;
167
6
        });
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
114
8
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
8
            using Types2 = std::decay_t<decltype(types2)>;
116
8
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
8
            return false;
167
8
        });
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
114
2
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
2
            using Types2 = std::decay_t<decltype(types2)>;
116
2
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
2
            return false;
167
2
        });
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_18DataTypeDateTimeV2EvEEEEbRKT_ENKUlSG_E_clINSB_INS_19DataTypeTimeStampTzESC_EEEEbSG_
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
114
216
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
216
            using Types2 = std::decay_t<decltype(types2)>;
116
216
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
216
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
216
                return false;
121
216
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
216
            return false;
167
216
        });
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_
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_16DataTypeDateTimeEvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeStringESC_EEEEbSG_
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_
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeTimeV2EvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeNumberILNS_13PrimitiveTypeE3EEESC_EEEEbSG_
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeTimeV2EvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeNumberILNS_13PrimitiveTypeE4EEESC_EEEEbSG_
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeTimeV2EvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeNumberILNS_13PrimitiveTypeE5EEESC_EEEEbSG_
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
114
1
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
1
            using Types2 = std::decay_t<decltype(types2)>;
116
1
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
1
            return false;
167
1
        });
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeTimeV2EvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeNumberILNS_13PrimitiveTypeE7EEESC_EEEEbSG_
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeTimeV2EvEEEEbRKT_ENKUlSG_E_clINSB_INS_14DataTypeNumberILNS_13PrimitiveTypeE8EEESC_EEEEbSG_
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
114
1
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
1
            using Types2 = std::decay_t<decltype(types2)>;
116
1
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
1
            return false;
167
1
        });
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeTimeV2EvEEEEbRKT_ENKUlSG_E_clINSB_INS_15DataTypeDecimalILNS_13PrimitiveTypeE28EEESC_EEEEbSG_
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
114
1
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
1
            using Types2 = std::decay_t<decltype(types2)>;
116
1
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
1
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
1
                using FromFieldType = typename FromDataType::FieldType;
124
1
                using ToFieldType = typename ToDataType::FieldType;
125
1
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
1
                UInt32 from_scale = 0;
127
128
1
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
1
                    const auto* from_decimal_type =
130
1
                            check_and_get_data_type<FromDataType>(from_type.get());
131
1
                    from_precision =
132
1
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
1
                    from_scale = from_decimal_type->get_scale();
134
1
                }
135
136
1
                UInt32 to_max_digits = 0;
137
1
                UInt32 to_precision = 0;
138
1
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
1
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
1
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
1
                    to_precision = to_max_digits;
154
1
                }
155
156
1
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
1
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
1
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
1
                if (to_scale > from_scale) {
161
0
                    multiply_may_overflow &=
162
0
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
0
                }
164
1
                return narrow_integral || multiply_may_overflow;
165
1
            }
166
0
            return false;
167
1
        });
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeTimeV2EvEEEEbRKT_ENKUlSG_E_clINSB_INS_15DataTypeDecimalILNS_13PrimitiveTypeE20EEESC_EEEEbSG_
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeTimeV2EvEEEEbRKT_ENKUlSG_E_clINSB_INS_15DataTypeDecimalILNS_13PrimitiveTypeE30EEESC_EEEEbSG_
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
114
1
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
1
            using Types2 = std::decay_t<decltype(types2)>;
116
1
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
                return false;
121
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
1
            return false;
167
1
        });
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeTimeV2EvEEEEbRKT_ENKUlSG_E_clINSB_INS_16DataTypeDateTimeESC_EEEEbSG_
Unexecuted instantiation: function_cast.cpp:_ZZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeTimeV2EvEEEEbRKT_ENKUlSG_E_clINSB_ISC_SC_EEEEbSG_
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
114
12
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
12
            using Types2 = std::decay_t<decltype(types2)>;
116
12
            using FromDataType = typename Types2::LeftType;
117
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
12
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
12
                return false;
121
12
            }
122
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
                using FromFieldType = typename FromDataType::FieldType;
124
                using ToFieldType = typename ToDataType::FieldType;
125
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
                UInt32 from_scale = 0;
127
128
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
                    const auto* from_decimal_type =
130
                            check_and_get_data_type<FromDataType>(from_type.get());
131
                    from_precision =
132
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
                    from_scale = from_decimal_type->get_scale();
134
                }
135
136
                UInt32 to_max_digits = 0;
137
                UInt32 to_precision = 0;
138
                UInt32 to_scale = 0;
139
140
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
                    const auto* to_decimal_type =
144
                            check_and_get_data_type<ToDataType>(to_type.get());
145
                    to_precision = to_decimal_type->get_precision();
146
                    ToDataType::check_type_precision(to_precision);
147
148
                    to_scale = to_decimal_type->get_scale();
149
                    ToDataType::check_type_scale(to_scale);
150
                }
151
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
                    to_precision = to_max_digits;
154
                }
155
156
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
                if (to_scale > from_scale) {
161
                    multiply_may_overflow &=
162
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
                }
164
                return narrow_integral || multiply_may_overflow;
165
            }
166
12
            return false;
167
12
        });
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_
168
59.7k
    };
function_cast.cpp:_ZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE2EEEvEEEEbRKT_
Line
Count
Source
104
74
    auto make_default_wrapper = [&](const auto& types) -> bool {
105
74
        using Types = std::decay_t<decltype(types)>;
106
74
        using ToDataType = typename Types::LeftType;
107
108
        if constexpr (!(IsDataTypeDecimalOrNumber<ToDataType> || IsDatelikeV1Types<ToDataType> ||
109
                        IsDatelikeV2Types<ToDataType> ||
110
                        std::is_same_v<ToDataType, DataTypeTimeV2>)) {
111
            return false;
112
        }
113
74
        return call_on_index_and_data_type<
114
74
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
74
            using Types2 = std::decay_t<decltype(types2)>;
116
74
            using FromDataType = typename Types2::LeftType;
117
74
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
74
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
74
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
74
                return false;
121
74
            }
122
74
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
74
                using FromFieldType = typename FromDataType::FieldType;
124
74
                using ToFieldType = typename ToDataType::FieldType;
125
74
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
74
                UInt32 from_scale = 0;
127
128
74
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
74
                    const auto* from_decimal_type =
130
74
                            check_and_get_data_type<FromDataType>(from_type.get());
131
74
                    from_precision =
132
74
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
74
                    from_scale = from_decimal_type->get_scale();
134
74
                }
135
136
74
                UInt32 to_max_digits = 0;
137
74
                UInt32 to_precision = 0;
138
74
                UInt32 to_scale = 0;
139
140
74
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
74
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
74
                    const auto* to_decimal_type =
144
74
                            check_and_get_data_type<ToDataType>(to_type.get());
145
74
                    to_precision = to_decimal_type->get_precision();
146
74
                    ToDataType::check_type_precision(to_precision);
147
148
74
                    to_scale = to_decimal_type->get_scale();
149
74
                    ToDataType::check_type_scale(to_scale);
150
74
                }
151
74
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
74
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
74
                    to_precision = to_max_digits;
154
74
                }
155
156
74
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
74
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
74
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
74
                if (to_scale > from_scale) {
161
74
                    multiply_may_overflow &=
162
74
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
74
                }
164
74
                return narrow_integral || multiply_may_overflow;
165
74
            }
166
74
            return false;
167
74
        });
168
74
    };
function_cast.cpp:_ZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE3EEEvEEEEbRKT_
Line
Count
Source
104
2.53k
    auto make_default_wrapper = [&](const auto& types) -> bool {
105
2.53k
        using Types = std::decay_t<decltype(types)>;
106
2.53k
        using ToDataType = typename Types::LeftType;
107
108
        if constexpr (!(IsDataTypeDecimalOrNumber<ToDataType> || IsDatelikeV1Types<ToDataType> ||
109
                        IsDatelikeV2Types<ToDataType> ||
110
                        std::is_same_v<ToDataType, DataTypeTimeV2>)) {
111
            return false;
112
        }
113
2.53k
        return call_on_index_and_data_type<
114
2.53k
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
2.53k
            using Types2 = std::decay_t<decltype(types2)>;
116
2.53k
            using FromDataType = typename Types2::LeftType;
117
2.53k
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
2.53k
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
2.53k
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
2.53k
                return false;
121
2.53k
            }
122
2.53k
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
2.53k
                using FromFieldType = typename FromDataType::FieldType;
124
2.53k
                using ToFieldType = typename ToDataType::FieldType;
125
2.53k
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
2.53k
                UInt32 from_scale = 0;
127
128
2.53k
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
2.53k
                    const auto* from_decimal_type =
130
2.53k
                            check_and_get_data_type<FromDataType>(from_type.get());
131
2.53k
                    from_precision =
132
2.53k
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
2.53k
                    from_scale = from_decimal_type->get_scale();
134
2.53k
                }
135
136
2.53k
                UInt32 to_max_digits = 0;
137
2.53k
                UInt32 to_precision = 0;
138
2.53k
                UInt32 to_scale = 0;
139
140
2.53k
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
2.53k
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
2.53k
                    const auto* to_decimal_type =
144
2.53k
                            check_and_get_data_type<ToDataType>(to_type.get());
145
2.53k
                    to_precision = to_decimal_type->get_precision();
146
2.53k
                    ToDataType::check_type_precision(to_precision);
147
148
2.53k
                    to_scale = to_decimal_type->get_scale();
149
2.53k
                    ToDataType::check_type_scale(to_scale);
150
2.53k
                }
151
2.53k
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
2.53k
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
2.53k
                    to_precision = to_max_digits;
154
2.53k
                }
155
156
2.53k
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
2.53k
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
2.53k
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
2.53k
                if (to_scale > from_scale) {
161
2.53k
                    multiply_may_overflow &=
162
2.53k
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
2.53k
                }
164
2.53k
                return narrow_integral || multiply_may_overflow;
165
2.53k
            }
166
2.53k
            return false;
167
2.53k
        });
168
2.53k
    };
function_cast.cpp:_ZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE4EEEvEEEEbRKT_
Line
Count
Source
104
1.56k
    auto make_default_wrapper = [&](const auto& types) -> bool {
105
1.56k
        using Types = std::decay_t<decltype(types)>;
106
1.56k
        using ToDataType = typename Types::LeftType;
107
108
        if constexpr (!(IsDataTypeDecimalOrNumber<ToDataType> || IsDatelikeV1Types<ToDataType> ||
109
                        IsDatelikeV2Types<ToDataType> ||
110
                        std::is_same_v<ToDataType, DataTypeTimeV2>)) {
111
            return false;
112
        }
113
1.56k
        return call_on_index_and_data_type<
114
1.56k
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
1.56k
            using Types2 = std::decay_t<decltype(types2)>;
116
1.56k
            using FromDataType = typename Types2::LeftType;
117
1.56k
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
1.56k
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
1.56k
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
1.56k
                return false;
121
1.56k
            }
122
1.56k
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
1.56k
                using FromFieldType = typename FromDataType::FieldType;
124
1.56k
                using ToFieldType = typename ToDataType::FieldType;
125
1.56k
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
1.56k
                UInt32 from_scale = 0;
127
128
1.56k
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
1.56k
                    const auto* from_decimal_type =
130
1.56k
                            check_and_get_data_type<FromDataType>(from_type.get());
131
1.56k
                    from_precision =
132
1.56k
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
1.56k
                    from_scale = from_decimal_type->get_scale();
134
1.56k
                }
135
136
1.56k
                UInt32 to_max_digits = 0;
137
1.56k
                UInt32 to_precision = 0;
138
1.56k
                UInt32 to_scale = 0;
139
140
1.56k
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
1.56k
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
1.56k
                    const auto* to_decimal_type =
144
1.56k
                            check_and_get_data_type<ToDataType>(to_type.get());
145
1.56k
                    to_precision = to_decimal_type->get_precision();
146
1.56k
                    ToDataType::check_type_precision(to_precision);
147
148
1.56k
                    to_scale = to_decimal_type->get_scale();
149
1.56k
                    ToDataType::check_type_scale(to_scale);
150
1.56k
                }
151
1.56k
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
1.56k
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
1.56k
                    to_precision = to_max_digits;
154
1.56k
                }
155
156
1.56k
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
1.56k
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
1.56k
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
1.56k
                if (to_scale > from_scale) {
161
1.56k
                    multiply_may_overflow &=
162
1.56k
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
1.56k
                }
164
1.56k
                return narrow_integral || multiply_may_overflow;
165
1.56k
            }
166
1.56k
            return false;
167
1.56k
        });
168
1.56k
    };
function_cast.cpp:_ZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE5EEEvEEEEbRKT_
Line
Count
Source
104
3.83k
    auto make_default_wrapper = [&](const auto& types) -> bool {
105
3.83k
        using Types = std::decay_t<decltype(types)>;
106
3.83k
        using ToDataType = typename Types::LeftType;
107
108
        if constexpr (!(IsDataTypeDecimalOrNumber<ToDataType> || IsDatelikeV1Types<ToDataType> ||
109
                        IsDatelikeV2Types<ToDataType> ||
110
                        std::is_same_v<ToDataType, DataTypeTimeV2>)) {
111
            return false;
112
        }
113
3.83k
        return call_on_index_and_data_type<
114
3.83k
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
3.83k
            using Types2 = std::decay_t<decltype(types2)>;
116
3.83k
            using FromDataType = typename Types2::LeftType;
117
3.83k
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
3.83k
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
3.83k
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
3.83k
                return false;
121
3.83k
            }
122
3.83k
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
3.83k
                using FromFieldType = typename FromDataType::FieldType;
124
3.83k
                using ToFieldType = typename ToDataType::FieldType;
125
3.83k
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
3.83k
                UInt32 from_scale = 0;
127
128
3.83k
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
3.83k
                    const auto* from_decimal_type =
130
3.83k
                            check_and_get_data_type<FromDataType>(from_type.get());
131
3.83k
                    from_precision =
132
3.83k
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
3.83k
                    from_scale = from_decimal_type->get_scale();
134
3.83k
                }
135
136
3.83k
                UInt32 to_max_digits = 0;
137
3.83k
                UInt32 to_precision = 0;
138
3.83k
                UInt32 to_scale = 0;
139
140
3.83k
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
3.83k
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
3.83k
                    const auto* to_decimal_type =
144
3.83k
                            check_and_get_data_type<ToDataType>(to_type.get());
145
3.83k
                    to_precision = to_decimal_type->get_precision();
146
3.83k
                    ToDataType::check_type_precision(to_precision);
147
148
3.83k
                    to_scale = to_decimal_type->get_scale();
149
3.83k
                    ToDataType::check_type_scale(to_scale);
150
3.83k
                }
151
3.83k
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
3.83k
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
3.83k
                    to_precision = to_max_digits;
154
3.83k
                }
155
156
3.83k
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
3.83k
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
3.83k
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
3.83k
                if (to_scale > from_scale) {
161
3.83k
                    multiply_may_overflow &=
162
3.83k
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
3.83k
                }
164
3.83k
                return narrow_integral || multiply_may_overflow;
165
3.83k
            }
166
3.83k
            return false;
167
3.83k
        });
168
3.83k
    };
function_cast.cpp:_ZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE6EEEvEEEEbRKT_
Line
Count
Source
104
5.40k
    auto make_default_wrapper = [&](const auto& types) -> bool {
105
5.40k
        using Types = std::decay_t<decltype(types)>;
106
5.40k
        using ToDataType = typename Types::LeftType;
107
108
        if constexpr (!(IsDataTypeDecimalOrNumber<ToDataType> || IsDatelikeV1Types<ToDataType> ||
109
                        IsDatelikeV2Types<ToDataType> ||
110
                        std::is_same_v<ToDataType, DataTypeTimeV2>)) {
111
            return false;
112
        }
113
5.40k
        return call_on_index_and_data_type<
114
5.40k
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
5.40k
            using Types2 = std::decay_t<decltype(types2)>;
116
5.40k
            using FromDataType = typename Types2::LeftType;
117
5.40k
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
5.40k
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
5.40k
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
5.40k
                return false;
121
5.40k
            }
122
5.40k
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
5.40k
                using FromFieldType = typename FromDataType::FieldType;
124
5.40k
                using ToFieldType = typename ToDataType::FieldType;
125
5.40k
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
5.40k
                UInt32 from_scale = 0;
127
128
5.40k
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
5.40k
                    const auto* from_decimal_type =
130
5.40k
                            check_and_get_data_type<FromDataType>(from_type.get());
131
5.40k
                    from_precision =
132
5.40k
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
5.40k
                    from_scale = from_decimal_type->get_scale();
134
5.40k
                }
135
136
5.40k
                UInt32 to_max_digits = 0;
137
5.40k
                UInt32 to_precision = 0;
138
5.40k
                UInt32 to_scale = 0;
139
140
5.40k
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
5.40k
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
5.40k
                    const auto* to_decimal_type =
144
5.40k
                            check_and_get_data_type<ToDataType>(to_type.get());
145
5.40k
                    to_precision = to_decimal_type->get_precision();
146
5.40k
                    ToDataType::check_type_precision(to_precision);
147
148
5.40k
                    to_scale = to_decimal_type->get_scale();
149
5.40k
                    ToDataType::check_type_scale(to_scale);
150
5.40k
                }
151
5.40k
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
5.40k
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
5.40k
                    to_precision = to_max_digits;
154
5.40k
                }
155
156
5.40k
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
5.40k
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
5.40k
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
5.40k
                if (to_scale > from_scale) {
161
5.40k
                    multiply_may_overflow &=
162
5.40k
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
5.40k
                }
164
5.40k
                return narrow_integral || multiply_may_overflow;
165
5.40k
            }
166
5.40k
            return false;
167
5.40k
        });
168
5.40k
    };
function_cast.cpp:_ZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE7EEEvEEEEbRKT_
Line
Count
Source
104
1.08k
    auto make_default_wrapper = [&](const auto& types) -> bool {
105
1.08k
        using Types = std::decay_t<decltype(types)>;
106
1.08k
        using ToDataType = typename Types::LeftType;
107
108
        if constexpr (!(IsDataTypeDecimalOrNumber<ToDataType> || IsDatelikeV1Types<ToDataType> ||
109
                        IsDatelikeV2Types<ToDataType> ||
110
                        std::is_same_v<ToDataType, DataTypeTimeV2>)) {
111
            return false;
112
        }
113
1.08k
        return call_on_index_and_data_type<
114
1.08k
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
1.08k
            using Types2 = std::decay_t<decltype(types2)>;
116
1.08k
            using FromDataType = typename Types2::LeftType;
117
1.08k
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
1.08k
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
1.08k
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
1.08k
                return false;
121
1.08k
            }
122
1.08k
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
1.08k
                using FromFieldType = typename FromDataType::FieldType;
124
1.08k
                using ToFieldType = typename ToDataType::FieldType;
125
1.08k
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
1.08k
                UInt32 from_scale = 0;
127
128
1.08k
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
1.08k
                    const auto* from_decimal_type =
130
1.08k
                            check_and_get_data_type<FromDataType>(from_type.get());
131
1.08k
                    from_precision =
132
1.08k
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
1.08k
                    from_scale = from_decimal_type->get_scale();
134
1.08k
                }
135
136
1.08k
                UInt32 to_max_digits = 0;
137
1.08k
                UInt32 to_precision = 0;
138
1.08k
                UInt32 to_scale = 0;
139
140
1.08k
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
1.08k
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
1.08k
                    const auto* to_decimal_type =
144
1.08k
                            check_and_get_data_type<ToDataType>(to_type.get());
145
1.08k
                    to_precision = to_decimal_type->get_precision();
146
1.08k
                    ToDataType::check_type_precision(to_precision);
147
148
1.08k
                    to_scale = to_decimal_type->get_scale();
149
1.08k
                    ToDataType::check_type_scale(to_scale);
150
1.08k
                }
151
1.08k
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
1.08k
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
1.08k
                    to_precision = to_max_digits;
154
1.08k
                }
155
156
1.08k
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
1.08k
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
1.08k
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
1.08k
                if (to_scale > from_scale) {
161
1.08k
                    multiply_may_overflow &=
162
1.08k
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
1.08k
                }
164
1.08k
                return narrow_integral || multiply_may_overflow;
165
1.08k
            }
166
1.08k
            return false;
167
1.08k
        });
168
1.08k
    };
function_cast.cpp:_ZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE8EEEvEEEEbRKT_
Line
Count
Source
104
8.19k
    auto make_default_wrapper = [&](const auto& types) -> bool {
105
8.19k
        using Types = std::decay_t<decltype(types)>;
106
8.19k
        using ToDataType = typename Types::LeftType;
107
108
        if constexpr (!(IsDataTypeDecimalOrNumber<ToDataType> || IsDatelikeV1Types<ToDataType> ||
109
                        IsDatelikeV2Types<ToDataType> ||
110
                        std::is_same_v<ToDataType, DataTypeTimeV2>)) {
111
            return false;
112
        }
113
8.19k
        return call_on_index_and_data_type<
114
8.19k
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
8.19k
            using Types2 = std::decay_t<decltype(types2)>;
116
8.19k
            using FromDataType = typename Types2::LeftType;
117
8.19k
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
8.19k
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
8.19k
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
8.19k
                return false;
121
8.19k
            }
122
8.19k
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
8.19k
                using FromFieldType = typename FromDataType::FieldType;
124
8.19k
                using ToFieldType = typename ToDataType::FieldType;
125
8.19k
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
8.19k
                UInt32 from_scale = 0;
127
128
8.19k
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
8.19k
                    const auto* from_decimal_type =
130
8.19k
                            check_and_get_data_type<FromDataType>(from_type.get());
131
8.19k
                    from_precision =
132
8.19k
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
8.19k
                    from_scale = from_decimal_type->get_scale();
134
8.19k
                }
135
136
8.19k
                UInt32 to_max_digits = 0;
137
8.19k
                UInt32 to_precision = 0;
138
8.19k
                UInt32 to_scale = 0;
139
140
8.19k
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
8.19k
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
8.19k
                    const auto* to_decimal_type =
144
8.19k
                            check_and_get_data_type<ToDataType>(to_type.get());
145
8.19k
                    to_precision = to_decimal_type->get_precision();
146
8.19k
                    ToDataType::check_type_precision(to_precision);
147
148
8.19k
                    to_scale = to_decimal_type->get_scale();
149
8.19k
                    ToDataType::check_type_scale(to_scale);
150
8.19k
                }
151
8.19k
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
8.19k
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
8.19k
                    to_precision = to_max_digits;
154
8.19k
                }
155
156
8.19k
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
8.19k
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
8.19k
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
8.19k
                if (to_scale > from_scale) {
161
8.19k
                    multiply_may_overflow &=
162
8.19k
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
8.19k
                }
164
8.19k
                return narrow_integral || multiply_may_overflow;
165
8.19k
            }
166
8.19k
            return false;
167
8.19k
        });
168
8.19k
    };
function_cast.cpp:_ZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE9EEEvEEEEbRKT_
Line
Count
Source
104
9.91k
    auto make_default_wrapper = [&](const auto& types) -> bool {
105
9.91k
        using Types = std::decay_t<decltype(types)>;
106
9.91k
        using ToDataType = typename Types::LeftType;
107
108
        if constexpr (!(IsDataTypeDecimalOrNumber<ToDataType> || IsDatelikeV1Types<ToDataType> ||
109
                        IsDatelikeV2Types<ToDataType> ||
110
                        std::is_same_v<ToDataType, DataTypeTimeV2>)) {
111
            return false;
112
        }
113
9.91k
        return call_on_index_and_data_type<
114
9.91k
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
9.91k
            using Types2 = std::decay_t<decltype(types2)>;
116
9.91k
            using FromDataType = typename Types2::LeftType;
117
9.91k
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
9.91k
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
9.91k
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
9.91k
                return false;
121
9.91k
            }
122
9.91k
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
9.91k
                using FromFieldType = typename FromDataType::FieldType;
124
9.91k
                using ToFieldType = typename ToDataType::FieldType;
125
9.91k
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
9.91k
                UInt32 from_scale = 0;
127
128
9.91k
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
9.91k
                    const auto* from_decimal_type =
130
9.91k
                            check_and_get_data_type<FromDataType>(from_type.get());
131
9.91k
                    from_precision =
132
9.91k
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
9.91k
                    from_scale = from_decimal_type->get_scale();
134
9.91k
                }
135
136
9.91k
                UInt32 to_max_digits = 0;
137
9.91k
                UInt32 to_precision = 0;
138
9.91k
                UInt32 to_scale = 0;
139
140
9.91k
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
9.91k
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
9.91k
                    const auto* to_decimal_type =
144
9.91k
                            check_and_get_data_type<ToDataType>(to_type.get());
145
9.91k
                    to_precision = to_decimal_type->get_precision();
146
9.91k
                    ToDataType::check_type_precision(to_precision);
147
148
9.91k
                    to_scale = to_decimal_type->get_scale();
149
9.91k
                    ToDataType::check_type_scale(to_scale);
150
9.91k
                }
151
9.91k
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
9.91k
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
9.91k
                    to_precision = to_max_digits;
154
9.91k
                }
155
156
9.91k
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
9.91k
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
9.91k
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
9.91k
                if (to_scale > from_scale) {
161
9.91k
                    multiply_may_overflow &=
162
9.91k
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
9.91k
                }
164
9.91k
                return narrow_integral || multiply_may_overflow;
165
9.91k
            }
166
9.91k
            return false;
167
9.91k
        });
168
9.91k
    };
function_cast.cpp:_ZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE28EEEvEEEEbRKT_
Line
Count
Source
104
3.48k
    auto make_default_wrapper = [&](const auto& types) -> bool {
105
3.48k
        using Types = std::decay_t<decltype(types)>;
106
3.48k
        using ToDataType = typename Types::LeftType;
107
108
        if constexpr (!(IsDataTypeDecimalOrNumber<ToDataType> || IsDatelikeV1Types<ToDataType> ||
109
                        IsDatelikeV2Types<ToDataType> ||
110
                        std::is_same_v<ToDataType, DataTypeTimeV2>)) {
111
            return false;
112
        }
113
3.48k
        return call_on_index_and_data_type<
114
3.48k
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
3.48k
            using Types2 = std::decay_t<decltype(types2)>;
116
3.48k
            using FromDataType = typename Types2::LeftType;
117
3.48k
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
3.48k
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
3.48k
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
3.48k
                return false;
121
3.48k
            }
122
3.48k
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
3.48k
                using FromFieldType = typename FromDataType::FieldType;
124
3.48k
                using ToFieldType = typename ToDataType::FieldType;
125
3.48k
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
3.48k
                UInt32 from_scale = 0;
127
128
3.48k
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
3.48k
                    const auto* from_decimal_type =
130
3.48k
                            check_and_get_data_type<FromDataType>(from_type.get());
131
3.48k
                    from_precision =
132
3.48k
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
3.48k
                    from_scale = from_decimal_type->get_scale();
134
3.48k
                }
135
136
3.48k
                UInt32 to_max_digits = 0;
137
3.48k
                UInt32 to_precision = 0;
138
3.48k
                UInt32 to_scale = 0;
139
140
3.48k
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
3.48k
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
3.48k
                    const auto* to_decimal_type =
144
3.48k
                            check_and_get_data_type<ToDataType>(to_type.get());
145
3.48k
                    to_precision = to_decimal_type->get_precision();
146
3.48k
                    ToDataType::check_type_precision(to_precision);
147
148
3.48k
                    to_scale = to_decimal_type->get_scale();
149
3.48k
                    ToDataType::check_type_scale(to_scale);
150
3.48k
                }
151
3.48k
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
3.48k
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
3.48k
                    to_precision = to_max_digits;
154
3.48k
                }
155
156
3.48k
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
3.48k
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
3.48k
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
3.48k
                if (to_scale > from_scale) {
161
3.48k
                    multiply_may_overflow &=
162
3.48k
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
3.48k
                }
164
3.48k
                return narrow_integral || multiply_may_overflow;
165
3.48k
            }
166
3.48k
            return false;
167
3.48k
        });
168
3.48k
    };
function_cast.cpp:_ZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE29EEEvEEEEbRKT_
Line
Count
Source
104
6.98k
    auto make_default_wrapper = [&](const auto& types) -> bool {
105
6.98k
        using Types = std::decay_t<decltype(types)>;
106
6.98k
        using ToDataType = typename Types::LeftType;
107
108
        if constexpr (!(IsDataTypeDecimalOrNumber<ToDataType> || IsDatelikeV1Types<ToDataType> ||
109
                        IsDatelikeV2Types<ToDataType> ||
110
                        std::is_same_v<ToDataType, DataTypeTimeV2>)) {
111
            return false;
112
        }
113
6.98k
        return call_on_index_and_data_type<
114
6.98k
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
6.98k
            using Types2 = std::decay_t<decltype(types2)>;
116
6.98k
            using FromDataType = typename Types2::LeftType;
117
6.98k
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
6.98k
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
6.98k
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
6.98k
                return false;
121
6.98k
            }
122
6.98k
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
6.98k
                using FromFieldType = typename FromDataType::FieldType;
124
6.98k
                using ToFieldType = typename ToDataType::FieldType;
125
6.98k
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
6.98k
                UInt32 from_scale = 0;
127
128
6.98k
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
6.98k
                    const auto* from_decimal_type =
130
6.98k
                            check_and_get_data_type<FromDataType>(from_type.get());
131
6.98k
                    from_precision =
132
6.98k
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
6.98k
                    from_scale = from_decimal_type->get_scale();
134
6.98k
                }
135
136
6.98k
                UInt32 to_max_digits = 0;
137
6.98k
                UInt32 to_precision = 0;
138
6.98k
                UInt32 to_scale = 0;
139
140
6.98k
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
6.98k
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
6.98k
                    const auto* to_decimal_type =
144
6.98k
                            check_and_get_data_type<ToDataType>(to_type.get());
145
6.98k
                    to_precision = to_decimal_type->get_precision();
146
6.98k
                    ToDataType::check_type_precision(to_precision);
147
148
6.98k
                    to_scale = to_decimal_type->get_scale();
149
6.98k
                    ToDataType::check_type_scale(to_scale);
150
6.98k
                }
151
6.98k
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
6.98k
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
6.98k
                    to_precision = to_max_digits;
154
6.98k
                }
155
156
6.98k
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
6.98k
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
6.98k
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
6.98k
                if (to_scale > from_scale) {
161
6.98k
                    multiply_may_overflow &=
162
6.98k
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
6.98k
                }
164
6.98k
                return narrow_integral || multiply_may_overflow;
165
6.98k
            }
166
6.98k
            return false;
167
6.98k
        });
168
6.98k
    };
function_cast.cpp:_ZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE20EEEvEEEEbRKT_
Line
Count
Source
104
4
    auto make_default_wrapper = [&](const auto& types) -> bool {
105
4
        using Types = std::decay_t<decltype(types)>;
106
4
        using ToDataType = typename Types::LeftType;
107
108
        if constexpr (!(IsDataTypeDecimalOrNumber<ToDataType> || IsDatelikeV1Types<ToDataType> ||
109
                        IsDatelikeV2Types<ToDataType> ||
110
                        std::is_same_v<ToDataType, DataTypeTimeV2>)) {
111
            return false;
112
        }
113
4
        return call_on_index_and_data_type<
114
4
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
4
            using Types2 = std::decay_t<decltype(types2)>;
116
4
            using FromDataType = typename Types2::LeftType;
117
4
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
4
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
4
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
4
                return false;
121
4
            }
122
4
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
4
                using FromFieldType = typename FromDataType::FieldType;
124
4
                using ToFieldType = typename ToDataType::FieldType;
125
4
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
4
                UInt32 from_scale = 0;
127
128
4
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
4
                    const auto* from_decimal_type =
130
4
                            check_and_get_data_type<FromDataType>(from_type.get());
131
4
                    from_precision =
132
4
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
4
                    from_scale = from_decimal_type->get_scale();
134
4
                }
135
136
4
                UInt32 to_max_digits = 0;
137
4
                UInt32 to_precision = 0;
138
4
                UInt32 to_scale = 0;
139
140
4
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
4
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
4
                    const auto* to_decimal_type =
144
4
                            check_and_get_data_type<ToDataType>(to_type.get());
145
4
                    to_precision = to_decimal_type->get_precision();
146
4
                    ToDataType::check_type_precision(to_precision);
147
148
4
                    to_scale = to_decimal_type->get_scale();
149
4
                    ToDataType::check_type_scale(to_scale);
150
4
                }
151
4
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
4
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
4
                    to_precision = to_max_digits;
154
4
                }
155
156
4
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
4
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
4
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
4
                if (to_scale > from_scale) {
161
4
                    multiply_may_overflow &=
162
4
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
4
                }
164
4
                return narrow_integral || multiply_may_overflow;
165
4
            }
166
4
            return false;
167
4
        });
168
4
    };
function_cast.cpp:_ZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE30EEEvEEEEbRKT_
Line
Count
Source
104
6.77k
    auto make_default_wrapper = [&](const auto& types) -> bool {
105
6.77k
        using Types = std::decay_t<decltype(types)>;
106
6.77k
        using ToDataType = typename Types::LeftType;
107
108
        if constexpr (!(IsDataTypeDecimalOrNumber<ToDataType> || IsDatelikeV1Types<ToDataType> ||
109
                        IsDatelikeV2Types<ToDataType> ||
110
                        std::is_same_v<ToDataType, DataTypeTimeV2>)) {
111
            return false;
112
        }
113
6.77k
        return call_on_index_and_data_type<
114
6.77k
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
6.77k
            using Types2 = std::decay_t<decltype(types2)>;
116
6.77k
            using FromDataType = typename Types2::LeftType;
117
6.77k
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
6.77k
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
6.77k
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
6.77k
                return false;
121
6.77k
            }
122
6.77k
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
6.77k
                using FromFieldType = typename FromDataType::FieldType;
124
6.77k
                using ToFieldType = typename ToDataType::FieldType;
125
6.77k
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
6.77k
                UInt32 from_scale = 0;
127
128
6.77k
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
6.77k
                    const auto* from_decimal_type =
130
6.77k
                            check_and_get_data_type<FromDataType>(from_type.get());
131
6.77k
                    from_precision =
132
6.77k
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
6.77k
                    from_scale = from_decimal_type->get_scale();
134
6.77k
                }
135
136
6.77k
                UInt32 to_max_digits = 0;
137
6.77k
                UInt32 to_precision = 0;
138
6.77k
                UInt32 to_scale = 0;
139
140
6.77k
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
6.77k
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
6.77k
                    const auto* to_decimal_type =
144
6.77k
                            check_and_get_data_type<ToDataType>(to_type.get());
145
6.77k
                    to_precision = to_decimal_type->get_precision();
146
6.77k
                    ToDataType::check_type_precision(to_precision);
147
148
6.77k
                    to_scale = to_decimal_type->get_scale();
149
6.77k
                    ToDataType::check_type_scale(to_scale);
150
6.77k
                }
151
6.77k
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
6.77k
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
6.77k
                    to_precision = to_max_digits;
154
6.77k
                }
155
156
6.77k
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
6.77k
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
6.77k
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
6.77k
                if (to_scale > from_scale) {
161
6.77k
                    multiply_may_overflow &=
162
6.77k
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
6.77k
                }
164
6.77k
                return narrow_integral || multiply_may_overflow;
165
6.77k
            }
166
6.77k
            return false;
167
6.77k
        });
168
6.77k
    };
function_cast.cpp:_ZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE35EEEvEEEEbRKT_
Line
Count
Source
104
2.84k
    auto make_default_wrapper = [&](const auto& types) -> bool {
105
2.84k
        using Types = std::decay_t<decltype(types)>;
106
2.84k
        using ToDataType = typename Types::LeftType;
107
108
        if constexpr (!(IsDataTypeDecimalOrNumber<ToDataType> || IsDatelikeV1Types<ToDataType> ||
109
                        IsDatelikeV2Types<ToDataType> ||
110
                        std::is_same_v<ToDataType, DataTypeTimeV2>)) {
111
            return false;
112
        }
113
2.84k
        return call_on_index_and_data_type<
114
2.84k
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
2.84k
            using Types2 = std::decay_t<decltype(types2)>;
116
2.84k
            using FromDataType = typename Types2::LeftType;
117
2.84k
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
2.84k
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
2.84k
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
2.84k
                return false;
121
2.84k
            }
122
2.84k
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
2.84k
                using FromFieldType = typename FromDataType::FieldType;
124
2.84k
                using ToFieldType = typename ToDataType::FieldType;
125
2.84k
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
2.84k
                UInt32 from_scale = 0;
127
128
2.84k
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
2.84k
                    const auto* from_decimal_type =
130
2.84k
                            check_and_get_data_type<FromDataType>(from_type.get());
131
2.84k
                    from_precision =
132
2.84k
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
2.84k
                    from_scale = from_decimal_type->get_scale();
134
2.84k
                }
135
136
2.84k
                UInt32 to_max_digits = 0;
137
2.84k
                UInt32 to_precision = 0;
138
2.84k
                UInt32 to_scale = 0;
139
140
2.84k
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
2.84k
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
2.84k
                    const auto* to_decimal_type =
144
2.84k
                            check_and_get_data_type<ToDataType>(to_type.get());
145
2.84k
                    to_precision = to_decimal_type->get_precision();
146
2.84k
                    ToDataType::check_type_precision(to_precision);
147
148
2.84k
                    to_scale = to_decimal_type->get_scale();
149
2.84k
                    ToDataType::check_type_scale(to_scale);
150
2.84k
                }
151
2.84k
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
2.84k
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
2.84k
                    to_precision = to_max_digits;
154
2.84k
                }
155
156
2.84k
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
2.84k
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
2.84k
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
2.84k
                if (to_scale > from_scale) {
161
2.84k
                    multiply_may_overflow &=
162
2.84k
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
2.84k
                }
164
2.84k
                return narrow_integral || multiply_may_overflow;
165
2.84k
            }
166
2.84k
            return false;
167
2.84k
        });
168
2.84k
    };
Unexecuted instantiation: function_cast.cpp:_ZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_12DataTypeDateEvEEEEbRKT_
function_cast.cpp:_ZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeDateV2EvEEEEbRKT_
Line
Count
Source
104
185
    auto make_default_wrapper = [&](const auto& types) -> bool {
105
185
        using Types = std::decay_t<decltype(types)>;
106
185
        using ToDataType = typename Types::LeftType;
107
108
        if constexpr (!(IsDataTypeDecimalOrNumber<ToDataType> || IsDatelikeV1Types<ToDataType> ||
109
                        IsDatelikeV2Types<ToDataType> ||
110
                        std::is_same_v<ToDataType, DataTypeTimeV2>)) {
111
            return false;
112
        }
113
185
        return call_on_index_and_data_type<
114
185
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
185
            using Types2 = std::decay_t<decltype(types2)>;
116
185
            using FromDataType = typename Types2::LeftType;
117
185
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
185
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
185
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
185
                return false;
121
185
            }
122
185
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
185
                using FromFieldType = typename FromDataType::FieldType;
124
185
                using ToFieldType = typename ToDataType::FieldType;
125
185
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
185
                UInt32 from_scale = 0;
127
128
185
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
185
                    const auto* from_decimal_type =
130
185
                            check_and_get_data_type<FromDataType>(from_type.get());
131
185
                    from_precision =
132
185
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
185
                    from_scale = from_decimal_type->get_scale();
134
185
                }
135
136
185
                UInt32 to_max_digits = 0;
137
185
                UInt32 to_precision = 0;
138
185
                UInt32 to_scale = 0;
139
140
185
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
185
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
185
                    const auto* to_decimal_type =
144
185
                            check_and_get_data_type<ToDataType>(to_type.get());
145
185
                    to_precision = to_decimal_type->get_precision();
146
185
                    ToDataType::check_type_precision(to_precision);
147
148
185
                    to_scale = to_decimal_type->get_scale();
149
185
                    ToDataType::check_type_scale(to_scale);
150
185
                }
151
185
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
185
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
185
                    to_precision = to_max_digits;
154
185
                }
155
156
185
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
185
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
185
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
185
                if (to_scale > from_scale) {
161
185
                    multiply_may_overflow &=
162
185
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
185
                }
164
185
                return narrow_integral || multiply_may_overflow;
165
185
            }
166
185
            return false;
167
185
        });
168
185
    };
function_cast.cpp:_ZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_18DataTypeDateTimeV2EvEEEEbRKT_
Line
Count
Source
104
260
    auto make_default_wrapper = [&](const auto& types) -> bool {
105
260
        using Types = std::decay_t<decltype(types)>;
106
260
        using ToDataType = typename Types::LeftType;
107
108
        if constexpr (!(IsDataTypeDecimalOrNumber<ToDataType> || IsDatelikeV1Types<ToDataType> ||
109
                        IsDatelikeV2Types<ToDataType> ||
110
                        std::is_same_v<ToDataType, DataTypeTimeV2>)) {
111
            return false;
112
        }
113
260
        return call_on_index_and_data_type<
114
260
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
260
            using Types2 = std::decay_t<decltype(types2)>;
116
260
            using FromDataType = typename Types2::LeftType;
117
260
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
260
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
260
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
260
                return false;
121
260
            }
122
260
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
260
                using FromFieldType = typename FromDataType::FieldType;
124
260
                using ToFieldType = typename ToDataType::FieldType;
125
260
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
260
                UInt32 from_scale = 0;
127
128
260
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
260
                    const auto* from_decimal_type =
130
260
                            check_and_get_data_type<FromDataType>(from_type.get());
131
260
                    from_precision =
132
260
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
260
                    from_scale = from_decimal_type->get_scale();
134
260
                }
135
136
260
                UInt32 to_max_digits = 0;
137
260
                UInt32 to_precision = 0;
138
260
                UInt32 to_scale = 0;
139
140
260
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
260
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
260
                    const auto* to_decimal_type =
144
260
                            check_and_get_data_type<ToDataType>(to_type.get());
145
260
                    to_precision = to_decimal_type->get_precision();
146
260
                    ToDataType::check_type_precision(to_precision);
147
148
260
                    to_scale = to_decimal_type->get_scale();
149
260
                    ToDataType::check_type_scale(to_scale);
150
260
                }
151
260
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
260
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
260
                    to_precision = to_max_digits;
154
260
                }
155
156
260
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
260
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
260
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
260
                if (to_scale > from_scale) {
161
260
                    multiply_may_overflow &=
162
260
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
260
                }
164
260
                return narrow_integral || multiply_may_overflow;
165
260
            }
166
260
            return false;
167
260
        });
168
260
    };
Unexecuted instantiation: function_cast.cpp:_ZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_16DataTypeDateTimeEvEEEEbRKT_
function_cast.cpp:_ZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeTimeV2EvEEEEbRKT_
Line
Count
Source
104
16
    auto make_default_wrapper = [&](const auto& types) -> bool {
105
16
        using Types = std::decay_t<decltype(types)>;
106
16
        using ToDataType = typename Types::LeftType;
107
108
        if constexpr (!(IsDataTypeDecimalOrNumber<ToDataType> || IsDatelikeV1Types<ToDataType> ||
109
                        IsDatelikeV2Types<ToDataType> ||
110
                        std::is_same_v<ToDataType, DataTypeTimeV2>)) {
111
            return false;
112
        }
113
16
        return call_on_index_and_data_type<
114
16
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
16
            using Types2 = std::decay_t<decltype(types2)>;
116
16
            using FromDataType = typename Types2::LeftType;
117
16
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
16
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
16
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
16
                return false;
121
16
            }
122
16
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
16
                using FromFieldType = typename FromDataType::FieldType;
124
16
                using ToFieldType = typename ToDataType::FieldType;
125
16
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
16
                UInt32 from_scale = 0;
127
128
16
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
16
                    const auto* from_decimal_type =
130
16
                            check_and_get_data_type<FromDataType>(from_type.get());
131
16
                    from_precision =
132
16
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
16
                    from_scale = from_decimal_type->get_scale();
134
16
                }
135
136
16
                UInt32 to_max_digits = 0;
137
16
                UInt32 to_precision = 0;
138
16
                UInt32 to_scale = 0;
139
140
16
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
16
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
16
                    const auto* to_decimal_type =
144
16
                            check_and_get_data_type<ToDataType>(to_type.get());
145
16
                    to_precision = to_decimal_type->get_precision();
146
16
                    ToDataType::check_type_precision(to_precision);
147
148
16
                    to_scale = to_decimal_type->get_scale();
149
16
                    ToDataType::check_type_scale(to_scale);
150
16
                }
151
16
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
16
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
16
                    to_precision = to_max_digits;
154
16
                }
155
156
16
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
16
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
16
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
16
                if (to_scale > from_scale) {
161
16
                    multiply_may_overflow &=
162
16
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
16
                }
164
16
                return narrow_integral || multiply_may_overflow;
165
16
            }
166
16
            return false;
167
16
        });
168
16
    };
Unexecuted instantiation: function_cast.cpp:_ZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_19DataTypeTimeStampTzEvEEEEbRKT_
function_cast.cpp:_ZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_12DataTypeIPv4EvEEEEbRKT_
Line
Count
Source
104
7
    auto make_default_wrapper = [&](const auto& types) -> bool {
105
7
        using Types = std::decay_t<decltype(types)>;
106
7
        using ToDataType = typename Types::LeftType;
107
108
        if constexpr (!(IsDataTypeDecimalOrNumber<ToDataType> || IsDatelikeV1Types<ToDataType> ||
109
                        IsDatelikeV2Types<ToDataType> ||
110
7
                        std::is_same_v<ToDataType, DataTypeTimeV2>)) {
111
7
            return false;
112
7
        }
113
0
        return call_on_index_and_data_type<
114
7
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
7
            using Types2 = std::decay_t<decltype(types2)>;
116
7
            using FromDataType = typename Types2::LeftType;
117
7
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
7
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
7
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
7
                return false;
121
7
            }
122
7
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
7
                using FromFieldType = typename FromDataType::FieldType;
124
7
                using ToFieldType = typename ToDataType::FieldType;
125
7
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
7
                UInt32 from_scale = 0;
127
128
7
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
7
                    const auto* from_decimal_type =
130
7
                            check_and_get_data_type<FromDataType>(from_type.get());
131
7
                    from_precision =
132
7
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
7
                    from_scale = from_decimal_type->get_scale();
134
7
                }
135
136
7
                UInt32 to_max_digits = 0;
137
7
                UInt32 to_precision = 0;
138
7
                UInt32 to_scale = 0;
139
140
7
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
7
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
7
                    const auto* to_decimal_type =
144
7
                            check_and_get_data_type<ToDataType>(to_type.get());
145
7
                    to_precision = to_decimal_type->get_precision();
146
7
                    ToDataType::check_type_precision(to_precision);
147
148
7
                    to_scale = to_decimal_type->get_scale();
149
7
                    ToDataType::check_type_scale(to_scale);
150
7
                }
151
7
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
7
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
7
                    to_precision = to_max_digits;
154
7
                }
155
156
7
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
7
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
7
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
7
                if (to_scale > from_scale) {
161
7
                    multiply_may_overflow &=
162
7
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
7
                }
164
7
                return narrow_integral || multiply_may_overflow;
165
7
            }
166
7
            return false;
167
7
        });
168
7
    };
function_cast.cpp:_ZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_12DataTypeIPv6EvEEEEbRKT_
Line
Count
Source
104
10
    auto make_default_wrapper = [&](const auto& types) -> bool {
105
10
        using Types = std::decay_t<decltype(types)>;
106
10
        using ToDataType = typename Types::LeftType;
107
108
        if constexpr (!(IsDataTypeDecimalOrNumber<ToDataType> || IsDatelikeV1Types<ToDataType> ||
109
                        IsDatelikeV2Types<ToDataType> ||
110
10
                        std::is_same_v<ToDataType, DataTypeTimeV2>)) {
111
10
            return false;
112
10
        }
113
0
        return call_on_index_and_data_type<
114
10
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
10
            using Types2 = std::decay_t<decltype(types2)>;
116
10
            using FromDataType = typename Types2::LeftType;
117
10
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
10
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
10
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
10
                return false;
121
10
            }
122
10
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
10
                using FromFieldType = typename FromDataType::FieldType;
124
10
                using ToFieldType = typename ToDataType::FieldType;
125
10
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
10
                UInt32 from_scale = 0;
127
128
10
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
10
                    const auto* from_decimal_type =
130
10
                            check_and_get_data_type<FromDataType>(from_type.get());
131
10
                    from_precision =
132
10
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
10
                    from_scale = from_decimal_type->get_scale();
134
10
                }
135
136
10
                UInt32 to_max_digits = 0;
137
10
                UInt32 to_precision = 0;
138
10
                UInt32 to_scale = 0;
139
140
10
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
10
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
10
                    const auto* to_decimal_type =
144
10
                            check_and_get_data_type<ToDataType>(to_type.get());
145
10
                    to_precision = to_decimal_type->get_precision();
146
10
                    ToDataType::check_type_precision(to_precision);
147
148
10
                    to_scale = to_decimal_type->get_scale();
149
10
                    ToDataType::check_type_scale(to_scale);
150
10
                }
151
10
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
10
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
10
                    to_precision = to_max_digits;
154
10
                }
155
156
10
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
10
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
10
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
10
                if (to_scale > from_scale) {
161
10
                    multiply_may_overflow &=
162
10
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
10
                }
164
10
                return narrow_integral || multiply_may_overflow;
165
10
            }
166
10
            return false;
167
10
        });
168
10
    };
function_cast.cpp:_ZZN5doris11CastWrapper33need_replace_null_data_to_defaultEPNS_15FunctionContextERKSt10shared_ptrIKNS_9IDataTypeEES8_ENK3$_0clINS_8TypePairINS_14DataTypeStringEvEEEEbRKT_
Line
Count
Source
104
6.58k
    auto make_default_wrapper = [&](const auto& types) -> bool {
105
6.58k
        using Types = std::decay_t<decltype(types)>;
106
6.58k
        using ToDataType = typename Types::LeftType;
107
108
        if constexpr (!(IsDataTypeDecimalOrNumber<ToDataType> || IsDatelikeV1Types<ToDataType> ||
109
                        IsDatelikeV2Types<ToDataType> ||
110
6.58k
                        std::is_same_v<ToDataType, DataTypeTimeV2>)) {
111
6.58k
            return false;
112
6.58k
        }
113
0
        return call_on_index_and_data_type<
114
6.58k
                ToDataType>(from_type->get_primitive_type(), [&](const auto& types2) -> bool {
115
6.58k
            using Types2 = std::decay_t<decltype(types2)>;
116
6.58k
            using FromDataType = typename Types2::LeftType;
117
6.58k
            if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> ||
118
6.58k
                            IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
119
6.58k
                            std::is_same_v<FromDataType, DataTypeTimeV2>)) {
120
6.58k
                return false;
121
6.58k
            }
122
6.58k
            if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
123
6.58k
                using FromFieldType = typename FromDataType::FieldType;
124
6.58k
                using ToFieldType = typename ToDataType::FieldType;
125
6.58k
                UInt32 from_precision = NumberTraits::max_ascii_len<FromFieldType>();
126
6.58k
                UInt32 from_scale = 0;
127
128
6.58k
                if constexpr (IsDataTypeDecimal<FromDataType>) {
129
6.58k
                    const auto* from_decimal_type =
130
6.58k
                            check_and_get_data_type<FromDataType>(from_type.get());
131
6.58k
                    from_precision =
132
6.58k
                            NumberTraits::max_ascii_len<typename FromFieldType::NativeType>();
133
6.58k
                    from_scale = from_decimal_type->get_scale();
134
6.58k
                }
135
136
6.58k
                UInt32 to_max_digits = 0;
137
6.58k
                UInt32 to_precision = 0;
138
6.58k
                UInt32 to_scale = 0;
139
140
6.58k
                if constexpr (IsDataTypeDecimal<ToDataType>) {
141
6.58k
                    to_max_digits = NumberTraits::max_ascii_len<typename ToFieldType::NativeType>();
142
143
6.58k
                    const auto* to_decimal_type =
144
6.58k
                            check_and_get_data_type<ToDataType>(to_type.get());
145
6.58k
                    to_precision = to_decimal_type->get_precision();
146
6.58k
                    ToDataType::check_type_precision(to_precision);
147
148
6.58k
                    to_scale = to_decimal_type->get_scale();
149
6.58k
                    ToDataType::check_type_scale(to_scale);
150
6.58k
                }
151
6.58k
                if constexpr (IsIntegralV<ToFieldType> || std::is_floating_point_v<ToFieldType>) {
152
6.58k
                    to_max_digits = NumberTraits::max_ascii_len<ToFieldType>();
153
6.58k
                    to_precision = to_max_digits;
154
6.58k
                }
155
156
6.58k
                bool narrow_integral = context->check_overflow_for_decimal() &&
157
6.58k
                                       (to_precision - to_scale) <= (from_precision - from_scale);
158
159
6.58k
                bool multiply_may_overflow = context->check_overflow_for_decimal();
160
6.58k
                if (to_scale > from_scale) {
161
6.58k
                    multiply_may_overflow &=
162
6.58k
                            (from_precision + to_scale - from_scale) >= to_max_digits;
163
6.58k
                }
164
6.58k
                return narrow_integral || multiply_may_overflow;
165
6.58k
            }
166
6.58k
            return false;
167
6.58k
        });
168
6.58k
    };
169
170
111k
    return call_on_index_and_data_type<void>(to_type->get_primitive_type(), make_default_wrapper);
171
118k
}
172
173
WrapperType prepare_remove_nullable(FunctionContext* context, const DataTypePtr& from_type,
174
125k
                                    const DataTypePtr& to_type) {
175
    /// Determine whether pre-processing and/or post-processing must take place during conversion.
176
125k
    bool result_is_nullable = to_type->is_nullable();
177
178
125k
    if (result_is_nullable) {
179
118k
        return [from_type, to_type](FunctionContext* context, Block& block,
180
118k
                                    const ColumnNumbers& arguments, uint32_t result,
181
118k
                                    size_t input_rows_count,
182
118k
                                    const NullMap::value_type* null_map = nullptr) {
183
118k
            auto from_type_not_nullable = remove_nullable(from_type);
184
118k
            auto to_type_not_nullable = remove_nullable(to_type);
185
186
118k
            bool replace_null_data_to_default = need_replace_null_data_to_default(
187
118k
                    context, from_type_not_nullable, to_type_not_nullable);
188
189
118k
            auto nested_result_index = block.columns();
190
118k
            block.insert(block.get_by_position(result).unnest_nullable());
191
118k
            auto nested_source_index = block.columns();
192
118k
            block.insert(block.get_by_position(arguments[0])
193
118k
                                 .unnest_nullable(replace_null_data_to_default));
194
195
118k
            const auto& arg_col = block.get_by_position(arguments[0]);
196
118k
            const NullMap::value_type* arg_null_map = nullptr;
197
118k
            if (const auto* nullable = check_and_get_column<ColumnNullable>(*arg_col.column)) {
198
117k
                arg_null_map = nullable->get_null_map_data().data();
199
117k
            }
200
118k
            RETURN_IF_ERROR(prepare_impl(context, from_type_not_nullable, to_type_not_nullable)(
201
118k
                    context, block, {nested_source_index}, nested_result_index, input_rows_count,
202
118k
                    arg_null_map));
203
204
94.4k
            block.get_by_position(result).column =
205
94.4k
                    wrap_in_nullable(block.get_by_position(nested_result_index).column, block,
206
94.4k
                                     arguments, input_rows_count);
207
208
94.4k
            block.erase(nested_source_index);
209
94.4k
            block.erase(nested_result_index);
210
94.4k
            return Status::OK();
211
118k
        };
212
118k
    } else {
213
7.28k
        return prepare_impl(context, from_type, to_type);
214
7.28k
    }
215
125k
}
216
217
/// 'from_type' and 'to_type' are nested types in case of Nullable.
218
/// 'requested_result_is_nullable' is true if CAST to Nullable type is requested.
219
WrapperType prepare_impl(FunctionContext* context, const DataTypePtr& origin_from_type,
220
125k
                         const DataTypePtr& origin_to_type) {
221
125k
    auto to_type = get_serialized_type(origin_to_type);
222
125k
    auto from_type = get_serialized_type(origin_from_type);
223
125k
    if (from_type->equals(*to_type)) {
224
7.13k
        return create_identity_wrapper(from_type);
225
7.13k
    }
226
227
    // variant needs to be judged first
228
118k
    if (to_type->get_primitive_type() == PrimitiveType::TYPE_VARIANT) {
229
43
        return create_cast_to_variant_wrapper(from_type,
230
43
                                              static_cast<const DataTypeVariant&>(*to_type));
231
43
    }
232
118k
    if (from_type->get_primitive_type() == PrimitiveType::TYPE_VARIANT) {
233
22
        return create_cast_from_variant_wrapper(static_cast<const DataTypeVariant&>(*from_type),
234
22
                                                to_type);
235
22
    }
236
237
118k
    if (from_type->get_primitive_type() == PrimitiveType::TYPE_JSONB) {
238
127
        return create_cast_from_jsonb_wrapper(static_cast<const DataTypeJsonb&>(*from_type),
239
127
                                              to_type,
240
127
                                              context ? context->jsonb_string_as_string() : false);
241
127
    }
242
243
118k
    switch (to_type->get_primitive_type()) {
244
58
    case PrimitiveType::TYPE_BOOLEAN:
245
58
        return create_boolean_wrapper(context, from_type);
246
2.52k
    case PrimitiveType::TYPE_TINYINT:
247
2.52k
        return create_int_wrapper<DataTypeInt8>(context, from_type);
248
1.55k
    case PrimitiveType::TYPE_SMALLINT:
249
1.55k
        return create_int_wrapper<DataTypeInt16>(context, from_type);
250
3.82k
    case PrimitiveType::TYPE_INT:
251
3.82k
        return create_int_wrapper<DataTypeInt32>(context, from_type);
252
5.44k
    case PrimitiveType::TYPE_BIGINT:
253
5.44k
        return create_int_wrapper<DataTypeInt64>(context, from_type);
254
1.08k
    case PrimitiveType::TYPE_LARGEINT:
255
1.08k
        return create_int_wrapper<DataTypeInt128>(context, from_type);
256
8.19k
    case PrimitiveType::TYPE_FLOAT:
257
8.19k
        return create_float_wrapper<DataTypeFloat32>(context, from_type);
258
12.7k
    case PrimitiveType::TYPE_DOUBLE:
259
12.7k
        return create_float_wrapper<DataTypeFloat64>(context, from_type);
260
0
    case PrimitiveType::TYPE_DATE:
261
0
        return create_datelike_wrapper<DataTypeDate>(context, from_type);
262
0
    case PrimitiveType::TYPE_DATETIME:
263
0
        return create_datelike_wrapper<DataTypeDateTime>(context, from_type);
264
185
    case PrimitiveType::TYPE_DATEV2:
265
185
        return create_datelike_wrapper<DataTypeDateV2>(context, from_type);
266
260
    case PrimitiveType::TYPE_DATETIMEV2:
267
260
        return create_datelike_wrapper<DataTypeDateTimeV2>(context, from_type);
268
0
    case PrimitiveType::TYPE_TIMESTAMPTZ:
269
0
        return create_timestamptz_wrapper(context, from_type);
270
16
    case PrimitiveType::TYPE_TIMEV2:
271
16
        return create_datelike_wrapper<DataTypeTimeV2>(context, from_type);
272
7
    case PrimitiveType::TYPE_IPV4:
273
7
        return create_ip_wrapper<DataTypeIPv4>(context, from_type);
274
10
    case PrimitiveType::TYPE_IPV6:
275
10
        return create_ip_wrapper<DataTypeIPv6>(context, from_type);
276
4
    case PrimitiveType::TYPE_DECIMALV2:
277
4
        return create_decimal_wrapper<DataTypeDecimalV2>(context, from_type);
278
3.48k
    case PrimitiveType::TYPE_DECIMAL32:
279
3.48k
        return create_decimal_wrapper<DataTypeDecimal32>(context, from_type);
280
6.98k
    case PrimitiveType::TYPE_DECIMAL64:
281
6.98k
        return create_decimal_wrapper<DataTypeDecimal64>(context, from_type);
282
8.21k
    case PrimitiveType::TYPE_DECIMAL128I:
283
8.21k
        return create_decimal_wrapper<DataTypeDecimal128>(context, from_type);
284
2.84k
    case PrimitiveType::TYPE_DECIMAL256:
285
2.84k
        return create_decimal_wrapper<DataTypeDecimal256>(context, from_type);
286
2
    case PrimitiveType::TYPE_CHAR:
287
2.85k
    case PrimitiveType::TYPE_VARCHAR:
288
7.00k
    case PrimitiveType::TYPE_STRING:
289
7.00k
        return create_string_wrapper(from_type);
290
2.04k
    case PrimitiveType::TYPE_ARRAY:
291
2.04k
        return create_array_wrapper(context, from_type,
292
2.04k
                                    static_cast<const DataTypeArray&>(*to_type));
293
1.78k
    case PrimitiveType::TYPE_STRUCT:
294
1.78k
        return create_struct_wrapper(context, from_type,
295
1.78k
                                     static_cast<const DataTypeStruct&>(*to_type));
296
1.63k
    case PrimitiveType::TYPE_MAP:
297
1.63k
        return create_map_wrapper(context, from_type, static_cast<const DataTypeMap&>(*to_type));
298
4
    case PrimitiveType::TYPE_HLL:
299
4
        return create_hll_wrapper(context, from_type, static_cast<const DataTypeHLL&>(*to_type));
300
4
    case PrimitiveType::TYPE_BITMAP:
301
4
        return create_bitmap_wrapper(context, from_type,
302
4
                                     static_cast<const DataTypeBitMap&>(*to_type));
303
48.2k
    case PrimitiveType::TYPE_JSONB:
304
48.2k
        return create_cast_to_jsonb_wrapper(from_type, static_cast<const DataTypeJsonb&>(*to_type),
305
48.2k
                                            context ? context->string_as_jsonb_string() : false);
306
0
    case PrimitiveType::TYPE_VARBINARY:
307
0
        return create_varbinary_wrapper(from_type);
308
0
    default:
309
0
        break;
310
118k
    }
311
312
0
    return create_unsupport_wrapper(from_type->get_name(), to_type->get_name());
313
118k
}
314
315
} // namespace CastWrapper
316
317
class PreparedFunctionCast : public PreparedFunctionImpl {
318
public:
319
    explicit PreparedFunctionCast(CastWrapper::WrapperType&& wrapper_function_, const char* name_)
320
118k
            : wrapper_function(std::move(wrapper_function_)), name(name_) {}
321
322
0
    String get_name() const override { return name; }
323
324
protected:
325
    Status execute_impl(FunctionContext* context, Block& block, const ColumnNumbers& arguments,
326
118k
                        uint32_t result, size_t input_rows_count) const override {
327
118k
        return wrapper_function(context, block, arguments, result, input_rows_count, nullptr);
328
118k
    }
329
330
118k
    bool use_default_implementation_for_nulls() const override { return false; }
331
118k
    ColumnNumbers get_arguments_that_are_always_constant() const override { return {1}; }
332
333
private:
334
    CastWrapper::WrapperType wrapper_function;
335
    const char* name;
336
};
337
338
class FunctionCast final : public IFunctionBase {
339
public:
340
    FunctionCast(const char* name_, DataTypes argument_types_, DataTypePtr return_type_)
341
109k
            : name(name_),
342
109k
              argument_types(std::move(argument_types_)),
343
109k
              return_type(std::move(return_type_)) {}
344
345
118k
    const DataTypes& get_argument_types() const override { return argument_types; }
346
118k
    const DataTypePtr& get_return_type() const override { return return_type; }
347
348
    PreparedFunctionPtr prepare(FunctionContext* context, const Block& /*sample_block*/,
349
                                const ColumnNumbers& /*arguments*/,
350
118k
                                uint32_t /*result*/) const override {
351
118k
        return std::make_shared<PreparedFunctionCast>(
352
118k
                CastWrapper::prepare_unpack_dictionaries(context, get_argument_types()[0],
353
118k
                                                         get_return_type()),
354
118k
                name);
355
118k
    }
356
357
0
    String get_name() const override { return name; }
358
359
0
    bool is_use_default_implementation_for_constants() const override { return true; }
360
361
private:
362
    const char* name = nullptr;
363
364
    DataTypes argument_types;
365
    DataTypePtr return_type;
366
};
367
368
class FunctionBuilderCast : public FunctionBuilderImpl {
369
public:
370
    static constexpr auto name = "CAST";
371
109k
    static FunctionBuilderPtr create() { return std::make_shared<FunctionBuilderCast>(); }
372
373
109k
    FunctionBuilderCast() = default;
374
375
1
    String get_name() const override { return name; }
376
377
0
    size_t get_number_of_arguments() const override { return 2; }
378
379
0
    ColumnNumbers get_arguments_that_are_always_constant() const override { return {1}; }
380
381
protected:
382
    FunctionBasePtr build_impl(const ColumnsWithTypeAndName& arguments,
383
109k
                               const DataTypePtr& return_type) const override {
384
109k
        DataTypes data_types(arguments.size());
385
386
329k
        for (size_t i = 0; i < arguments.size(); ++i) {
387
219k
            data_types[i] = arguments[i].type;
388
219k
        }
389
390
109k
        return std::make_shared<FunctionCast>(name, data_types, return_type);
391
109k
    }
392
393
109k
    bool skip_return_type_check() const override { return true; }
394
0
    DataTypePtr get_return_type_impl(const ColumnsWithTypeAndName& arguments) const override {
395
0
        return nullptr;
396
0
    }
397
398
0
    bool use_default_implementation_for_nulls() const override { return false; }
399
};
400
401
7
void register_function_cast(SimpleFunctionFactory& factory) {
402
7
    factory.register_function<FunctionBuilderCast>();
403
7
}
404
} // namespace doris