Coverage Report

Created: 2026-08-02 04:05

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
be/src/exprs/function/cast/function_cast_date.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 "core/data_type/data_type_date.h"
19
#include "core/data_type/data_type_date_or_datetime_v2.h"
20
#include "core/data_type/data_type_date_time.h"
21
#include "core/data_type/data_type_time.h"
22
#include "exprs/function/cast/cast_to_date.h"
23
24
namespace doris::CastWrapper {
25
26
template <typename ToDataType> // must datelike type
27
163
WrapperType create_datelike_wrapper(FunctionContext* context, const DataTypePtr& from_type) {
28
163
    std::shared_ptr<CastToBase> cast_to_datelike;
29
30
163
    auto make_datelike_wrapper = [&](const auto& types) -> bool {
31
163
        using Types = std::decay_t<decltype(types)>;
32
163
        using FromDataType = typename Types::LeftType;
33
163
        constexpr bool is_nano_source = std::is_same_v<FromDataType, DataTypeDateTimeV2Nano>;
34
163
        constexpr bool is_nano_target = std::is_same_v<ToDataType, DataTypeDateTimeV2Nano>;
35
163
        constexpr bool is_supported_nano_cast = is_nano_target && IsStringType<FromDataType>;
36
163
        constexpr bool is_supported_legacy_cast =
37
163
                !is_nano_source && !is_nano_target &&
38
163
                (CastUtil::IsPureDigitType<FromDataType> || IsDatelikeTypes<FromDataType> ||
39
0
                 IsStringType<FromDataType> || std::is_same_v<FromDataType, DataTypeTimeStampTz>);
40
163
        if constexpr (is_supported_nano_cast || is_supported_legacy_cast) {
41
163
            if (context->enable_strict_mode()) {
42
129
                cast_to_datelike = std::make_shared<
43
129
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
44
129
            } else {
45
34
                cast_to_datelike = std::make_shared<
46
34
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
47
34
            }
48
163
            return true;
49
163
        } else {
50
0
            return false;
51
0
        }
52
163
    };
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_12DataTypeDateEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE2EEEvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_12DataTypeDateEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE3EEEvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_12DataTypeDateEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE4EEEvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_12DataTypeDateEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE5EEEvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_12DataTypeDateEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE6EEEvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_12DataTypeDateEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE7EEEvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_12DataTypeDateEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE8EEEvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_12DataTypeDateEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE9EEEvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_12DataTypeDateEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE28EEEvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_12DataTypeDateEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE29EEEvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_12DataTypeDateEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE20EEEvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_12DataTypeDateEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE30EEEvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_12DataTypeDateEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE35EEEvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_12DataTypeDateEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairIS2_vEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_12DataTypeDateEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_14DataTypeDateV2EvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_12DataTypeDateEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_18DataTypeDateTimeV2EvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_12DataTypeDateEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_22DataTypeDateTimeV2NanoEvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_12DataTypeDateEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_16DataTypeDateTimeEvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_12DataTypeDateEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_14DataTypeTimeV2EvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_12DataTypeDateEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_19DataTypeTimeStampTzEvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_12DataTypeDateEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_12DataTypeIPv4EvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_12DataTypeDateEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_12DataTypeIPv6EvEEEEbSQ_
_ZZN5doris11CastWrapper23create_datelike_wrapperINS_12DataTypeDateEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_14DataTypeStringEvEEEEbSQ_
Line
Count
Source
30
1
    auto make_datelike_wrapper = [&](const auto& types) -> bool {
31
1
        using Types = std::decay_t<decltype(types)>;
32
1
        using FromDataType = typename Types::LeftType;
33
1
        constexpr bool is_nano_source = std::is_same_v<FromDataType, DataTypeDateTimeV2Nano>;
34
1
        constexpr bool is_nano_target = std::is_same_v<ToDataType, DataTypeDateTimeV2Nano>;
35
1
        constexpr bool is_supported_nano_cast = is_nano_target && IsStringType<FromDataType>;
36
1
        constexpr bool is_supported_legacy_cast =
37
1
                !is_nano_source && !is_nano_target &&
38
1
                (CastUtil::IsPureDigitType<FromDataType> || IsDatelikeTypes<FromDataType> ||
39
0
                 IsStringType<FromDataType> || std::is_same_v<FromDataType, DataTypeTimeStampTz>);
40
1
        if constexpr (is_supported_nano_cast || is_supported_legacy_cast) {
41
1
            if (context->enable_strict_mode()) {
42
1
                cast_to_datelike = std::make_shared<
43
1
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
44
1
            } else {
45
0
                cast_to_datelike = std::make_shared<
46
0
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
47
0
            }
48
1
            return true;
49
        } else {
50
            return false;
51
        }
52
1
    };
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_16DataTypeDateTimeEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE2EEEvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_16DataTypeDateTimeEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE3EEEvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_16DataTypeDateTimeEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE4EEEvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_16DataTypeDateTimeEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE5EEEvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_16DataTypeDateTimeEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE6EEEvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_16DataTypeDateTimeEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE7EEEvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_16DataTypeDateTimeEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE8EEEvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_16DataTypeDateTimeEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE9EEEvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_16DataTypeDateTimeEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE28EEEvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_16DataTypeDateTimeEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE29EEEvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_16DataTypeDateTimeEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE20EEEvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_16DataTypeDateTimeEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE30EEEvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_16DataTypeDateTimeEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE35EEEvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_16DataTypeDateTimeEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_12DataTypeDateEvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_16DataTypeDateTimeEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_14DataTypeDateV2EvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_16DataTypeDateTimeEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_18DataTypeDateTimeV2EvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_16DataTypeDateTimeEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_22DataTypeDateTimeV2NanoEvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_16DataTypeDateTimeEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairIS2_vEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_16DataTypeDateTimeEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_14DataTypeTimeV2EvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_16DataTypeDateTimeEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_19DataTypeTimeStampTzEvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_16DataTypeDateTimeEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_12DataTypeIPv4EvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_16DataTypeDateTimeEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_12DataTypeIPv6EvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_16DataTypeDateTimeEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_14DataTypeStringEvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_14DataTypeDateV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE2EEEvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_14DataTypeDateV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE3EEEvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_14DataTypeDateV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE4EEEvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_14DataTypeDateV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE5EEEvEEEEbSQ_
_ZZN5doris11CastWrapper23create_datelike_wrapperINS_14DataTypeDateV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE6EEEvEEEEbSQ_
Line
Count
Source
30
7
    auto make_datelike_wrapper = [&](const auto& types) -> bool {
31
7
        using Types = std::decay_t<decltype(types)>;
32
7
        using FromDataType = typename Types::LeftType;
33
7
        constexpr bool is_nano_source = std::is_same_v<FromDataType, DataTypeDateTimeV2Nano>;
34
7
        constexpr bool is_nano_target = std::is_same_v<ToDataType, DataTypeDateTimeV2Nano>;
35
7
        constexpr bool is_supported_nano_cast = is_nano_target && IsStringType<FromDataType>;
36
7
        constexpr bool is_supported_legacy_cast =
37
7
                !is_nano_source && !is_nano_target &&
38
7
                (CastUtil::IsPureDigitType<FromDataType> || IsDatelikeTypes<FromDataType> ||
39
0
                 IsStringType<FromDataType> || std::is_same_v<FromDataType, DataTypeTimeStampTz>);
40
7
        if constexpr (is_supported_nano_cast || is_supported_legacy_cast) {
41
7
            if (context->enable_strict_mode()) {
42
5
                cast_to_datelike = std::make_shared<
43
5
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
44
5
            } else {
45
2
                cast_to_datelike = std::make_shared<
46
2
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
47
2
            }
48
7
            return true;
49
        } else {
50
            return false;
51
        }
52
7
    };
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_14DataTypeDateV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE7EEEvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_14DataTypeDateV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE8EEEvEEEEbSQ_
_ZZN5doris11CastWrapper23create_datelike_wrapperINS_14DataTypeDateV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE9EEEvEEEEbSQ_
Line
Count
Source
30
7
    auto make_datelike_wrapper = [&](const auto& types) -> bool {
31
7
        using Types = std::decay_t<decltype(types)>;
32
7
        using FromDataType = typename Types::LeftType;
33
7
        constexpr bool is_nano_source = std::is_same_v<FromDataType, DataTypeDateTimeV2Nano>;
34
7
        constexpr bool is_nano_target = std::is_same_v<ToDataType, DataTypeDateTimeV2Nano>;
35
7
        constexpr bool is_supported_nano_cast = is_nano_target && IsStringType<FromDataType>;
36
7
        constexpr bool is_supported_legacy_cast =
37
7
                !is_nano_source && !is_nano_target &&
38
7
                (CastUtil::IsPureDigitType<FromDataType> || IsDatelikeTypes<FromDataType> ||
39
0
                 IsStringType<FromDataType> || std::is_same_v<FromDataType, DataTypeTimeStampTz>);
40
7
        if constexpr (is_supported_nano_cast || is_supported_legacy_cast) {
41
7
            if (context->enable_strict_mode()) {
42
5
                cast_to_datelike = std::make_shared<
43
5
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
44
5
            } else {
45
2
                cast_to_datelike = std::make_shared<
46
2
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
47
2
            }
48
7
            return true;
49
        } else {
50
            return false;
51
        }
52
7
    };
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_14DataTypeDateV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE28EEEvEEEEbSQ_
_ZZN5doris11CastWrapper23create_datelike_wrapperINS_14DataTypeDateV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE29EEEvEEEEbSQ_
Line
Count
Source
30
2
    auto make_datelike_wrapper = [&](const auto& types) -> bool {
31
2
        using Types = std::decay_t<decltype(types)>;
32
2
        using FromDataType = typename Types::LeftType;
33
2
        constexpr bool is_nano_source = std::is_same_v<FromDataType, DataTypeDateTimeV2Nano>;
34
2
        constexpr bool is_nano_target = std::is_same_v<ToDataType, DataTypeDateTimeV2Nano>;
35
2
        constexpr bool is_supported_nano_cast = is_nano_target && IsStringType<FromDataType>;
36
2
        constexpr bool is_supported_legacy_cast =
37
2
                !is_nano_source && !is_nano_target &&
38
2
                (CastUtil::IsPureDigitType<FromDataType> || IsDatelikeTypes<FromDataType> ||
39
0
                 IsStringType<FromDataType> || std::is_same_v<FromDataType, DataTypeTimeStampTz>);
40
2
        if constexpr (is_supported_nano_cast || is_supported_legacy_cast) {
41
2
            if (context->enable_strict_mode()) {
42
0
                cast_to_datelike = std::make_shared<
43
0
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
44
2
            } else {
45
2
                cast_to_datelike = std::make_shared<
46
2
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
47
2
            }
48
2
            return true;
49
        } else {
50
            return false;
51
        }
52
2
    };
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_14DataTypeDateV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE20EEEvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_14DataTypeDateV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE30EEEvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_14DataTypeDateV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE35EEEvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_14DataTypeDateV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_12DataTypeDateEvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_14DataTypeDateV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairIS2_vEEEEbSQ_
_ZZN5doris11CastWrapper23create_datelike_wrapperINS_14DataTypeDateV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_18DataTypeDateTimeV2EvEEEEbSQ_
Line
Count
Source
30
2
    auto make_datelike_wrapper = [&](const auto& types) -> bool {
31
2
        using Types = std::decay_t<decltype(types)>;
32
2
        using FromDataType = typename Types::LeftType;
33
2
        constexpr bool is_nano_source = std::is_same_v<FromDataType, DataTypeDateTimeV2Nano>;
34
2
        constexpr bool is_nano_target = std::is_same_v<ToDataType, DataTypeDateTimeV2Nano>;
35
2
        constexpr bool is_supported_nano_cast = is_nano_target && IsStringType<FromDataType>;
36
2
        constexpr bool is_supported_legacy_cast =
37
2
                !is_nano_source && !is_nano_target &&
38
2
                (CastUtil::IsPureDigitType<FromDataType> || IsDatelikeTypes<FromDataType> ||
39
0
                 IsStringType<FromDataType> || std::is_same_v<FromDataType, DataTypeTimeStampTz>);
40
2
        if constexpr (is_supported_nano_cast || is_supported_legacy_cast) {
41
2
            if (context->enable_strict_mode()) {
42
0
                cast_to_datelike = std::make_shared<
43
0
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
44
2
            } else {
45
2
                cast_to_datelike = std::make_shared<
46
2
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
47
2
            }
48
2
            return true;
49
        } else {
50
            return false;
51
        }
52
2
    };
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_14DataTypeDateV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_22DataTypeDateTimeV2NanoEvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_14DataTypeDateV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_16DataTypeDateTimeEvEEEEbSQ_
_ZZN5doris11CastWrapper23create_datelike_wrapperINS_14DataTypeDateV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_14DataTypeTimeV2EvEEEEbSQ_
Line
Count
Source
30
2
    auto make_datelike_wrapper = [&](const auto& types) -> bool {
31
2
        using Types = std::decay_t<decltype(types)>;
32
2
        using FromDataType = typename Types::LeftType;
33
2
        constexpr bool is_nano_source = std::is_same_v<FromDataType, DataTypeDateTimeV2Nano>;
34
2
        constexpr bool is_nano_target = std::is_same_v<ToDataType, DataTypeDateTimeV2Nano>;
35
2
        constexpr bool is_supported_nano_cast = is_nano_target && IsStringType<FromDataType>;
36
2
        constexpr bool is_supported_legacy_cast =
37
2
                !is_nano_source && !is_nano_target &&
38
2
                (CastUtil::IsPureDigitType<FromDataType> || IsDatelikeTypes<FromDataType> ||
39
0
                 IsStringType<FromDataType> || std::is_same_v<FromDataType, DataTypeTimeStampTz>);
40
2
        if constexpr (is_supported_nano_cast || is_supported_legacy_cast) {
41
2
            if (context->enable_strict_mode()) {
42
0
                cast_to_datelike = std::make_shared<
43
0
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
44
2
            } else {
45
2
                cast_to_datelike = std::make_shared<
46
2
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
47
2
            }
48
2
            return true;
49
        } else {
50
            return false;
51
        }
52
2
    };
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_14DataTypeDateV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_19DataTypeTimeStampTzEvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_14DataTypeDateV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_12DataTypeIPv4EvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_14DataTypeDateV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_12DataTypeIPv6EvEEEEbSQ_
_ZZN5doris11CastWrapper23create_datelike_wrapperINS_14DataTypeDateV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_14DataTypeStringEvEEEEbSQ_
Line
Count
Source
30
52
    auto make_datelike_wrapper = [&](const auto& types) -> bool {
31
52
        using Types = std::decay_t<decltype(types)>;
32
52
        using FromDataType = typename Types::LeftType;
33
52
        constexpr bool is_nano_source = std::is_same_v<FromDataType, DataTypeDateTimeV2Nano>;
34
52
        constexpr bool is_nano_target = std::is_same_v<ToDataType, DataTypeDateTimeV2Nano>;
35
52
        constexpr bool is_supported_nano_cast = is_nano_target && IsStringType<FromDataType>;
36
52
        constexpr bool is_supported_legacy_cast =
37
52
                !is_nano_source && !is_nano_target &&
38
52
                (CastUtil::IsPureDigitType<FromDataType> || IsDatelikeTypes<FromDataType> ||
39
0
                 IsStringType<FromDataType> || std::is_same_v<FromDataType, DataTypeTimeStampTz>);
40
52
        if constexpr (is_supported_nano_cast || is_supported_legacy_cast) {
41
52
            if (context->enable_strict_mode()) {
42
48
                cast_to_datelike = std::make_shared<
43
48
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
44
48
            } else {
45
4
                cast_to_datelike = std::make_shared<
46
4
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
47
4
            }
48
52
            return true;
49
        } else {
50
            return false;
51
        }
52
52
    };
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_18DataTypeDateTimeV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE2EEEvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_18DataTypeDateTimeV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE3EEEvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_18DataTypeDateTimeV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE4EEEvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_18DataTypeDateTimeV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE5EEEvEEEEbSQ_
_ZZN5doris11CastWrapper23create_datelike_wrapperINS_18DataTypeDateTimeV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE6EEEvEEEEbSQ_
Line
Count
Source
30
7
    auto make_datelike_wrapper = [&](const auto& types) -> bool {
31
7
        using Types = std::decay_t<decltype(types)>;
32
7
        using FromDataType = typename Types::LeftType;
33
7
        constexpr bool is_nano_source = std::is_same_v<FromDataType, DataTypeDateTimeV2Nano>;
34
7
        constexpr bool is_nano_target = std::is_same_v<ToDataType, DataTypeDateTimeV2Nano>;
35
7
        constexpr bool is_supported_nano_cast = is_nano_target && IsStringType<FromDataType>;
36
7
        constexpr bool is_supported_legacy_cast =
37
7
                !is_nano_source && !is_nano_target &&
38
7
                (CastUtil::IsPureDigitType<FromDataType> || IsDatelikeTypes<FromDataType> ||
39
0
                 IsStringType<FromDataType> || std::is_same_v<FromDataType, DataTypeTimeStampTz>);
40
7
        if constexpr (is_supported_nano_cast || is_supported_legacy_cast) {
41
7
            if (context->enable_strict_mode()) {
42
5
                cast_to_datelike = std::make_shared<
43
5
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
44
5
            } else {
45
2
                cast_to_datelike = std::make_shared<
46
2
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
47
2
            }
48
7
            return true;
49
        } else {
50
            return false;
51
        }
52
7
    };
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_18DataTypeDateTimeV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE7EEEvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_18DataTypeDateTimeV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE8EEEvEEEEbSQ_
_ZZN5doris11CastWrapper23create_datelike_wrapperINS_18DataTypeDateTimeV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE9EEEvEEEEbSQ_
Line
Count
Source
30
7
    auto make_datelike_wrapper = [&](const auto& types) -> bool {
31
7
        using Types = std::decay_t<decltype(types)>;
32
7
        using FromDataType = typename Types::LeftType;
33
7
        constexpr bool is_nano_source = std::is_same_v<FromDataType, DataTypeDateTimeV2Nano>;
34
7
        constexpr bool is_nano_target = std::is_same_v<ToDataType, DataTypeDateTimeV2Nano>;
35
7
        constexpr bool is_supported_nano_cast = is_nano_target && IsStringType<FromDataType>;
36
7
        constexpr bool is_supported_legacy_cast =
37
7
                !is_nano_source && !is_nano_target &&
38
7
                (CastUtil::IsPureDigitType<FromDataType> || IsDatelikeTypes<FromDataType> ||
39
0
                 IsStringType<FromDataType> || std::is_same_v<FromDataType, DataTypeTimeStampTz>);
40
7
        if constexpr (is_supported_nano_cast || is_supported_legacy_cast) {
41
7
            if (context->enable_strict_mode()) {
42
5
                cast_to_datelike = std::make_shared<
43
5
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
44
5
            } else {
45
2
                cast_to_datelike = std::make_shared<
46
2
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
47
2
            }
48
7
            return true;
49
        } else {
50
            return false;
51
        }
52
7
    };
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_18DataTypeDateTimeV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE28EEEvEEEEbSQ_
_ZZN5doris11CastWrapper23create_datelike_wrapperINS_18DataTypeDateTimeV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE29EEEvEEEEbSQ_
Line
Count
Source
30
4
    auto make_datelike_wrapper = [&](const auto& types) -> bool {
31
4
        using Types = std::decay_t<decltype(types)>;
32
4
        using FromDataType = typename Types::LeftType;
33
4
        constexpr bool is_nano_source = std::is_same_v<FromDataType, DataTypeDateTimeV2Nano>;
34
4
        constexpr bool is_nano_target = std::is_same_v<ToDataType, DataTypeDateTimeV2Nano>;
35
4
        constexpr bool is_supported_nano_cast = is_nano_target && IsStringType<FromDataType>;
36
4
        constexpr bool is_supported_legacy_cast =
37
4
                !is_nano_source && !is_nano_target &&
38
4
                (CastUtil::IsPureDigitType<FromDataType> || IsDatelikeTypes<FromDataType> ||
39
0
                 IsStringType<FromDataType> || std::is_same_v<FromDataType, DataTypeTimeStampTz>);
40
4
        if constexpr (is_supported_nano_cast || is_supported_legacy_cast) {
41
4
            if (context->enable_strict_mode()) {
42
1
                cast_to_datelike = std::make_shared<
43
1
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
44
3
            } else {
45
3
                cast_to_datelike = std::make_shared<
46
3
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
47
3
            }
48
4
            return true;
49
        } else {
50
            return false;
51
        }
52
4
    };
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_18DataTypeDateTimeV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE20EEEvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_18DataTypeDateTimeV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE30EEEvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_18DataTypeDateTimeV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE35EEEvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_18DataTypeDateTimeV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_12DataTypeDateEvEEEEbSQ_
_ZZN5doris11CastWrapper23create_datelike_wrapperINS_18DataTypeDateTimeV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_14DataTypeDateV2EvEEEEbSQ_
Line
Count
Source
30
2
    auto make_datelike_wrapper = [&](const auto& types) -> bool {
31
2
        using Types = std::decay_t<decltype(types)>;
32
2
        using FromDataType = typename Types::LeftType;
33
2
        constexpr bool is_nano_source = std::is_same_v<FromDataType, DataTypeDateTimeV2Nano>;
34
2
        constexpr bool is_nano_target = std::is_same_v<ToDataType, DataTypeDateTimeV2Nano>;
35
2
        constexpr bool is_supported_nano_cast = is_nano_target && IsStringType<FromDataType>;
36
2
        constexpr bool is_supported_legacy_cast =
37
2
                !is_nano_source && !is_nano_target &&
38
2
                (CastUtil::IsPureDigitType<FromDataType> || IsDatelikeTypes<FromDataType> ||
39
0
                 IsStringType<FromDataType> || std::is_same_v<FromDataType, DataTypeTimeStampTz>);
40
2
        if constexpr (is_supported_nano_cast || is_supported_legacy_cast) {
41
2
            if (context->enable_strict_mode()) {
42
0
                cast_to_datelike = std::make_shared<
43
0
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
44
2
            } else {
45
2
                cast_to_datelike = std::make_shared<
46
2
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
47
2
            }
48
2
            return true;
49
        } else {
50
            return false;
51
        }
52
2
    };
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_18DataTypeDateTimeV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairIS2_vEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_18DataTypeDateTimeV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_22DataTypeDateTimeV2NanoEvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_18DataTypeDateTimeV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_16DataTypeDateTimeEvEEEEbSQ_
_ZZN5doris11CastWrapper23create_datelike_wrapperINS_18DataTypeDateTimeV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_14DataTypeTimeV2EvEEEEbSQ_
Line
Count
Source
30
2
    auto make_datelike_wrapper = [&](const auto& types) -> bool {
31
2
        using Types = std::decay_t<decltype(types)>;
32
2
        using FromDataType = typename Types::LeftType;
33
2
        constexpr bool is_nano_source = std::is_same_v<FromDataType, DataTypeDateTimeV2Nano>;
34
2
        constexpr bool is_nano_target = std::is_same_v<ToDataType, DataTypeDateTimeV2Nano>;
35
2
        constexpr bool is_supported_nano_cast = is_nano_target && IsStringType<FromDataType>;
36
2
        constexpr bool is_supported_legacy_cast =
37
2
                !is_nano_source && !is_nano_target &&
38
2
                (CastUtil::IsPureDigitType<FromDataType> || IsDatelikeTypes<FromDataType> ||
39
0
                 IsStringType<FromDataType> || std::is_same_v<FromDataType, DataTypeTimeStampTz>);
40
2
        if constexpr (is_supported_nano_cast || is_supported_legacy_cast) {
41
2
            if (context->enable_strict_mode()) {
42
0
                cast_to_datelike = std::make_shared<
43
0
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
44
2
            } else {
45
2
                cast_to_datelike = std::make_shared<
46
2
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
47
2
            }
48
2
            return true;
49
        } else {
50
            return false;
51
        }
52
2
    };
_ZZN5doris11CastWrapper23create_datelike_wrapperINS_18DataTypeDateTimeV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_19DataTypeTimeStampTzEvEEEEbSQ_
Line
Count
Source
30
1
    auto make_datelike_wrapper = [&](const auto& types) -> bool {
31
1
        using Types = std::decay_t<decltype(types)>;
32
1
        using FromDataType = typename Types::LeftType;
33
1
        constexpr bool is_nano_source = std::is_same_v<FromDataType, DataTypeDateTimeV2Nano>;
34
1
        constexpr bool is_nano_target = std::is_same_v<ToDataType, DataTypeDateTimeV2Nano>;
35
1
        constexpr bool is_supported_nano_cast = is_nano_target && IsStringType<FromDataType>;
36
1
        constexpr bool is_supported_legacy_cast =
37
1
                !is_nano_source && !is_nano_target &&
38
1
                (CastUtil::IsPureDigitType<FromDataType> || IsDatelikeTypes<FromDataType> ||
39
0
                 IsStringType<FromDataType> || std::is_same_v<FromDataType, DataTypeTimeStampTz>);
40
1
        if constexpr (is_supported_nano_cast || is_supported_legacy_cast) {
41
1
            if (context->enable_strict_mode()) {
42
0
                cast_to_datelike = std::make_shared<
43
0
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
44
1
            } else {
45
1
                cast_to_datelike = std::make_shared<
46
1
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
47
1
            }
48
1
            return true;
49
        } else {
50
            return false;
51
        }
52
1
    };
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_18DataTypeDateTimeV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_12DataTypeIPv4EvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_18DataTypeDateTimeV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_12DataTypeIPv6EvEEEEbSQ_
_ZZN5doris11CastWrapper23create_datelike_wrapperINS_18DataTypeDateTimeV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_14DataTypeStringEvEEEEbSQ_
Line
Count
Source
30
51
    auto make_datelike_wrapper = [&](const auto& types) -> bool {
31
51
        using Types = std::decay_t<decltype(types)>;
32
51
        using FromDataType = typename Types::LeftType;
33
51
        constexpr bool is_nano_source = std::is_same_v<FromDataType, DataTypeDateTimeV2Nano>;
34
51
        constexpr bool is_nano_target = std::is_same_v<ToDataType, DataTypeDateTimeV2Nano>;
35
51
        constexpr bool is_supported_nano_cast = is_nano_target && IsStringType<FromDataType>;
36
51
        constexpr bool is_supported_legacy_cast =
37
51
                !is_nano_source && !is_nano_target &&
38
51
                (CastUtil::IsPureDigitType<FromDataType> || IsDatelikeTypes<FromDataType> ||
39
0
                 IsStringType<FromDataType> || std::is_same_v<FromDataType, DataTypeTimeStampTz>);
40
51
        if constexpr (is_supported_nano_cast || is_supported_legacy_cast) {
41
51
            if (context->enable_strict_mode()) {
42
48
                cast_to_datelike = std::make_shared<
43
48
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
44
48
            } else {
45
3
                cast_to_datelike = std::make_shared<
46
3
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
47
3
            }
48
51
            return true;
49
        } else {
50
            return false;
51
        }
52
51
    };
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_22DataTypeDateTimeV2NanoEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE2EEEvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_22DataTypeDateTimeV2NanoEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE3EEEvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_22DataTypeDateTimeV2NanoEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE4EEEvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_22DataTypeDateTimeV2NanoEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE5EEEvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_22DataTypeDateTimeV2NanoEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE6EEEvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_22DataTypeDateTimeV2NanoEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE7EEEvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_22DataTypeDateTimeV2NanoEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE8EEEvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_22DataTypeDateTimeV2NanoEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE9EEEvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_22DataTypeDateTimeV2NanoEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE28EEEvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_22DataTypeDateTimeV2NanoEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE29EEEvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_22DataTypeDateTimeV2NanoEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE20EEEvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_22DataTypeDateTimeV2NanoEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE30EEEvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_22DataTypeDateTimeV2NanoEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE35EEEvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_22DataTypeDateTimeV2NanoEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_12DataTypeDateEvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_22DataTypeDateTimeV2NanoEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_14DataTypeDateV2EvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_22DataTypeDateTimeV2NanoEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_18DataTypeDateTimeV2EvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_22DataTypeDateTimeV2NanoEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairIS2_vEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_22DataTypeDateTimeV2NanoEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_16DataTypeDateTimeEvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_22DataTypeDateTimeV2NanoEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_14DataTypeTimeV2EvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_22DataTypeDateTimeV2NanoEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_19DataTypeTimeStampTzEvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_22DataTypeDateTimeV2NanoEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_12DataTypeIPv4EvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_22DataTypeDateTimeV2NanoEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_12DataTypeIPv6EvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_22DataTypeDateTimeV2NanoEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_14DataTypeStringEvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_14DataTypeTimeV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE2EEEvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_14DataTypeTimeV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE3EEEvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_14DataTypeTimeV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE4EEEvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_14DataTypeTimeV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE5EEEvEEEEbSQ_
_ZZN5doris11CastWrapper23create_datelike_wrapperINS_14DataTypeTimeV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE6EEEvEEEEbSQ_
Line
Count
Source
30
1
    auto make_datelike_wrapper = [&](const auto& types) -> bool {
31
1
        using Types = std::decay_t<decltype(types)>;
32
1
        using FromDataType = typename Types::LeftType;
33
1
        constexpr bool is_nano_source = std::is_same_v<FromDataType, DataTypeDateTimeV2Nano>;
34
1
        constexpr bool is_nano_target = std::is_same_v<ToDataType, DataTypeDateTimeV2Nano>;
35
1
        constexpr bool is_supported_nano_cast = is_nano_target && IsStringType<FromDataType>;
36
1
        constexpr bool is_supported_legacy_cast =
37
1
                !is_nano_source && !is_nano_target &&
38
1
                (CastUtil::IsPureDigitType<FromDataType> || IsDatelikeTypes<FromDataType> ||
39
0
                 IsStringType<FromDataType> || std::is_same_v<FromDataType, DataTypeTimeStampTz>);
40
1
        if constexpr (is_supported_nano_cast || is_supported_legacy_cast) {
41
1
            if (context->enable_strict_mode()) {
42
0
                cast_to_datelike = std::make_shared<
43
0
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
44
1
            } else {
45
1
                cast_to_datelike = std::make_shared<
46
1
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
47
1
            }
48
1
            return true;
49
        } else {
50
            return false;
51
        }
52
1
    };
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_14DataTypeTimeV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE7EEEvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_14DataTypeTimeV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE8EEEvEEEEbSQ_
_ZZN5doris11CastWrapper23create_datelike_wrapperINS_14DataTypeTimeV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_14DataTypeNumberILNS_13PrimitiveTypeE9EEEvEEEEbSQ_
Line
Count
Source
30
1
    auto make_datelike_wrapper = [&](const auto& types) -> bool {
31
1
        using Types = std::decay_t<decltype(types)>;
32
1
        using FromDataType = typename Types::LeftType;
33
1
        constexpr bool is_nano_source = std::is_same_v<FromDataType, DataTypeDateTimeV2Nano>;
34
1
        constexpr bool is_nano_target = std::is_same_v<ToDataType, DataTypeDateTimeV2Nano>;
35
1
        constexpr bool is_supported_nano_cast = is_nano_target && IsStringType<FromDataType>;
36
1
        constexpr bool is_supported_legacy_cast =
37
1
                !is_nano_source && !is_nano_target &&
38
1
                (CastUtil::IsPureDigitType<FromDataType> || IsDatelikeTypes<FromDataType> ||
39
0
                 IsStringType<FromDataType> || std::is_same_v<FromDataType, DataTypeTimeStampTz>);
40
1
        if constexpr (is_supported_nano_cast || is_supported_legacy_cast) {
41
1
            if (context->enable_strict_mode()) {
42
0
                cast_to_datelike = std::make_shared<
43
0
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
44
1
            } else {
45
1
                cast_to_datelike = std::make_shared<
46
1
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
47
1
            }
48
1
            return true;
49
        } else {
50
            return false;
51
        }
52
1
    };
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_14DataTypeTimeV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE28EEEvEEEEbSQ_
_ZZN5doris11CastWrapper23create_datelike_wrapperINS_14DataTypeTimeV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE29EEEvEEEEbSQ_
Line
Count
Source
30
1
    auto make_datelike_wrapper = [&](const auto& types) -> bool {
31
1
        using Types = std::decay_t<decltype(types)>;
32
1
        using FromDataType = typename Types::LeftType;
33
1
        constexpr bool is_nano_source = std::is_same_v<FromDataType, DataTypeDateTimeV2Nano>;
34
1
        constexpr bool is_nano_target = std::is_same_v<ToDataType, DataTypeDateTimeV2Nano>;
35
1
        constexpr bool is_supported_nano_cast = is_nano_target && IsStringType<FromDataType>;
36
1
        constexpr bool is_supported_legacy_cast =
37
1
                !is_nano_source && !is_nano_target &&
38
1
                (CastUtil::IsPureDigitType<FromDataType> || IsDatelikeTypes<FromDataType> ||
39
0
                 IsStringType<FromDataType> || std::is_same_v<FromDataType, DataTypeTimeStampTz>);
40
1
        if constexpr (is_supported_nano_cast || is_supported_legacy_cast) {
41
1
            if (context->enable_strict_mode()) {
42
0
                cast_to_datelike = std::make_shared<
43
0
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
44
1
            } else {
45
1
                cast_to_datelike = std::make_shared<
46
1
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
47
1
            }
48
1
            return true;
49
        } else {
50
            return false;
51
        }
52
1
    };
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_14DataTypeTimeV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE20EEEvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_14DataTypeTimeV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE30EEEvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_14DataTypeTimeV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_15DataTypeDecimalILNS_13PrimitiveTypeE35EEEvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_14DataTypeTimeV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_12DataTypeDateEvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_14DataTypeTimeV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_14DataTypeDateV2EvEEEEbSQ_
_ZZN5doris11CastWrapper23create_datelike_wrapperINS_14DataTypeTimeV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_18DataTypeDateTimeV2EvEEEEbSQ_
Line
Count
Source
30
1
    auto make_datelike_wrapper = [&](const auto& types) -> bool {
31
1
        using Types = std::decay_t<decltype(types)>;
32
1
        using FromDataType = typename Types::LeftType;
33
1
        constexpr bool is_nano_source = std::is_same_v<FromDataType, DataTypeDateTimeV2Nano>;
34
1
        constexpr bool is_nano_target = std::is_same_v<ToDataType, DataTypeDateTimeV2Nano>;
35
1
        constexpr bool is_supported_nano_cast = is_nano_target && IsStringType<FromDataType>;
36
1
        constexpr bool is_supported_legacy_cast =
37
1
                !is_nano_source && !is_nano_target &&
38
1
                (CastUtil::IsPureDigitType<FromDataType> || IsDatelikeTypes<FromDataType> ||
39
0
                 IsStringType<FromDataType> || std::is_same_v<FromDataType, DataTypeTimeStampTz>);
40
1
        if constexpr (is_supported_nano_cast || is_supported_legacy_cast) {
41
1
            if (context->enable_strict_mode()) {
42
0
                cast_to_datelike = std::make_shared<
43
0
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
44
1
            } else {
45
1
                cast_to_datelike = std::make_shared<
46
1
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
47
1
            }
48
1
            return true;
49
        } else {
50
            return false;
51
        }
52
1
    };
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_14DataTypeTimeV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_22DataTypeDateTimeV2NanoEvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_14DataTypeTimeV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_16DataTypeDateTimeEvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_14DataTypeTimeV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairIS2_vEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_14DataTypeTimeV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_19DataTypeTimeStampTzEvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_14DataTypeTimeV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_12DataTypeIPv4EvEEEEbSQ_
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_14DataTypeTimeV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_12DataTypeIPv6EvEEEEbSQ_
_ZZN5doris11CastWrapper23create_datelike_wrapperINS_14DataTypeTimeV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_14DataTypeStringEvEEEEbSQ_
Line
Count
Source
30
12
    auto make_datelike_wrapper = [&](const auto& types) -> bool {
31
12
        using Types = std::decay_t<decltype(types)>;
32
12
        using FromDataType = typename Types::LeftType;
33
12
        constexpr bool is_nano_source = std::is_same_v<FromDataType, DataTypeDateTimeV2Nano>;
34
12
        constexpr bool is_nano_target = std::is_same_v<ToDataType, DataTypeDateTimeV2Nano>;
35
12
        constexpr bool is_supported_nano_cast = is_nano_target && IsStringType<FromDataType>;
36
12
        constexpr bool is_supported_legacy_cast =
37
12
                !is_nano_source && !is_nano_target &&
38
12
                (CastUtil::IsPureDigitType<FromDataType> || IsDatelikeTypes<FromDataType> ||
39
0
                 IsStringType<FromDataType> || std::is_same_v<FromDataType, DataTypeTimeStampTz>);
40
12
        if constexpr (is_supported_nano_cast || is_supported_legacy_cast) {
41
12
            if (context->enable_strict_mode()) {
42
11
                cast_to_datelike = std::make_shared<
43
11
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
44
11
            } else {
45
1
                cast_to_datelike = std::make_shared<
46
1
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
47
1
            }
48
12
            return true;
49
        } else {
50
            return false;
51
        }
52
12
    };
53
54
163
    if (!call_on_index_and_data_type<void>(from_type->get_primitive_type(),
55
163
                                           make_datelike_wrapper)) {
56
0
        return create_unsupport_wrapper(fmt::format(
57
0
                "CAST AS {} not supported {}", ToDataType {}.get_name(), from_type->get_name()));
58
0
    }
59
60
163
    return [cast_to_datelike](FunctionContext* context, Block& block,
61
163
                              const ColumnNumbers& arguments, const uint32_t result,
62
163
                              size_t input_rows_count,
63
163
                              const NullMap::value_type* null_map = nullptr) {
64
163
        return cast_to_datelike->execute_impl(context, block, arguments, result, input_rows_count,
65
163
                                              null_map);
66
163
    };
_ZZN5doris11CastWrapper23create_datelike_wrapperINS_12DataTypeDateEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlS6_S8_SD_jmSF_E_clES6_S8_SD_jmSF_
Line
Count
Source
63
1
                              const NullMap::value_type* null_map = nullptr) {
64
1
        return cast_to_datelike->execute_impl(context, block, arguments, result, input_rows_count,
65
1
                                              null_map);
66
1
    };
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_16DataTypeDateTimeEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlS6_S8_SD_jmSF_E_clES6_S8_SD_jmSF_
_ZZN5doris11CastWrapper23create_datelike_wrapperINS_14DataTypeDateV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlS6_S8_SD_jmSF_E_clES6_S8_SD_jmSF_
Line
Count
Source
63
72
                              const NullMap::value_type* null_map = nullptr) {
64
72
        return cast_to_datelike->execute_impl(context, block, arguments, result, input_rows_count,
65
72
                                              null_map);
66
72
    };
_ZZN5doris11CastWrapper23create_datelike_wrapperINS_18DataTypeDateTimeV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlS6_S8_SD_jmSF_E_clES6_S8_SD_jmSF_
Line
Count
Source
63
74
                              const NullMap::value_type* null_map = nullptr) {
64
74
        return cast_to_datelike->execute_impl(context, block, arguments, result, input_rows_count,
65
74
                                              null_map);
66
74
    };
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_22DataTypeDateTimeV2NanoEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlS6_S8_SD_jmSF_E_clES6_S8_SD_jmSF_
_ZZN5doris11CastWrapper23create_datelike_wrapperINS_14DataTypeTimeV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlS6_S8_SD_jmSF_E_clES6_S8_SD_jmSF_
Line
Count
Source
63
16
                              const NullMap::value_type* null_map = nullptr) {
64
16
        return cast_to_datelike->execute_impl(context, block, arguments, result, input_rows_count,
65
16
                                              null_map);
66
16
    };
67
163
}
_ZN5doris11CastWrapper23create_datelike_wrapperINS_12DataTypeDateEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEE
Line
Count
Source
27
1
WrapperType create_datelike_wrapper(FunctionContext* context, const DataTypePtr& from_type) {
28
1
    std::shared_ptr<CastToBase> cast_to_datelike;
29
30
1
    auto make_datelike_wrapper = [&](const auto& types) -> bool {
31
1
        using Types = std::decay_t<decltype(types)>;
32
1
        using FromDataType = typename Types::LeftType;
33
1
        constexpr bool is_nano_source = std::is_same_v<FromDataType, DataTypeDateTimeV2Nano>;
34
1
        constexpr bool is_nano_target = std::is_same_v<ToDataType, DataTypeDateTimeV2Nano>;
35
1
        constexpr bool is_supported_nano_cast = is_nano_target && IsStringType<FromDataType>;
36
1
        constexpr bool is_supported_legacy_cast =
37
1
                !is_nano_source && !is_nano_target &&
38
1
                (CastUtil::IsPureDigitType<FromDataType> || IsDatelikeTypes<FromDataType> ||
39
1
                 IsStringType<FromDataType> || std::is_same_v<FromDataType, DataTypeTimeStampTz>);
40
1
        if constexpr (is_supported_nano_cast || is_supported_legacy_cast) {
41
1
            if (context->enable_strict_mode()) {
42
1
                cast_to_datelike = std::make_shared<
43
1
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
44
1
            } else {
45
1
                cast_to_datelike = std::make_shared<
46
1
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
47
1
            }
48
1
            return true;
49
1
        } else {
50
1
            return false;
51
1
        }
52
1
    };
53
54
1
    if (!call_on_index_and_data_type<void>(from_type->get_primitive_type(),
55
1
                                           make_datelike_wrapper)) {
56
0
        return create_unsupport_wrapper(fmt::format(
57
0
                "CAST AS {} not supported {}", ToDataType {}.get_name(), from_type->get_name()));
58
0
    }
59
60
1
    return [cast_to_datelike](FunctionContext* context, Block& block,
61
1
                              const ColumnNumbers& arguments, const uint32_t result,
62
1
                              size_t input_rows_count,
63
1
                              const NullMap::value_type* null_map = nullptr) {
64
1
        return cast_to_datelike->execute_impl(context, block, arguments, result, input_rows_count,
65
1
                                              null_map);
66
1
    };
67
1
}
Unexecuted instantiation: _ZN5doris11CastWrapper23create_datelike_wrapperINS_16DataTypeDateTimeEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEE
_ZN5doris11CastWrapper23create_datelike_wrapperINS_14DataTypeDateV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEE
Line
Count
Source
27
72
WrapperType create_datelike_wrapper(FunctionContext* context, const DataTypePtr& from_type) {
28
72
    std::shared_ptr<CastToBase> cast_to_datelike;
29
30
72
    auto make_datelike_wrapper = [&](const auto& types) -> bool {
31
72
        using Types = std::decay_t<decltype(types)>;
32
72
        using FromDataType = typename Types::LeftType;
33
72
        constexpr bool is_nano_source = std::is_same_v<FromDataType, DataTypeDateTimeV2Nano>;
34
72
        constexpr bool is_nano_target = std::is_same_v<ToDataType, DataTypeDateTimeV2Nano>;
35
72
        constexpr bool is_supported_nano_cast = is_nano_target && IsStringType<FromDataType>;
36
72
        constexpr bool is_supported_legacy_cast =
37
72
                !is_nano_source && !is_nano_target &&
38
72
                (CastUtil::IsPureDigitType<FromDataType> || IsDatelikeTypes<FromDataType> ||
39
72
                 IsStringType<FromDataType> || std::is_same_v<FromDataType, DataTypeTimeStampTz>);
40
72
        if constexpr (is_supported_nano_cast || is_supported_legacy_cast) {
41
72
            if (context->enable_strict_mode()) {
42
72
                cast_to_datelike = std::make_shared<
43
72
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
44
72
            } else {
45
72
                cast_to_datelike = std::make_shared<
46
72
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
47
72
            }
48
72
            return true;
49
72
        } else {
50
72
            return false;
51
72
        }
52
72
    };
53
54
72
    if (!call_on_index_and_data_type<void>(from_type->get_primitive_type(),
55
72
                                           make_datelike_wrapper)) {
56
0
        return create_unsupport_wrapper(fmt::format(
57
0
                "CAST AS {} not supported {}", ToDataType {}.get_name(), from_type->get_name()));
58
0
    }
59
60
72
    return [cast_to_datelike](FunctionContext* context, Block& block,
61
72
                              const ColumnNumbers& arguments, const uint32_t result,
62
72
                              size_t input_rows_count,
63
72
                              const NullMap::value_type* null_map = nullptr) {
64
72
        return cast_to_datelike->execute_impl(context, block, arguments, result, input_rows_count,
65
72
                                              null_map);
66
72
    };
67
72
}
_ZN5doris11CastWrapper23create_datelike_wrapperINS_18DataTypeDateTimeV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEE
Line
Count
Source
27
74
WrapperType create_datelike_wrapper(FunctionContext* context, const DataTypePtr& from_type) {
28
74
    std::shared_ptr<CastToBase> cast_to_datelike;
29
30
74
    auto make_datelike_wrapper = [&](const auto& types) -> bool {
31
74
        using Types = std::decay_t<decltype(types)>;
32
74
        using FromDataType = typename Types::LeftType;
33
74
        constexpr bool is_nano_source = std::is_same_v<FromDataType, DataTypeDateTimeV2Nano>;
34
74
        constexpr bool is_nano_target = std::is_same_v<ToDataType, DataTypeDateTimeV2Nano>;
35
74
        constexpr bool is_supported_nano_cast = is_nano_target && IsStringType<FromDataType>;
36
74
        constexpr bool is_supported_legacy_cast =
37
74
                !is_nano_source && !is_nano_target &&
38
74
                (CastUtil::IsPureDigitType<FromDataType> || IsDatelikeTypes<FromDataType> ||
39
74
                 IsStringType<FromDataType> || std::is_same_v<FromDataType, DataTypeTimeStampTz>);
40
74
        if constexpr (is_supported_nano_cast || is_supported_legacy_cast) {
41
74
            if (context->enable_strict_mode()) {
42
74
                cast_to_datelike = std::make_shared<
43
74
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
44
74
            } else {
45
74
                cast_to_datelike = std::make_shared<
46
74
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
47
74
            }
48
74
            return true;
49
74
        } else {
50
74
            return false;
51
74
        }
52
74
    };
53
54
74
    if (!call_on_index_and_data_type<void>(from_type->get_primitive_type(),
55
74
                                           make_datelike_wrapper)) {
56
0
        return create_unsupport_wrapper(fmt::format(
57
0
                "CAST AS {} not supported {}", ToDataType {}.get_name(), from_type->get_name()));
58
0
    }
59
60
74
    return [cast_to_datelike](FunctionContext* context, Block& block,
61
74
                              const ColumnNumbers& arguments, const uint32_t result,
62
74
                              size_t input_rows_count,
63
74
                              const NullMap::value_type* null_map = nullptr) {
64
74
        return cast_to_datelike->execute_impl(context, block, arguments, result, input_rows_count,
65
74
                                              null_map);
66
74
    };
67
74
}
Unexecuted instantiation: _ZN5doris11CastWrapper23create_datelike_wrapperINS_22DataTypeDateTimeV2NanoEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEE
_ZN5doris11CastWrapper23create_datelike_wrapperINS_14DataTypeTimeV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEE
Line
Count
Source
27
16
WrapperType create_datelike_wrapper(FunctionContext* context, const DataTypePtr& from_type) {
28
16
    std::shared_ptr<CastToBase> cast_to_datelike;
29
30
16
    auto make_datelike_wrapper = [&](const auto& types) -> bool {
31
16
        using Types = std::decay_t<decltype(types)>;
32
16
        using FromDataType = typename Types::LeftType;
33
16
        constexpr bool is_nano_source = std::is_same_v<FromDataType, DataTypeDateTimeV2Nano>;
34
16
        constexpr bool is_nano_target = std::is_same_v<ToDataType, DataTypeDateTimeV2Nano>;
35
16
        constexpr bool is_supported_nano_cast = is_nano_target && IsStringType<FromDataType>;
36
16
        constexpr bool is_supported_legacy_cast =
37
16
                !is_nano_source && !is_nano_target &&
38
16
                (CastUtil::IsPureDigitType<FromDataType> || IsDatelikeTypes<FromDataType> ||
39
16
                 IsStringType<FromDataType> || std::is_same_v<FromDataType, DataTypeTimeStampTz>);
40
16
        if constexpr (is_supported_nano_cast || is_supported_legacy_cast) {
41
16
            if (context->enable_strict_mode()) {
42
16
                cast_to_datelike = std::make_shared<
43
16
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
44
16
            } else {
45
16
                cast_to_datelike = std::make_shared<
46
16
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
47
16
            }
48
16
            return true;
49
16
        } else {
50
16
            return false;
51
16
        }
52
16
    };
53
54
16
    if (!call_on_index_and_data_type<void>(from_type->get_primitive_type(),
55
16
                                           make_datelike_wrapper)) {
56
0
        return create_unsupport_wrapper(fmt::format(
57
0
                "CAST AS {} not supported {}", ToDataType {}.get_name(), from_type->get_name()));
58
0
    }
59
60
16
    return [cast_to_datelike](FunctionContext* context, Block& block,
61
16
                              const ColumnNumbers& arguments, const uint32_t result,
62
16
                              size_t input_rows_count,
63
16
                              const NullMap::value_type* null_map = nullptr) {
64
16
        return cast_to_datelike->execute_impl(context, block, arguments, result, input_rows_count,
65
16
                                              null_map);
66
16
    };
67
16
}
68
69
WrapperType create_datelike_wrapper(FunctionContext* context, const DataTypePtr& from_type,
70
163
                                    PrimitiveType to_type) {
71
163
    switch (to_type) {
72
1
    case TYPE_DATE:
73
1
        return create_datelike_wrapper<DataTypeDate>(context, from_type);
74
0
    case TYPE_DATETIME:
75
0
        return create_datelike_wrapper<DataTypeDateTime>(context, from_type);
76
72
    case TYPE_DATEV2:
77
72
        return create_datelike_wrapper<DataTypeDateV2>(context, from_type);
78
74
    case TYPE_DATETIMEV2:
79
74
        return create_datelike_wrapper<DataTypeDateTimeV2>(context, from_type);
80
0
    case TYPE_DATETIMEV2_NANO:
81
0
        return create_datelike_wrapper<DataTypeDateTimeV2Nano>(context, from_type);
82
16
    case TYPE_TIMEV2:
83
16
        return create_datelike_wrapper<DataTypeTimeV2>(context, from_type);
84
0
    default:
85
0
        return create_unsupport_wrapper(
86
0
                fmt::format("CAST AS date: unsupported to_type {}", type_to_string(to_type)));
87
163
    }
88
163
}
89
90
} // namespace doris::CastWrapper