Coverage Report

Created: 2026-07-07 22:17

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
324
WrapperType create_datelike_wrapper(FunctionContext* context, const DataTypePtr& from_type) {
28
324
    std::shared_ptr<CastToBase> cast_to_datelike;
29
30
324
    auto make_datelike_wrapper = [&](const auto& types) -> bool {
31
324
        using Types = std::decay_t<decltype(types)>;
32
324
        using FromDataType = typename Types::LeftType;
33
        if constexpr (CastUtil::IsPureDigitType<FromDataType> || IsDatelikeTypes<FromDataType> ||
34
                      IsStringType<FromDataType> ||
35
324
                      std::is_same_v<FromDataType, DataTypeTimeStampTz>) {
36
324
            if (context->enable_strict_mode()) {
37
258
                cast_to_datelike = std::make_shared<
38
258
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
39
258
            } else {
40
66
                cast_to_datelike = std::make_shared<
41
66
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
42
66
            }
43
324
            return true;
44
324
        } else {
45
0
            return false;
46
0
        }
47
324
    };
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_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
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
        if constexpr (CastUtil::IsPureDigitType<FromDataType> || IsDatelikeTypes<FromDataType> ||
34
                      IsStringType<FromDataType> ||
35
2
                      std::is_same_v<FromDataType, DataTypeTimeStampTz>) {
36
2
            if (context->enable_strict_mode()) {
37
2
                cast_to_datelike = std::make_shared<
38
2
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
39
2
            } else {
40
0
                cast_to_datelike = std::make_shared<
41
0
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
42
0
            }
43
2
            return true;
44
        } else {
45
            return false;
46
        }
47
2
    };
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_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
14
    auto make_datelike_wrapper = [&](const auto& types) -> bool {
31
14
        using Types = std::decay_t<decltype(types)>;
32
14
        using FromDataType = typename Types::LeftType;
33
        if constexpr (CastUtil::IsPureDigitType<FromDataType> || IsDatelikeTypes<FromDataType> ||
34
                      IsStringType<FromDataType> ||
35
14
                      std::is_same_v<FromDataType, DataTypeTimeStampTz>) {
36
14
            if (context->enable_strict_mode()) {
37
10
                cast_to_datelike = std::make_shared<
38
10
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
39
10
            } else {
40
4
                cast_to_datelike = std::make_shared<
41
4
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
42
4
            }
43
14
            return true;
44
        } else {
45
            return false;
46
        }
47
14
    };
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
14
    auto make_datelike_wrapper = [&](const auto& types) -> bool {
31
14
        using Types = std::decay_t<decltype(types)>;
32
14
        using FromDataType = typename Types::LeftType;
33
        if constexpr (CastUtil::IsPureDigitType<FromDataType> || IsDatelikeTypes<FromDataType> ||
34
                      IsStringType<FromDataType> ||
35
14
                      std::is_same_v<FromDataType, DataTypeTimeStampTz>) {
36
14
            if (context->enable_strict_mode()) {
37
10
                cast_to_datelike = std::make_shared<
38
10
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
39
10
            } else {
40
4
                cast_to_datelike = std::make_shared<
41
4
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
42
4
            }
43
14
            return true;
44
        } else {
45
            return false;
46
        }
47
14
    };
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
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
        if constexpr (CastUtil::IsPureDigitType<FromDataType> || IsDatelikeTypes<FromDataType> ||
34
                      IsStringType<FromDataType> ||
35
4
                      std::is_same_v<FromDataType, DataTypeTimeStampTz>) {
36
4
            if (context->enable_strict_mode()) {
37
0
                cast_to_datelike = std::make_shared<
38
0
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
39
4
            } else {
40
4
                cast_to_datelike = std::make_shared<
41
4
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
42
4
            }
43
4
            return true;
44
        } else {
45
            return false;
46
        }
47
4
    };
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
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
        if constexpr (CastUtil::IsPureDigitType<FromDataType> || IsDatelikeTypes<FromDataType> ||
34
                      IsStringType<FromDataType> ||
35
4
                      std::is_same_v<FromDataType, DataTypeTimeStampTz>) {
36
4
            if (context->enable_strict_mode()) {
37
0
                cast_to_datelike = std::make_shared<
38
0
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
39
4
            } else {
40
4
                cast_to_datelike = std::make_shared<
41
4
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
42
4
            }
43
4
            return true;
44
        } else {
45
            return false;
46
        }
47
4
    };
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
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
        if constexpr (CastUtil::IsPureDigitType<FromDataType> || IsDatelikeTypes<FromDataType> ||
34
                      IsStringType<FromDataType> ||
35
4
                      std::is_same_v<FromDataType, DataTypeTimeStampTz>) {
36
4
            if (context->enable_strict_mode()) {
37
0
                cast_to_datelike = std::make_shared<
38
0
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
39
4
            } else {
40
4
                cast_to_datelike = std::make_shared<
41
4
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
42
4
            }
43
4
            return true;
44
        } else {
45
            return false;
46
        }
47
4
    };
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
104
    auto make_datelike_wrapper = [&](const auto& types) -> bool {
31
104
        using Types = std::decay_t<decltype(types)>;
32
104
        using FromDataType = typename Types::LeftType;
33
        if constexpr (CastUtil::IsPureDigitType<FromDataType> || IsDatelikeTypes<FromDataType> ||
34
                      IsStringType<FromDataType> ||
35
104
                      std::is_same_v<FromDataType, DataTypeTimeStampTz>) {
36
104
            if (context->enable_strict_mode()) {
37
96
                cast_to_datelike = std::make_shared<
38
96
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
39
96
            } else {
40
8
                cast_to_datelike = std::make_shared<
41
8
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
42
8
            }
43
104
            return true;
44
        } else {
45
            return false;
46
        }
47
104
    };
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
14
    auto make_datelike_wrapper = [&](const auto& types) -> bool {
31
14
        using Types = std::decay_t<decltype(types)>;
32
14
        using FromDataType = typename Types::LeftType;
33
        if constexpr (CastUtil::IsPureDigitType<FromDataType> || IsDatelikeTypes<FromDataType> ||
34
                      IsStringType<FromDataType> ||
35
14
                      std::is_same_v<FromDataType, DataTypeTimeStampTz>) {
36
14
            if (context->enable_strict_mode()) {
37
10
                cast_to_datelike = std::make_shared<
38
10
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
39
10
            } else {
40
4
                cast_to_datelike = std::make_shared<
41
4
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
42
4
            }
43
14
            return true;
44
        } else {
45
            return false;
46
        }
47
14
    };
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
14
    auto make_datelike_wrapper = [&](const auto& types) -> bool {
31
14
        using Types = std::decay_t<decltype(types)>;
32
14
        using FromDataType = typename Types::LeftType;
33
        if constexpr (CastUtil::IsPureDigitType<FromDataType> || IsDatelikeTypes<FromDataType> ||
34
                      IsStringType<FromDataType> ||
35
14
                      std::is_same_v<FromDataType, DataTypeTimeStampTz>) {
36
14
            if (context->enable_strict_mode()) {
37
10
                cast_to_datelike = std::make_shared<
38
10
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
39
10
            } else {
40
4
                cast_to_datelike = std::make_shared<
41
4
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
42
4
            }
43
14
            return true;
44
        } else {
45
            return false;
46
        }
47
14
    };
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
8
    auto make_datelike_wrapper = [&](const auto& types) -> bool {
31
8
        using Types = std::decay_t<decltype(types)>;
32
8
        using FromDataType = typename Types::LeftType;
33
        if constexpr (CastUtil::IsPureDigitType<FromDataType> || IsDatelikeTypes<FromDataType> ||
34
                      IsStringType<FromDataType> ||
35
8
                      std::is_same_v<FromDataType, DataTypeTimeStampTz>) {
36
8
            if (context->enable_strict_mode()) {
37
2
                cast_to_datelike = std::make_shared<
38
2
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
39
6
            } else {
40
6
                cast_to_datelike = std::make_shared<
41
6
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
42
6
            }
43
8
            return true;
44
        } else {
45
            return false;
46
        }
47
8
    };
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
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
        if constexpr (CastUtil::IsPureDigitType<FromDataType> || IsDatelikeTypes<FromDataType> ||
34
                      IsStringType<FromDataType> ||
35
4
                      std::is_same_v<FromDataType, DataTypeTimeStampTz>) {
36
4
            if (context->enable_strict_mode()) {
37
0
                cast_to_datelike = std::make_shared<
38
0
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
39
4
            } else {
40
4
                cast_to_datelike = std::make_shared<
41
4
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
42
4
            }
43
4
            return true;
44
        } else {
45
            return false;
46
        }
47
4
    };
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_16DataTypeDateTimeEvEEEEbSQ_
_ZZN5doris11CastWrapper23create_datelike_wrapperINS_18DataTypeDateTimeV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_14DataTypeTimeV2EvEEEEbSQ_
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
        if constexpr (CastUtil::IsPureDigitType<FromDataType> || IsDatelikeTypes<FromDataType> ||
34
                      IsStringType<FromDataType> ||
35
4
                      std::is_same_v<FromDataType, DataTypeTimeStampTz>) {
36
4
            if (context->enable_strict_mode()) {
37
0
                cast_to_datelike = std::make_shared<
38
0
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
39
4
            } else {
40
4
                cast_to_datelike = std::make_shared<
41
4
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
42
4
            }
43
4
            return true;
44
        } else {
45
            return false;
46
        }
47
4
    };
Unexecuted instantiation: _ZZN5doris11CastWrapper23create_datelike_wrapperINS_18DataTypeDateTimeV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_19DataTypeTimeStampTzEvEEEEbSQ_
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
102
    auto make_datelike_wrapper = [&](const auto& types) -> bool {
31
102
        using Types = std::decay_t<decltype(types)>;
32
102
        using FromDataType = typename Types::LeftType;
33
        if constexpr (CastUtil::IsPureDigitType<FromDataType> || IsDatelikeTypes<FromDataType> ||
34
                      IsStringType<FromDataType> ||
35
102
                      std::is_same_v<FromDataType, DataTypeTimeStampTz>) {
36
102
            if (context->enable_strict_mode()) {
37
96
                cast_to_datelike = std::make_shared<
38
96
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
39
96
            } else {
40
6
                cast_to_datelike = std::make_shared<
41
6
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
42
6
            }
43
102
            return true;
44
        } else {
45
            return false;
46
        }
47
102
    };
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
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
        if constexpr (CastUtil::IsPureDigitType<FromDataType> || IsDatelikeTypes<FromDataType> ||
34
                      IsStringType<FromDataType> ||
35
2
                      std::is_same_v<FromDataType, DataTypeTimeStampTz>) {
36
2
            if (context->enable_strict_mode()) {
37
0
                cast_to_datelike = std::make_shared<
38
0
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
39
2
            } else {
40
2
                cast_to_datelike = std::make_shared<
41
2
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
42
2
            }
43
2
            return true;
44
        } else {
45
            return false;
46
        }
47
2
    };
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
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
        if constexpr (CastUtil::IsPureDigitType<FromDataType> || IsDatelikeTypes<FromDataType> ||
34
                      IsStringType<FromDataType> ||
35
2
                      std::is_same_v<FromDataType, DataTypeTimeStampTz>) {
36
2
            if (context->enable_strict_mode()) {
37
0
                cast_to_datelike = std::make_shared<
38
0
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
39
2
            } else {
40
2
                cast_to_datelike = std::make_shared<
41
2
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
42
2
            }
43
2
            return true;
44
        } else {
45
            return false;
46
        }
47
2
    };
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
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
        if constexpr (CastUtil::IsPureDigitType<FromDataType> || IsDatelikeTypes<FromDataType> ||
34
                      IsStringType<FromDataType> ||
35
2
                      std::is_same_v<FromDataType, DataTypeTimeStampTz>) {
36
2
            if (context->enable_strict_mode()) {
37
0
                cast_to_datelike = std::make_shared<
38
0
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
39
2
            } else {
40
2
                cast_to_datelike = std::make_shared<
41
2
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
42
2
            }
43
2
            return true;
44
        } else {
45
            return false;
46
        }
47
2
    };
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
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
        if constexpr (CastUtil::IsPureDigitType<FromDataType> || IsDatelikeTypes<FromDataType> ||
34
                      IsStringType<FromDataType> ||
35
2
                      std::is_same_v<FromDataType, DataTypeTimeStampTz>) {
36
2
            if (context->enable_strict_mode()) {
37
0
                cast_to_datelike = std::make_shared<
38
0
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
39
2
            } else {
40
2
                cast_to_datelike = std::make_shared<
41
2
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
42
2
            }
43
2
            return true;
44
        } else {
45
            return false;
46
        }
47
2
    };
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
24
    auto make_datelike_wrapper = [&](const auto& types) -> bool {
31
24
        using Types = std::decay_t<decltype(types)>;
32
24
        using FromDataType = typename Types::LeftType;
33
        if constexpr (CastUtil::IsPureDigitType<FromDataType> || IsDatelikeTypes<FromDataType> ||
34
                      IsStringType<FromDataType> ||
35
24
                      std::is_same_v<FromDataType, DataTypeTimeStampTz>) {
36
24
            if (context->enable_strict_mode()) {
37
22
                cast_to_datelike = std::make_shared<
38
22
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
39
22
            } else {
40
2
                cast_to_datelike = std::make_shared<
41
2
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
42
2
            }
43
24
            return true;
44
        } else {
45
            return false;
46
        }
47
24
    };
48
49
324
    if (!call_on_index_and_data_type<void>(from_type->get_primitive_type(),
50
324
                                           make_datelike_wrapper)) {
51
0
        return create_unsupport_wrapper(fmt::format(
52
0
                "CAST AS {} not supported {}", ToDataType {}.get_name(), from_type->get_name()));
53
0
    }
54
55
324
    return [cast_to_datelike](FunctionContext* context, Block& block,
56
324
                              const ColumnNumbers& arguments, const uint32_t result,
57
324
                              size_t input_rows_count,
58
324
                              const NullMap::value_type* null_map = nullptr) {
59
324
        return cast_to_datelike->execute_impl(context, block, arguments, result, input_rows_count,
60
324
                                              null_map);
61
324
    };
_ZZN5doris11CastWrapper23create_datelike_wrapperINS_12DataTypeDateEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlS6_S8_SD_jmSF_E_clES6_S8_SD_jmSF_
Line
Count
Source
58
2
                              const NullMap::value_type* null_map = nullptr) {
59
2
        return cast_to_datelike->execute_impl(context, block, arguments, result, input_rows_count,
60
2
                                              null_map);
61
2
    };
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
58
144
                              const NullMap::value_type* null_map = nullptr) {
59
144
        return cast_to_datelike->execute_impl(context, block, arguments, result, input_rows_count,
60
144
                                              null_map);
61
144
    };
_ZZN5doris11CastWrapper23create_datelike_wrapperINS_18DataTypeDateTimeV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlS6_S8_SD_jmSF_E_clES6_S8_SD_jmSF_
Line
Count
Source
58
146
                              const NullMap::value_type* null_map = nullptr) {
59
146
        return cast_to_datelike->execute_impl(context, block, arguments, result, input_rows_count,
60
146
                                              null_map);
61
146
    };
_ZZN5doris11CastWrapper23create_datelike_wrapperINS_14DataTypeTimeV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlS6_S8_SD_jmSF_E_clES6_S8_SD_jmSF_
Line
Count
Source
58
32
                              const NullMap::value_type* null_map = nullptr) {
59
32
        return cast_to_datelike->execute_impl(context, block, arguments, result, input_rows_count,
60
32
                                              null_map);
61
32
    };
62
324
}
_ZN5doris11CastWrapper23create_datelike_wrapperINS_12DataTypeDateEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEE
Line
Count
Source
27
2
WrapperType create_datelike_wrapper(FunctionContext* context, const DataTypePtr& from_type) {
28
2
    std::shared_ptr<CastToBase> cast_to_datelike;
29
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
        if constexpr (CastUtil::IsPureDigitType<FromDataType> || IsDatelikeTypes<FromDataType> ||
34
2
                      IsStringType<FromDataType> ||
35
2
                      std::is_same_v<FromDataType, DataTypeTimeStampTz>) {
36
2
            if (context->enable_strict_mode()) {
37
2
                cast_to_datelike = std::make_shared<
38
2
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
39
2
            } else {
40
2
                cast_to_datelike = std::make_shared<
41
2
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
42
2
            }
43
2
            return true;
44
2
        } else {
45
2
            return false;
46
2
        }
47
2
    };
48
49
2
    if (!call_on_index_and_data_type<void>(from_type->get_primitive_type(),
50
2
                                           make_datelike_wrapper)) {
51
0
        return create_unsupport_wrapper(fmt::format(
52
0
                "CAST AS {} not supported {}", ToDataType {}.get_name(), from_type->get_name()));
53
0
    }
54
55
2
    return [cast_to_datelike](FunctionContext* context, Block& block,
56
2
                              const ColumnNumbers& arguments, const uint32_t result,
57
2
                              size_t input_rows_count,
58
2
                              const NullMap::value_type* null_map = nullptr) {
59
2
        return cast_to_datelike->execute_impl(context, block, arguments, result, input_rows_count,
60
2
                                              null_map);
61
2
    };
62
2
}
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
144
WrapperType create_datelike_wrapper(FunctionContext* context, const DataTypePtr& from_type) {
28
144
    std::shared_ptr<CastToBase> cast_to_datelike;
29
30
144
    auto make_datelike_wrapper = [&](const auto& types) -> bool {
31
144
        using Types = std::decay_t<decltype(types)>;
32
144
        using FromDataType = typename Types::LeftType;
33
144
        if constexpr (CastUtil::IsPureDigitType<FromDataType> || IsDatelikeTypes<FromDataType> ||
34
144
                      IsStringType<FromDataType> ||
35
144
                      std::is_same_v<FromDataType, DataTypeTimeStampTz>) {
36
144
            if (context->enable_strict_mode()) {
37
144
                cast_to_datelike = std::make_shared<
38
144
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
39
144
            } else {
40
144
                cast_to_datelike = std::make_shared<
41
144
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
42
144
            }
43
144
            return true;
44
144
        } else {
45
144
            return false;
46
144
        }
47
144
    };
48
49
144
    if (!call_on_index_and_data_type<void>(from_type->get_primitive_type(),
50
144
                                           make_datelike_wrapper)) {
51
0
        return create_unsupport_wrapper(fmt::format(
52
0
                "CAST AS {} not supported {}", ToDataType {}.get_name(), from_type->get_name()));
53
0
    }
54
55
144
    return [cast_to_datelike](FunctionContext* context, Block& block,
56
144
                              const ColumnNumbers& arguments, const uint32_t result,
57
144
                              size_t input_rows_count,
58
144
                              const NullMap::value_type* null_map = nullptr) {
59
144
        return cast_to_datelike->execute_impl(context, block, arguments, result, input_rows_count,
60
144
                                              null_map);
61
144
    };
62
144
}
_ZN5doris11CastWrapper23create_datelike_wrapperINS_18DataTypeDateTimeV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEE
Line
Count
Source
27
146
WrapperType create_datelike_wrapper(FunctionContext* context, const DataTypePtr& from_type) {
28
146
    std::shared_ptr<CastToBase> cast_to_datelike;
29
30
146
    auto make_datelike_wrapper = [&](const auto& types) -> bool {
31
146
        using Types = std::decay_t<decltype(types)>;
32
146
        using FromDataType = typename Types::LeftType;
33
146
        if constexpr (CastUtil::IsPureDigitType<FromDataType> || IsDatelikeTypes<FromDataType> ||
34
146
                      IsStringType<FromDataType> ||
35
146
                      std::is_same_v<FromDataType, DataTypeTimeStampTz>) {
36
146
            if (context->enable_strict_mode()) {
37
146
                cast_to_datelike = std::make_shared<
38
146
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
39
146
            } else {
40
146
                cast_to_datelike = std::make_shared<
41
146
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
42
146
            }
43
146
            return true;
44
146
        } else {
45
146
            return false;
46
146
        }
47
146
    };
48
49
146
    if (!call_on_index_and_data_type<void>(from_type->get_primitive_type(),
50
146
                                           make_datelike_wrapper)) {
51
0
        return create_unsupport_wrapper(fmt::format(
52
0
                "CAST AS {} not supported {}", ToDataType {}.get_name(), from_type->get_name()));
53
0
    }
54
55
146
    return [cast_to_datelike](FunctionContext* context, Block& block,
56
146
                              const ColumnNumbers& arguments, const uint32_t result,
57
146
                              size_t input_rows_count,
58
146
                              const NullMap::value_type* null_map = nullptr) {
59
146
        return cast_to_datelike->execute_impl(context, block, arguments, result, input_rows_count,
60
146
                                              null_map);
61
146
    };
62
146
}
_ZN5doris11CastWrapper23create_datelike_wrapperINS_14DataTypeTimeV2EEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES6_RKSt10shared_ptrIKNS_9IDataTypeEE
Line
Count
Source
27
32
WrapperType create_datelike_wrapper(FunctionContext* context, const DataTypePtr& from_type) {
28
32
    std::shared_ptr<CastToBase> cast_to_datelike;
29
30
32
    auto make_datelike_wrapper = [&](const auto& types) -> bool {
31
32
        using Types = std::decay_t<decltype(types)>;
32
32
        using FromDataType = typename Types::LeftType;
33
32
        if constexpr (CastUtil::IsPureDigitType<FromDataType> || IsDatelikeTypes<FromDataType> ||
34
32
                      IsStringType<FromDataType> ||
35
32
                      std::is_same_v<FromDataType, DataTypeTimeStampTz>) {
36
32
            if (context->enable_strict_mode()) {
37
32
                cast_to_datelike = std::make_shared<
38
32
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
39
32
            } else {
40
32
                cast_to_datelike = std::make_shared<
41
32
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
42
32
            }
43
32
            return true;
44
32
        } else {
45
32
            return false;
46
32
        }
47
32
    };
48
49
32
    if (!call_on_index_and_data_type<void>(from_type->get_primitive_type(),
50
32
                                           make_datelike_wrapper)) {
51
0
        return create_unsupport_wrapper(fmt::format(
52
0
                "CAST AS {} not supported {}", ToDataType {}.get_name(), from_type->get_name()));
53
0
    }
54
55
32
    return [cast_to_datelike](FunctionContext* context, Block& block,
56
32
                              const ColumnNumbers& arguments, const uint32_t result,
57
32
                              size_t input_rows_count,
58
32
                              const NullMap::value_type* null_map = nullptr) {
59
32
        return cast_to_datelike->execute_impl(context, block, arguments, result, input_rows_count,
60
32
                                              null_map);
61
32
    };
62
32
}
63
64
WrapperType create_datelike_wrapper(FunctionContext* context, const DataTypePtr& from_type,
65
324
                                    PrimitiveType to_type) {
66
324
    switch (to_type) {
67
2
    case TYPE_DATE:
68
2
        return create_datelike_wrapper<DataTypeDate>(context, from_type);
69
0
    case TYPE_DATETIME:
70
0
        return create_datelike_wrapper<DataTypeDateTime>(context, from_type);
71
144
    case TYPE_DATEV2:
72
144
        return create_datelike_wrapper<DataTypeDateV2>(context, from_type);
73
146
    case TYPE_DATETIMEV2:
74
146
        return create_datelike_wrapper<DataTypeDateTimeV2>(context, from_type);
75
32
    case TYPE_TIMEV2:
76
32
        return create_datelike_wrapper<DataTypeTimeV2>(context, from_type);
77
0
    default:
78
0
        return create_unsupport_wrapper(
79
0
                fmt::format("CAST AS date: unsupported to_type {}", type_to_string(to_type)));
80
324
    }
81
324
}
82
83
} // namespace doris::CastWrapper