Coverage Report

Created: 2026-03-16 19:13

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
be/src/exprs/function/cast/cast_to_float.h
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
#pragma once
19
20
#include <type_traits>
21
22
#include "core/data_type/data_type_decimal.h"
23
#include "core/data_type/data_type_number.h"
24
#include "core/data_type/primitive_type.h"
25
#include "exprs/function/cast/cast_to_basic_number_common.h"
26
27
namespace doris {
28
#include "common/compile_check_begin.h"
29
// cast bool, integer, float to double, will not overflow
30
template <CastModeType CastMode, typename FromDataType, typename ToDataType>
31
    requires(IsDataTypeFloat<ToDataType> && IsDataTypeNumber<FromDataType>)
32
class CastToImpl<CastMode, FromDataType, ToDataType> : public CastToBase {
33
public:
34
    Status execute_impl(FunctionContext* context, Block& block, const ColumnNumbers& arguments,
35
                        uint32_t result, size_t input_rows_count,
36
101
                        const NullMap::value_type* null_map = nullptr) const override {
37
101
        return static_cast_no_overflow<FromDataType, ToDataType>(context, block, arguments, result,
38
101
                                                                 input_rows_count);
39
101
    }
_ZNK5doris10CastToImplILNS_12CastModeTypeE0ENS_14DataTypeNumberILNS_13PrimitiveTypeE2EEENS2_ILS3_8EEEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKh
Line
Count
Source
36
1
                        const NullMap::value_type* null_map = nullptr) const override {
37
1
        return static_cast_no_overflow<FromDataType, ToDataType>(context, block, arguments, result,
38
1
                                                                 input_rows_count);
39
1
    }
_ZNK5doris10CastToImplILNS_12CastModeTypeE1ENS_14DataTypeNumberILNS_13PrimitiveTypeE2EEENS2_ILS3_8EEEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKh
Line
Count
Source
36
1
                        const NullMap::value_type* null_map = nullptr) const override {
37
1
        return static_cast_no_overflow<FromDataType, ToDataType>(context, block, arguments, result,
38
1
                                                                 input_rows_count);
39
1
    }
_ZNK5doris10CastToImplILNS_12CastModeTypeE0ENS_14DataTypeNumberILNS_13PrimitiveTypeE3EEENS2_ILS3_8EEEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKh
Line
Count
Source
36
1
                        const NullMap::value_type* null_map = nullptr) const override {
37
1
        return static_cast_no_overflow<FromDataType, ToDataType>(context, block, arguments, result,
38
1
                                                                 input_rows_count);
39
1
    }
_ZNK5doris10CastToImplILNS_12CastModeTypeE1ENS_14DataTypeNumberILNS_13PrimitiveTypeE3EEENS2_ILS3_8EEEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKh
Line
Count
Source
36
1
                        const NullMap::value_type* null_map = nullptr) const override {
37
1
        return static_cast_no_overflow<FromDataType, ToDataType>(context, block, arguments, result,
38
1
                                                                 input_rows_count);
39
1
    }
_ZNK5doris10CastToImplILNS_12CastModeTypeE0ENS_14DataTypeNumberILNS_13PrimitiveTypeE4EEENS2_ILS3_8EEEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKh
Line
Count
Source
36
1
                        const NullMap::value_type* null_map = nullptr) const override {
37
1
        return static_cast_no_overflow<FromDataType, ToDataType>(context, block, arguments, result,
38
1
                                                                 input_rows_count);
39
1
    }
_ZNK5doris10CastToImplILNS_12CastModeTypeE1ENS_14DataTypeNumberILNS_13PrimitiveTypeE4EEENS2_ILS3_8EEEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKh
Line
Count
Source
36
1
                        const NullMap::value_type* null_map = nullptr) const override {
37
1
        return static_cast_no_overflow<FromDataType, ToDataType>(context, block, arguments, result,
38
1
                                                                 input_rows_count);
39
1
    }
_ZNK5doris10CastToImplILNS_12CastModeTypeE0ENS_14DataTypeNumberILNS_13PrimitiveTypeE5EEENS2_ILS3_8EEEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKh
Line
Count
Source
36
1
                        const NullMap::value_type* null_map = nullptr) const override {
37
1
        return static_cast_no_overflow<FromDataType, ToDataType>(context, block, arguments, result,
38
1
                                                                 input_rows_count);
39
1
    }
_ZNK5doris10CastToImplILNS_12CastModeTypeE1ENS_14DataTypeNumberILNS_13PrimitiveTypeE5EEENS2_ILS3_8EEEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKh
Line
Count
Source
36
1
                        const NullMap::value_type* null_map = nullptr) const override {
37
1
        return static_cast_no_overflow<FromDataType, ToDataType>(context, block, arguments, result,
38
1
                                                                 input_rows_count);
39
1
    }
_ZNK5doris10CastToImplILNS_12CastModeTypeE0ENS_14DataTypeNumberILNS_13PrimitiveTypeE6EEENS2_ILS3_8EEEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKh
Line
Count
Source
36
1
                        const NullMap::value_type* null_map = nullptr) const override {
37
1
        return static_cast_no_overflow<FromDataType, ToDataType>(context, block, arguments, result,
38
1
                                                                 input_rows_count);
39
1
    }
_ZNK5doris10CastToImplILNS_12CastModeTypeE1ENS_14DataTypeNumberILNS_13PrimitiveTypeE6EEENS2_ILS3_8EEEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKh
Line
Count
Source
36
1
                        const NullMap::value_type* null_map = nullptr) const override {
37
1
        return static_cast_no_overflow<FromDataType, ToDataType>(context, block, arguments, result,
38
1
                                                                 input_rows_count);
39
1
    }
_ZNK5doris10CastToImplILNS_12CastModeTypeE0ENS_14DataTypeNumberILNS_13PrimitiveTypeE7EEENS2_ILS3_8EEEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKh
Line
Count
Source
36
1
                        const NullMap::value_type* null_map = nullptr) const override {
37
1
        return static_cast_no_overflow<FromDataType, ToDataType>(context, block, arguments, result,
38
1
                                                                 input_rows_count);
39
1
    }
_ZNK5doris10CastToImplILNS_12CastModeTypeE1ENS_14DataTypeNumberILNS_13PrimitiveTypeE7EEENS2_ILS3_8EEEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKh
Line
Count
Source
36
1
                        const NullMap::value_type* null_map = nullptr) const override {
37
1
        return static_cast_no_overflow<FromDataType, ToDataType>(context, block, arguments, result,
38
1
                                                                 input_rows_count);
39
1
    }
Unexecuted instantiation: _ZNK5doris10CastToImplILNS_12CastModeTypeE0ENS_14DataTypeNumberILNS_13PrimitiveTypeE8EEES4_E12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKh
Unexecuted instantiation: _ZNK5doris10CastToImplILNS_12CastModeTypeE1ENS_14DataTypeNumberILNS_13PrimitiveTypeE8EEES4_E12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKh
_ZNK5doris10CastToImplILNS_12CastModeTypeE0ENS_14DataTypeNumberILNS_13PrimitiveTypeE9EEENS2_ILS3_8EEEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKh
Line
Count
Source
36
1
                        const NullMap::value_type* null_map = nullptr) const override {
37
1
        return static_cast_no_overflow<FromDataType, ToDataType>(context, block, arguments, result,
38
1
                                                                 input_rows_count);
39
1
    }
_ZNK5doris10CastToImplILNS_12CastModeTypeE1ENS_14DataTypeNumberILNS_13PrimitiveTypeE9EEENS2_ILS3_8EEEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKh
Line
Count
Source
36
1
                        const NullMap::value_type* null_map = nullptr) const override {
37
1
        return static_cast_no_overflow<FromDataType, ToDataType>(context, block, arguments, result,
38
1
                                                                 input_rows_count);
39
1
    }
_ZNK5doris10CastToImplILNS_12CastModeTypeE0ENS_14DataTypeNumberILNS_13PrimitiveTypeE2EEENS2_ILS3_9EEEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKh
Line
Count
Source
36
1
                        const NullMap::value_type* null_map = nullptr) const override {
37
1
        return static_cast_no_overflow<FromDataType, ToDataType>(context, block, arguments, result,
38
1
                                                                 input_rows_count);
39
1
    }
_ZNK5doris10CastToImplILNS_12CastModeTypeE1ENS_14DataTypeNumberILNS_13PrimitiveTypeE2EEENS2_ILS3_9EEEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKh
Line
Count
Source
36
74
                        const NullMap::value_type* null_map = nullptr) const override {
37
74
        return static_cast_no_overflow<FromDataType, ToDataType>(context, block, arguments, result,
38
74
                                                                 input_rows_count);
39
74
    }
_ZNK5doris10CastToImplILNS_12CastModeTypeE0ENS_14DataTypeNumberILNS_13PrimitiveTypeE3EEENS2_ILS3_9EEEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKh
Line
Count
Source
36
1
                        const NullMap::value_type* null_map = nullptr) const override {
37
1
        return static_cast_no_overflow<FromDataType, ToDataType>(context, block, arguments, result,
38
1
                                                                 input_rows_count);
39
1
    }
_ZNK5doris10CastToImplILNS_12CastModeTypeE1ENS_14DataTypeNumberILNS_13PrimitiveTypeE3EEENS2_ILS3_9EEEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKh
Line
Count
Source
36
1
                        const NullMap::value_type* null_map = nullptr) const override {
37
1
        return static_cast_no_overflow<FromDataType, ToDataType>(context, block, arguments, result,
38
1
                                                                 input_rows_count);
39
1
    }
_ZNK5doris10CastToImplILNS_12CastModeTypeE0ENS_14DataTypeNumberILNS_13PrimitiveTypeE4EEENS2_ILS3_9EEEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKh
Line
Count
Source
36
1
                        const NullMap::value_type* null_map = nullptr) const override {
37
1
        return static_cast_no_overflow<FromDataType, ToDataType>(context, block, arguments, result,
38
1
                                                                 input_rows_count);
39
1
    }
_ZNK5doris10CastToImplILNS_12CastModeTypeE1ENS_14DataTypeNumberILNS_13PrimitiveTypeE4EEENS2_ILS3_9EEEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKh
Line
Count
Source
36
1
                        const NullMap::value_type* null_map = nullptr) const override {
37
1
        return static_cast_no_overflow<FromDataType, ToDataType>(context, block, arguments, result,
38
1
                                                                 input_rows_count);
39
1
    }
_ZNK5doris10CastToImplILNS_12CastModeTypeE0ENS_14DataTypeNumberILNS_13PrimitiveTypeE5EEENS2_ILS3_9EEEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKh
Line
Count
Source
36
1
                        const NullMap::value_type* null_map = nullptr) const override {
37
1
        return static_cast_no_overflow<FromDataType, ToDataType>(context, block, arguments, result,
38
1
                                                                 input_rows_count);
39
1
    }
_ZNK5doris10CastToImplILNS_12CastModeTypeE1ENS_14DataTypeNumberILNS_13PrimitiveTypeE5EEENS2_ILS3_9EEEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKh
Line
Count
Source
36
1
                        const NullMap::value_type* null_map = nullptr) const override {
37
1
        return static_cast_no_overflow<FromDataType, ToDataType>(context, block, arguments, result,
38
1
                                                                 input_rows_count);
39
1
    }
_ZNK5doris10CastToImplILNS_12CastModeTypeE0ENS_14DataTypeNumberILNS_13PrimitiveTypeE6EEENS2_ILS3_9EEEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKh
Line
Count
Source
36
1
                        const NullMap::value_type* null_map = nullptr) const override {
37
1
        return static_cast_no_overflow<FromDataType, ToDataType>(context, block, arguments, result,
38
1
                                                                 input_rows_count);
39
1
    }
_ZNK5doris10CastToImplILNS_12CastModeTypeE1ENS_14DataTypeNumberILNS_13PrimitiveTypeE6EEENS2_ILS3_9EEEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKh
Line
Count
Source
36
1
                        const NullMap::value_type* null_map = nullptr) const override {
37
1
        return static_cast_no_overflow<FromDataType, ToDataType>(context, block, arguments, result,
38
1
                                                                 input_rows_count);
39
1
    }
_ZNK5doris10CastToImplILNS_12CastModeTypeE0ENS_14DataTypeNumberILNS_13PrimitiveTypeE7EEENS2_ILS3_9EEEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKh
Line
Count
Source
36
1
                        const NullMap::value_type* null_map = nullptr) const override {
37
1
        return static_cast_no_overflow<FromDataType, ToDataType>(context, block, arguments, result,
38
1
                                                                 input_rows_count);
39
1
    }
_ZNK5doris10CastToImplILNS_12CastModeTypeE1ENS_14DataTypeNumberILNS_13PrimitiveTypeE7EEENS2_ILS3_9EEEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKh
Line
Count
Source
36
1
                        const NullMap::value_type* null_map = nullptr) const override {
37
1
        return static_cast_no_overflow<FromDataType, ToDataType>(context, block, arguments, result,
38
1
                                                                 input_rows_count);
39
1
    }
_ZNK5doris10CastToImplILNS_12CastModeTypeE0ENS_14DataTypeNumberILNS_13PrimitiveTypeE8EEENS2_ILS3_9EEEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKh
Line
Count
Source
36
1
                        const NullMap::value_type* null_map = nullptr) const override {
37
1
        return static_cast_no_overflow<FromDataType, ToDataType>(context, block, arguments, result,
38
1
                                                                 input_rows_count);
39
1
    }
_ZNK5doris10CastToImplILNS_12CastModeTypeE1ENS_14DataTypeNumberILNS_13PrimitiveTypeE8EEENS2_ILS3_9EEEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKh
Line
Count
Source
36
1
                        const NullMap::value_type* null_map = nullptr) const override {
37
1
        return static_cast_no_overflow<FromDataType, ToDataType>(context, block, arguments, result,
38
1
                                                                 input_rows_count);
39
1
    }
Unexecuted instantiation: _ZNK5doris10CastToImplILNS_12CastModeTypeE0ENS_14DataTypeNumberILNS_13PrimitiveTypeE9EEES4_E12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKh
Unexecuted instantiation: _ZNK5doris10CastToImplILNS_12CastModeTypeE1ENS_14DataTypeNumberILNS_13PrimitiveTypeE9EEES4_E12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKh
40
};
41
42
// cast decimal to float and double
43
template <CastModeType CastMode, typename FromDataType, typename ToDataType>
44
    requires(IsDataTypeFloat<ToDataType> && IsDataTypeDecimal<FromDataType>)
45
class CastToImpl<CastMode, FromDataType, ToDataType> : public CastToBase {
46
public:
47
    Status execute_impl(FunctionContext* context, Block& block, const ColumnNumbers& arguments,
48
                        uint32_t result, size_t input_rows_count,
49
182
                        const NullMap::value_type* null_map = nullptr) const override {
50
182
        using FromFieldType = typename FromDataType::FieldType;
51
182
        const ColumnWithTypeAndName& named_from = block.get_by_position(arguments[0]);
52
182
        const auto* col_from =
53
182
                check_and_get_column<typename FromDataType::ColumnType>(named_from.column.get());
54
182
        if (!col_from) {
55
0
            return Status::InternalError(fmt::format("Column type mismatch: expected {}, got {}",
56
0
                                                     type_to_string(FromDataType::PType),
57
0
                                                     named_from.column->get_name()));
58
0
        }
59
182
        const auto& from_decimal_type = assert_cast<const FromDataType&>(*named_from.type);
60
182
        UInt32 from_scale = from_decimal_type.get_scale();
61
62
182
        auto col_to = ToDataType::ColumnType::create(input_rows_count);
63
182
        const auto& vec_from = col_from->get_data();
64
182
        const auto* vec_from_data = vec_from.data();
65
182
        auto& vec_to = col_to->get_data();
66
182
        auto* vec_to_data = vec_to.data();
67
68
182
        CastParameters params;
69
182
        params.is_strict = (CastMode == CastModeType::StrictMode);
70
182
        size_t size = vec_from.size();
71
72
182
        typename FromFieldType::NativeType scale_multiplier =
73
182
                DataTypeDecimal<FromFieldType::PType>::get_scale_multiplier(from_scale);
74
8.33k
        for (size_t i = 0; i < size; ++i) {
75
8.14k
            CastToFloat::_from_decimalv3(vec_from_data[i], from_scale, vec_to_data[i],
76
8.14k
                                         scale_multiplier, params);
77
8.14k
        }
78
79
182
        block.get_by_position(result).column = std::move(col_to);
80
182
        return Status::OK();
81
182
    }
_ZNK5doris10CastToImplILNS_12CastModeTypeE0ENS_15DataTypeDecimalILNS_13PrimitiveTypeE28EEENS_14DataTypeNumberILS3_8EEEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKh
Line
Count
Source
49
7
                        const NullMap::value_type* null_map = nullptr) const override {
50
7
        using FromFieldType = typename FromDataType::FieldType;
51
7
        const ColumnWithTypeAndName& named_from = block.get_by_position(arguments[0]);
52
7
        const auto* col_from =
53
7
                check_and_get_column<typename FromDataType::ColumnType>(named_from.column.get());
54
7
        if (!col_from) {
55
0
            return Status::InternalError(fmt::format("Column type mismatch: expected {}, got {}",
56
0
                                                     type_to_string(FromDataType::PType),
57
0
                                                     named_from.column->get_name()));
58
0
        }
59
7
        const auto& from_decimal_type = assert_cast<const FromDataType&>(*named_from.type);
60
7
        UInt32 from_scale = from_decimal_type.get_scale();
61
62
7
        auto col_to = ToDataType::ColumnType::create(input_rows_count);
63
7
        const auto& vec_from = col_from->get_data();
64
7
        const auto* vec_from_data = vec_from.data();
65
7
        auto& vec_to = col_to->get_data();
66
7
        auto* vec_to_data = vec_to.data();
67
68
7
        CastParameters params;
69
7
        params.is_strict = (CastMode == CastModeType::StrictMode);
70
7
        size_t size = vec_from.size();
71
72
7
        typename FromFieldType::NativeType scale_multiplier =
73
7
                DataTypeDecimal<FromFieldType::PType>::get_scale_multiplier(from_scale);
74
311
        for (size_t i = 0; i < size; ++i) {
75
304
            CastToFloat::_from_decimalv3(vec_from_data[i], from_scale, vec_to_data[i],
76
304
                                         scale_multiplier, params);
77
304
        }
78
79
7
        block.get_by_position(result).column = std::move(col_to);
80
7
        return Status::OK();
81
7
    }
_ZNK5doris10CastToImplILNS_12CastModeTypeE1ENS_15DataTypeDecimalILNS_13PrimitiveTypeE28EEENS_14DataTypeNumberILS3_8EEEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKh
Line
Count
Source
49
7
                        const NullMap::value_type* null_map = nullptr) const override {
50
7
        using FromFieldType = typename FromDataType::FieldType;
51
7
        const ColumnWithTypeAndName& named_from = block.get_by_position(arguments[0]);
52
7
        const auto* col_from =
53
7
                check_and_get_column<typename FromDataType::ColumnType>(named_from.column.get());
54
7
        if (!col_from) {
55
0
            return Status::InternalError(fmt::format("Column type mismatch: expected {}, got {}",
56
0
                                                     type_to_string(FromDataType::PType),
57
0
                                                     named_from.column->get_name()));
58
0
        }
59
7
        const auto& from_decimal_type = assert_cast<const FromDataType&>(*named_from.type);
60
7
        UInt32 from_scale = from_decimal_type.get_scale();
61
62
7
        auto col_to = ToDataType::ColumnType::create(input_rows_count);
63
7
        const auto& vec_from = col_from->get_data();
64
7
        const auto* vec_from_data = vec_from.data();
65
7
        auto& vec_to = col_to->get_data();
66
7
        auto* vec_to_data = vec_to.data();
67
68
7
        CastParameters params;
69
7
        params.is_strict = (CastMode == CastModeType::StrictMode);
70
7
        size_t size = vec_from.size();
71
72
7
        typename FromFieldType::NativeType scale_multiplier =
73
7
                DataTypeDecimal<FromFieldType::PType>::get_scale_multiplier(from_scale);
74
311
        for (size_t i = 0; i < size; ++i) {
75
304
            CastToFloat::_from_decimalv3(vec_from_data[i], from_scale, vec_to_data[i],
76
304
                                         scale_multiplier, params);
77
304
        }
78
79
7
        block.get_by_position(result).column = std::move(col_to);
80
7
        return Status::OK();
81
7
    }
_ZNK5doris10CastToImplILNS_12CastModeTypeE0ENS_15DataTypeDecimalILNS_13PrimitiveTypeE29EEENS_14DataTypeNumberILS3_8EEEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKh
Line
Count
Source
49
9
                        const NullMap::value_type* null_map = nullptr) const override {
50
9
        using FromFieldType = typename FromDataType::FieldType;
51
9
        const ColumnWithTypeAndName& named_from = block.get_by_position(arguments[0]);
52
9
        const auto* col_from =
53
9
                check_and_get_column<typename FromDataType::ColumnType>(named_from.column.get());
54
9
        if (!col_from) {
55
0
            return Status::InternalError(fmt::format("Column type mismatch: expected {}, got {}",
56
0
                                                     type_to_string(FromDataType::PType),
57
0
                                                     named_from.column->get_name()));
58
0
        }
59
9
        const auto& from_decimal_type = assert_cast<const FromDataType&>(*named_from.type);
60
9
        UInt32 from_scale = from_decimal_type.get_scale();
61
62
9
        auto col_to = ToDataType::ColumnType::create(input_rows_count);
63
9
        const auto& vec_from = col_from->get_data();
64
9
        const auto* vec_from_data = vec_from.data();
65
9
        auto& vec_to = col_to->get_data();
66
9
        auto* vec_to_data = vec_to.data();
67
68
9
        CastParameters params;
69
9
        params.is_strict = (CastMode == CastModeType::StrictMode);
70
9
        size_t size = vec_from.size();
71
72
9
        typename FromFieldType::NativeType scale_multiplier =
73
9
                DataTypeDecimal<FromFieldType::PType>::get_scale_multiplier(from_scale);
74
521
        for (size_t i = 0; i < size; ++i) {
75
512
            CastToFloat::_from_decimalv3(vec_from_data[i], from_scale, vec_to_data[i],
76
512
                                         scale_multiplier, params);
77
512
        }
78
79
9
        block.get_by_position(result).column = std::move(col_to);
80
9
        return Status::OK();
81
9
    }
_ZNK5doris10CastToImplILNS_12CastModeTypeE1ENS_15DataTypeDecimalILNS_13PrimitiveTypeE29EEENS_14DataTypeNumberILS3_8EEEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKh
Line
Count
Source
49
9
                        const NullMap::value_type* null_map = nullptr) const override {
50
9
        using FromFieldType = typename FromDataType::FieldType;
51
9
        const ColumnWithTypeAndName& named_from = block.get_by_position(arguments[0]);
52
9
        const auto* col_from =
53
9
                check_and_get_column<typename FromDataType::ColumnType>(named_from.column.get());
54
9
        if (!col_from) {
55
0
            return Status::InternalError(fmt::format("Column type mismatch: expected {}, got {}",
56
0
                                                     type_to_string(FromDataType::PType),
57
0
                                                     named_from.column->get_name()));
58
0
        }
59
9
        const auto& from_decimal_type = assert_cast<const FromDataType&>(*named_from.type);
60
9
        UInt32 from_scale = from_decimal_type.get_scale();
61
62
9
        auto col_to = ToDataType::ColumnType::create(input_rows_count);
63
9
        const auto& vec_from = col_from->get_data();
64
9
        const auto* vec_from_data = vec_from.data();
65
9
        auto& vec_to = col_to->get_data();
66
9
        auto* vec_to_data = vec_to.data();
67
68
9
        CastParameters params;
69
9
        params.is_strict = (CastMode == CastModeType::StrictMode);
70
9
        size_t size = vec_from.size();
71
72
9
        typename FromFieldType::NativeType scale_multiplier =
73
9
                DataTypeDecimal<FromFieldType::PType>::get_scale_multiplier(from_scale);
74
521
        for (size_t i = 0; i < size; ++i) {
75
512
            CastToFloat::_from_decimalv3(vec_from_data[i], from_scale, vec_to_data[i],
76
512
                                         scale_multiplier, params);
77
512
        }
78
79
9
        block.get_by_position(result).column = std::move(col_to);
80
9
        return Status::OK();
81
9
    }
_ZNK5doris10CastToImplILNS_12CastModeTypeE0ENS_15DataTypeDecimalILNS_13PrimitiveTypeE20EEENS_14DataTypeNumberILS3_8EEEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKh
Line
Count
Source
49
7
                        const NullMap::value_type* null_map = nullptr) const override {
50
7
        using FromFieldType = typename FromDataType::FieldType;
51
7
        const ColumnWithTypeAndName& named_from = block.get_by_position(arguments[0]);
52
7
        const auto* col_from =
53
7
                check_and_get_column<typename FromDataType::ColumnType>(named_from.column.get());
54
7
        if (!col_from) {
55
0
            return Status::InternalError(fmt::format("Column type mismatch: expected {}, got {}",
56
0
                                                     type_to_string(FromDataType::PType),
57
0
                                                     named_from.column->get_name()));
58
0
        }
59
7
        const auto& from_decimal_type = assert_cast<const FromDataType&>(*named_from.type);
60
7
        UInt32 from_scale = from_decimal_type.get_scale();
61
62
7
        auto col_to = ToDataType::ColumnType::create(input_rows_count);
63
7
        const auto& vec_from = col_from->get_data();
64
7
        const auto* vec_from_data = vec_from.data();
65
7
        auto& vec_to = col_to->get_data();
66
7
        auto* vec_to_data = vec_to.data();
67
68
7
        CastParameters params;
69
7
        params.is_strict = (CastMode == CastModeType::StrictMode);
70
7
        size_t size = vec_from.size();
71
72
7
        typename FromFieldType::NativeType scale_multiplier =
73
7
                DataTypeDecimal<FromFieldType::PType>::get_scale_multiplier(from_scale);
74
129
        for (size_t i = 0; i < size; ++i) {
75
122
            CastToFloat::_from_decimalv3(vec_from_data[i], from_scale, vec_to_data[i],
76
122
                                         scale_multiplier, params);
77
122
        }
78
79
7
        block.get_by_position(result).column = std::move(col_to);
80
7
        return Status::OK();
81
7
    }
_ZNK5doris10CastToImplILNS_12CastModeTypeE1ENS_15DataTypeDecimalILNS_13PrimitiveTypeE20EEENS_14DataTypeNumberILS3_8EEEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKh
Line
Count
Source
49
7
                        const NullMap::value_type* null_map = nullptr) const override {
50
7
        using FromFieldType = typename FromDataType::FieldType;
51
7
        const ColumnWithTypeAndName& named_from = block.get_by_position(arguments[0]);
52
7
        const auto* col_from =
53
7
                check_and_get_column<typename FromDataType::ColumnType>(named_from.column.get());
54
7
        if (!col_from) {
55
0
            return Status::InternalError(fmt::format("Column type mismatch: expected {}, got {}",
56
0
                                                     type_to_string(FromDataType::PType),
57
0
                                                     named_from.column->get_name()));
58
0
        }
59
7
        const auto& from_decimal_type = assert_cast<const FromDataType&>(*named_from.type);
60
7
        UInt32 from_scale = from_decimal_type.get_scale();
61
62
7
        auto col_to = ToDataType::ColumnType::create(input_rows_count);
63
7
        const auto& vec_from = col_from->get_data();
64
7
        const auto* vec_from_data = vec_from.data();
65
7
        auto& vec_to = col_to->get_data();
66
7
        auto* vec_to_data = vec_to.data();
67
68
7
        CastParameters params;
69
7
        params.is_strict = (CastMode == CastModeType::StrictMode);
70
7
        size_t size = vec_from.size();
71
72
7
        typename FromFieldType::NativeType scale_multiplier =
73
7
                DataTypeDecimal<FromFieldType::PType>::get_scale_multiplier(from_scale);
74
129
        for (size_t i = 0; i < size; ++i) {
75
122
            CastToFloat::_from_decimalv3(vec_from_data[i], from_scale, vec_to_data[i],
76
122
                                         scale_multiplier, params);
77
122
        }
78
79
7
        block.get_by_position(result).column = std::move(col_to);
80
7
        return Status::OK();
81
7
    }
_ZNK5doris10CastToImplILNS_12CastModeTypeE0ENS_15DataTypeDecimalILNS_13PrimitiveTypeE30EEENS_14DataTypeNumberILS3_8EEEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKh
Line
Count
Source
49
9
                        const NullMap::value_type* null_map = nullptr) const override {
50
9
        using FromFieldType = typename FromDataType::FieldType;
51
9
        const ColumnWithTypeAndName& named_from = block.get_by_position(arguments[0]);
52
9
        const auto* col_from =
53
9
                check_and_get_column<typename FromDataType::ColumnType>(named_from.column.get());
54
9
        if (!col_from) {
55
0
            return Status::InternalError(fmt::format("Column type mismatch: expected {}, got {}",
56
0
                                                     type_to_string(FromDataType::PType),
57
0
                                                     named_from.column->get_name()));
58
0
        }
59
9
        const auto& from_decimal_type = assert_cast<const FromDataType&>(*named_from.type);
60
9
        UInt32 from_scale = from_decimal_type.get_scale();
61
62
9
        auto col_to = ToDataType::ColumnType::create(input_rows_count);
63
9
        const auto& vec_from = col_from->get_data();
64
9
        const auto* vec_from_data = vec_from.data();
65
9
        auto& vec_to = col_to->get_data();
66
9
        auto* vec_to_data = vec_to.data();
67
68
9
        CastParameters params;
69
9
        params.is_strict = (CastMode == CastModeType::StrictMode);
70
9
        size_t size = vec_from.size();
71
72
9
        typename FromFieldType::NativeType scale_multiplier =
73
9
                DataTypeDecimal<FromFieldType::PType>::get_scale_multiplier(from_scale);
74
521
        for (size_t i = 0; i < size; ++i) {
75
512
            CastToFloat::_from_decimalv3(vec_from_data[i], from_scale, vec_to_data[i],
76
512
                                         scale_multiplier, params);
77
512
        }
78
79
9
        block.get_by_position(result).column = std::move(col_to);
80
9
        return Status::OK();
81
9
    }
_ZNK5doris10CastToImplILNS_12CastModeTypeE1ENS_15DataTypeDecimalILNS_13PrimitiveTypeE30EEENS_14DataTypeNumberILS3_8EEEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKh
Line
Count
Source
49
9
                        const NullMap::value_type* null_map = nullptr) const override {
50
9
        using FromFieldType = typename FromDataType::FieldType;
51
9
        const ColumnWithTypeAndName& named_from = block.get_by_position(arguments[0]);
52
9
        const auto* col_from =
53
9
                check_and_get_column<typename FromDataType::ColumnType>(named_from.column.get());
54
9
        if (!col_from) {
55
0
            return Status::InternalError(fmt::format("Column type mismatch: expected {}, got {}",
56
0
                                                     type_to_string(FromDataType::PType),
57
0
                                                     named_from.column->get_name()));
58
0
        }
59
9
        const auto& from_decimal_type = assert_cast<const FromDataType&>(*named_from.type);
60
9
        UInt32 from_scale = from_decimal_type.get_scale();
61
62
9
        auto col_to = ToDataType::ColumnType::create(input_rows_count);
63
9
        const auto& vec_from = col_from->get_data();
64
9
        const auto* vec_from_data = vec_from.data();
65
9
        auto& vec_to = col_to->get_data();
66
9
        auto* vec_to_data = vec_to.data();
67
68
9
        CastParameters params;
69
9
        params.is_strict = (CastMode == CastModeType::StrictMode);
70
9
        size_t size = vec_from.size();
71
72
9
        typename FromFieldType::NativeType scale_multiplier =
73
9
                DataTypeDecimal<FromFieldType::PType>::get_scale_multiplier(from_scale);
74
521
        for (size_t i = 0; i < size; ++i) {
75
512
            CastToFloat::_from_decimalv3(vec_from_data[i], from_scale, vec_to_data[i],
76
512
                                         scale_multiplier, params);
77
512
        }
78
79
9
        block.get_by_position(result).column = std::move(col_to);
80
9
        return Status::OK();
81
9
    }
_ZNK5doris10CastToImplILNS_12CastModeTypeE0ENS_15DataTypeDecimalILNS_13PrimitiveTypeE35EEENS_14DataTypeNumberILS3_8EEEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKh
Line
Count
Source
49
18
                        const NullMap::value_type* null_map = nullptr) const override {
50
18
        using FromFieldType = typename FromDataType::FieldType;
51
18
        const ColumnWithTypeAndName& named_from = block.get_by_position(arguments[0]);
52
18
        const auto* col_from =
53
18
                check_and_get_column<typename FromDataType::ColumnType>(named_from.column.get());
54
18
        if (!col_from) {
55
0
            return Status::InternalError(fmt::format("Column type mismatch: expected {}, got {}",
56
0
                                                     type_to_string(FromDataType::PType),
57
0
                                                     named_from.column->get_name()));
58
0
        }
59
18
        const auto& from_decimal_type = assert_cast<const FromDataType&>(*named_from.type);
60
18
        UInt32 from_scale = from_decimal_type.get_scale();
61
62
18
        auto col_to = ToDataType::ColumnType::create(input_rows_count);
63
18
        const auto& vec_from = col_from->get_data();
64
18
        const auto* vec_from_data = vec_from.data();
65
18
        auto& vec_to = col_to->get_data();
66
18
        auto* vec_to_data = vec_to.data();
67
68
18
        CastParameters params;
69
18
        params.is_strict = (CastMode == CastModeType::StrictMode);
70
18
        size_t size = vec_from.size();
71
72
18
        typename FromFieldType::NativeType scale_multiplier =
73
18
                DataTypeDecimal<FromFieldType::PType>::get_scale_multiplier(from_scale);
74
680
        for (size_t i = 0; i < size; ++i) {
75
662
            CastToFloat::_from_decimalv3(vec_from_data[i], from_scale, vec_to_data[i],
76
662
                                         scale_multiplier, params);
77
662
        }
78
79
18
        block.get_by_position(result).column = std::move(col_to);
80
18
        return Status::OK();
81
18
    }
_ZNK5doris10CastToImplILNS_12CastModeTypeE1ENS_15DataTypeDecimalILNS_13PrimitiveTypeE35EEENS_14DataTypeNumberILS3_8EEEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKh
Line
Count
Source
49
18
                        const NullMap::value_type* null_map = nullptr) const override {
50
18
        using FromFieldType = typename FromDataType::FieldType;
51
18
        const ColumnWithTypeAndName& named_from = block.get_by_position(arguments[0]);
52
18
        const auto* col_from =
53
18
                check_and_get_column<typename FromDataType::ColumnType>(named_from.column.get());
54
18
        if (!col_from) {
55
0
            return Status::InternalError(fmt::format("Column type mismatch: expected {}, got {}",
56
0
                                                     type_to_string(FromDataType::PType),
57
0
                                                     named_from.column->get_name()));
58
0
        }
59
18
        const auto& from_decimal_type = assert_cast<const FromDataType&>(*named_from.type);
60
18
        UInt32 from_scale = from_decimal_type.get_scale();
61
62
18
        auto col_to = ToDataType::ColumnType::create(input_rows_count);
63
18
        const auto& vec_from = col_from->get_data();
64
18
        const auto* vec_from_data = vec_from.data();
65
18
        auto& vec_to = col_to->get_data();
66
18
        auto* vec_to_data = vec_to.data();
67
68
18
        CastParameters params;
69
18
        params.is_strict = (CastMode == CastModeType::StrictMode);
70
18
        size_t size = vec_from.size();
71
72
18
        typename FromFieldType::NativeType scale_multiplier =
73
18
                DataTypeDecimal<FromFieldType::PType>::get_scale_multiplier(from_scale);
74
680
        for (size_t i = 0; i < size; ++i) {
75
662
            CastToFloat::_from_decimalv3(vec_from_data[i], from_scale, vec_to_data[i],
76
662
                                         scale_multiplier, params);
77
662
        }
78
79
18
        block.get_by_position(result).column = std::move(col_to);
80
18
        return Status::OK();
81
18
    }
_ZNK5doris10CastToImplILNS_12CastModeTypeE0ENS_15DataTypeDecimalILNS_13PrimitiveTypeE28EEENS_14DataTypeNumberILS3_9EEEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKh
Line
Count
Source
49
7
                        const NullMap::value_type* null_map = nullptr) const override {
50
7
        using FromFieldType = typename FromDataType::FieldType;
51
7
        const ColumnWithTypeAndName& named_from = block.get_by_position(arguments[0]);
52
7
        const auto* col_from =
53
7
                check_and_get_column<typename FromDataType::ColumnType>(named_from.column.get());
54
7
        if (!col_from) {
55
0
            return Status::InternalError(fmt::format("Column type mismatch: expected {}, got {}",
56
0
                                                     type_to_string(FromDataType::PType),
57
0
                                                     named_from.column->get_name()));
58
0
        }
59
7
        const auto& from_decimal_type = assert_cast<const FromDataType&>(*named_from.type);
60
7
        UInt32 from_scale = from_decimal_type.get_scale();
61
62
7
        auto col_to = ToDataType::ColumnType::create(input_rows_count);
63
7
        const auto& vec_from = col_from->get_data();
64
7
        const auto* vec_from_data = vec_from.data();
65
7
        auto& vec_to = col_to->get_data();
66
7
        auto* vec_to_data = vec_to.data();
67
68
7
        CastParameters params;
69
7
        params.is_strict = (CastMode == CastModeType::StrictMode);
70
7
        size_t size = vec_from.size();
71
72
7
        typename FromFieldType::NativeType scale_multiplier =
73
7
                DataTypeDecimal<FromFieldType::PType>::get_scale_multiplier(from_scale);
74
311
        for (size_t i = 0; i < size; ++i) {
75
304
            CastToFloat::_from_decimalv3(vec_from_data[i], from_scale, vec_to_data[i],
76
304
                                         scale_multiplier, params);
77
304
        }
78
79
7
        block.get_by_position(result).column = std::move(col_to);
80
7
        return Status::OK();
81
7
    }
_ZNK5doris10CastToImplILNS_12CastModeTypeE1ENS_15DataTypeDecimalILNS_13PrimitiveTypeE28EEENS_14DataTypeNumberILS3_9EEEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKh
Line
Count
Source
49
7
                        const NullMap::value_type* null_map = nullptr) const override {
50
7
        using FromFieldType = typename FromDataType::FieldType;
51
7
        const ColumnWithTypeAndName& named_from = block.get_by_position(arguments[0]);
52
7
        const auto* col_from =
53
7
                check_and_get_column<typename FromDataType::ColumnType>(named_from.column.get());
54
7
        if (!col_from) {
55
0
            return Status::InternalError(fmt::format("Column type mismatch: expected {}, got {}",
56
0
                                                     type_to_string(FromDataType::PType),
57
0
                                                     named_from.column->get_name()));
58
0
        }
59
7
        const auto& from_decimal_type = assert_cast<const FromDataType&>(*named_from.type);
60
7
        UInt32 from_scale = from_decimal_type.get_scale();
61
62
7
        auto col_to = ToDataType::ColumnType::create(input_rows_count);
63
7
        const auto& vec_from = col_from->get_data();
64
7
        const auto* vec_from_data = vec_from.data();
65
7
        auto& vec_to = col_to->get_data();
66
7
        auto* vec_to_data = vec_to.data();
67
68
7
        CastParameters params;
69
7
        params.is_strict = (CastMode == CastModeType::StrictMode);
70
7
        size_t size = vec_from.size();
71
72
7
        typename FromFieldType::NativeType scale_multiplier =
73
7
                DataTypeDecimal<FromFieldType::PType>::get_scale_multiplier(from_scale);
74
311
        for (size_t i = 0; i < size; ++i) {
75
304
            CastToFloat::_from_decimalv3(vec_from_data[i], from_scale, vec_to_data[i],
76
304
                                         scale_multiplier, params);
77
304
        }
78
79
7
        block.get_by_position(result).column = std::move(col_to);
80
7
        return Status::OK();
81
7
    }
_ZNK5doris10CastToImplILNS_12CastModeTypeE0ENS_15DataTypeDecimalILNS_13PrimitiveTypeE29EEENS_14DataTypeNumberILS3_9EEEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKh
Line
Count
Source
49
9
                        const NullMap::value_type* null_map = nullptr) const override {
50
9
        using FromFieldType = typename FromDataType::FieldType;
51
9
        const ColumnWithTypeAndName& named_from = block.get_by_position(arguments[0]);
52
9
        const auto* col_from =
53
9
                check_and_get_column<typename FromDataType::ColumnType>(named_from.column.get());
54
9
        if (!col_from) {
55
0
            return Status::InternalError(fmt::format("Column type mismatch: expected {}, got {}",
56
0
                                                     type_to_string(FromDataType::PType),
57
0
                                                     named_from.column->get_name()));
58
0
        }
59
9
        const auto& from_decimal_type = assert_cast<const FromDataType&>(*named_from.type);
60
9
        UInt32 from_scale = from_decimal_type.get_scale();
61
62
9
        auto col_to = ToDataType::ColumnType::create(input_rows_count);
63
9
        const auto& vec_from = col_from->get_data();
64
9
        const auto* vec_from_data = vec_from.data();
65
9
        auto& vec_to = col_to->get_data();
66
9
        auto* vec_to_data = vec_to.data();
67
68
9
        CastParameters params;
69
9
        params.is_strict = (CastMode == CastModeType::StrictMode);
70
9
        size_t size = vec_from.size();
71
72
9
        typename FromFieldType::NativeType scale_multiplier =
73
9
                DataTypeDecimal<FromFieldType::PType>::get_scale_multiplier(from_scale);
74
521
        for (size_t i = 0; i < size; ++i) {
75
512
            CastToFloat::_from_decimalv3(vec_from_data[i], from_scale, vec_to_data[i],
76
512
                                         scale_multiplier, params);
77
512
        }
78
79
9
        block.get_by_position(result).column = std::move(col_to);
80
9
        return Status::OK();
81
9
    }
_ZNK5doris10CastToImplILNS_12CastModeTypeE1ENS_15DataTypeDecimalILNS_13PrimitiveTypeE29EEENS_14DataTypeNumberILS3_9EEEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKh
Line
Count
Source
49
9
                        const NullMap::value_type* null_map = nullptr) const override {
50
9
        using FromFieldType = typename FromDataType::FieldType;
51
9
        const ColumnWithTypeAndName& named_from = block.get_by_position(arguments[0]);
52
9
        const auto* col_from =
53
9
                check_and_get_column<typename FromDataType::ColumnType>(named_from.column.get());
54
9
        if (!col_from) {
55
0
            return Status::InternalError(fmt::format("Column type mismatch: expected {}, got {}",
56
0
                                                     type_to_string(FromDataType::PType),
57
0
                                                     named_from.column->get_name()));
58
0
        }
59
9
        const auto& from_decimal_type = assert_cast<const FromDataType&>(*named_from.type);
60
9
        UInt32 from_scale = from_decimal_type.get_scale();
61
62
9
        auto col_to = ToDataType::ColumnType::create(input_rows_count);
63
9
        const auto& vec_from = col_from->get_data();
64
9
        const auto* vec_from_data = vec_from.data();
65
9
        auto& vec_to = col_to->get_data();
66
9
        auto* vec_to_data = vec_to.data();
67
68
9
        CastParameters params;
69
9
        params.is_strict = (CastMode == CastModeType::StrictMode);
70
9
        size_t size = vec_from.size();
71
72
9
        typename FromFieldType::NativeType scale_multiplier =
73
9
                DataTypeDecimal<FromFieldType::PType>::get_scale_multiplier(from_scale);
74
521
        for (size_t i = 0; i < size; ++i) {
75
512
            CastToFloat::_from_decimalv3(vec_from_data[i], from_scale, vec_to_data[i],
76
512
                                         scale_multiplier, params);
77
512
        }
78
79
9
        block.get_by_position(result).column = std::move(col_to);
80
9
        return Status::OK();
81
9
    }
_ZNK5doris10CastToImplILNS_12CastModeTypeE0ENS_15DataTypeDecimalILNS_13PrimitiveTypeE20EEENS_14DataTypeNumberILS3_9EEEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKh
Line
Count
Source
49
7
                        const NullMap::value_type* null_map = nullptr) const override {
50
7
        using FromFieldType = typename FromDataType::FieldType;
51
7
        const ColumnWithTypeAndName& named_from = block.get_by_position(arguments[0]);
52
7
        const auto* col_from =
53
7
                check_and_get_column<typename FromDataType::ColumnType>(named_from.column.get());
54
7
        if (!col_from) {
55
0
            return Status::InternalError(fmt::format("Column type mismatch: expected {}, got {}",
56
0
                                                     type_to_string(FromDataType::PType),
57
0
                                                     named_from.column->get_name()));
58
0
        }
59
7
        const auto& from_decimal_type = assert_cast<const FromDataType&>(*named_from.type);
60
7
        UInt32 from_scale = from_decimal_type.get_scale();
61
62
7
        auto col_to = ToDataType::ColumnType::create(input_rows_count);
63
7
        const auto& vec_from = col_from->get_data();
64
7
        const auto* vec_from_data = vec_from.data();
65
7
        auto& vec_to = col_to->get_data();
66
7
        auto* vec_to_data = vec_to.data();
67
68
7
        CastParameters params;
69
7
        params.is_strict = (CastMode == CastModeType::StrictMode);
70
7
        size_t size = vec_from.size();
71
72
7
        typename FromFieldType::NativeType scale_multiplier =
73
7
                DataTypeDecimal<FromFieldType::PType>::get_scale_multiplier(from_scale);
74
129
        for (size_t i = 0; i < size; ++i) {
75
122
            CastToFloat::_from_decimalv3(vec_from_data[i], from_scale, vec_to_data[i],
76
122
                                         scale_multiplier, params);
77
122
        }
78
79
7
        block.get_by_position(result).column = std::move(col_to);
80
7
        return Status::OK();
81
7
    }
_ZNK5doris10CastToImplILNS_12CastModeTypeE1ENS_15DataTypeDecimalILNS_13PrimitiveTypeE20EEENS_14DataTypeNumberILS3_9EEEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKh
Line
Count
Source
49
7
                        const NullMap::value_type* null_map = nullptr) const override {
50
7
        using FromFieldType = typename FromDataType::FieldType;
51
7
        const ColumnWithTypeAndName& named_from = block.get_by_position(arguments[0]);
52
7
        const auto* col_from =
53
7
                check_and_get_column<typename FromDataType::ColumnType>(named_from.column.get());
54
7
        if (!col_from) {
55
0
            return Status::InternalError(fmt::format("Column type mismatch: expected {}, got {}",
56
0
                                                     type_to_string(FromDataType::PType),
57
0
                                                     named_from.column->get_name()));
58
0
        }
59
7
        const auto& from_decimal_type = assert_cast<const FromDataType&>(*named_from.type);
60
7
        UInt32 from_scale = from_decimal_type.get_scale();
61
62
7
        auto col_to = ToDataType::ColumnType::create(input_rows_count);
63
7
        const auto& vec_from = col_from->get_data();
64
7
        const auto* vec_from_data = vec_from.data();
65
7
        auto& vec_to = col_to->get_data();
66
7
        auto* vec_to_data = vec_to.data();
67
68
7
        CastParameters params;
69
7
        params.is_strict = (CastMode == CastModeType::StrictMode);
70
7
        size_t size = vec_from.size();
71
72
7
        typename FromFieldType::NativeType scale_multiplier =
73
7
                DataTypeDecimal<FromFieldType::PType>::get_scale_multiplier(from_scale);
74
129
        for (size_t i = 0; i < size; ++i) {
75
122
            CastToFloat::_from_decimalv3(vec_from_data[i], from_scale, vec_to_data[i],
76
122
                                         scale_multiplier, params);
77
122
        }
78
79
7
        block.get_by_position(result).column = std::move(col_to);
80
7
        return Status::OK();
81
7
    }
_ZNK5doris10CastToImplILNS_12CastModeTypeE0ENS_15DataTypeDecimalILNS_13PrimitiveTypeE30EEENS_14DataTypeNumberILS3_9EEEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKh
Line
Count
Source
49
9
                        const NullMap::value_type* null_map = nullptr) const override {
50
9
        using FromFieldType = typename FromDataType::FieldType;
51
9
        const ColumnWithTypeAndName& named_from = block.get_by_position(arguments[0]);
52
9
        const auto* col_from =
53
9
                check_and_get_column<typename FromDataType::ColumnType>(named_from.column.get());
54
9
        if (!col_from) {
55
0
            return Status::InternalError(fmt::format("Column type mismatch: expected {}, got {}",
56
0
                                                     type_to_string(FromDataType::PType),
57
0
                                                     named_from.column->get_name()));
58
0
        }
59
9
        const auto& from_decimal_type = assert_cast<const FromDataType&>(*named_from.type);
60
9
        UInt32 from_scale = from_decimal_type.get_scale();
61
62
9
        auto col_to = ToDataType::ColumnType::create(input_rows_count);
63
9
        const auto& vec_from = col_from->get_data();
64
9
        const auto* vec_from_data = vec_from.data();
65
9
        auto& vec_to = col_to->get_data();
66
9
        auto* vec_to_data = vec_to.data();
67
68
9
        CastParameters params;
69
9
        params.is_strict = (CastMode == CastModeType::StrictMode);
70
9
        size_t size = vec_from.size();
71
72
9
        typename FromFieldType::NativeType scale_multiplier =
73
9
                DataTypeDecimal<FromFieldType::PType>::get_scale_multiplier(from_scale);
74
521
        for (size_t i = 0; i < size; ++i) {
75
512
            CastToFloat::_from_decimalv3(vec_from_data[i], from_scale, vec_to_data[i],
76
512
                                         scale_multiplier, params);
77
512
        }
78
79
9
        block.get_by_position(result).column = std::move(col_to);
80
9
        return Status::OK();
81
9
    }
_ZNK5doris10CastToImplILNS_12CastModeTypeE1ENS_15DataTypeDecimalILNS_13PrimitiveTypeE30EEENS_14DataTypeNumberILS3_9EEEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKh
Line
Count
Source
49
9
                        const NullMap::value_type* null_map = nullptr) const override {
50
9
        using FromFieldType = typename FromDataType::FieldType;
51
9
        const ColumnWithTypeAndName& named_from = block.get_by_position(arguments[0]);
52
9
        const auto* col_from =
53
9
                check_and_get_column<typename FromDataType::ColumnType>(named_from.column.get());
54
9
        if (!col_from) {
55
0
            return Status::InternalError(fmt::format("Column type mismatch: expected {}, got {}",
56
0
                                                     type_to_string(FromDataType::PType),
57
0
                                                     named_from.column->get_name()));
58
0
        }
59
9
        const auto& from_decimal_type = assert_cast<const FromDataType&>(*named_from.type);
60
9
        UInt32 from_scale = from_decimal_type.get_scale();
61
62
9
        auto col_to = ToDataType::ColumnType::create(input_rows_count);
63
9
        const auto& vec_from = col_from->get_data();
64
9
        const auto* vec_from_data = vec_from.data();
65
9
        auto& vec_to = col_to->get_data();
66
9
        auto* vec_to_data = vec_to.data();
67
68
9
        CastParameters params;
69
9
        params.is_strict = (CastMode == CastModeType::StrictMode);
70
9
        size_t size = vec_from.size();
71
72
9
        typename FromFieldType::NativeType scale_multiplier =
73
9
                DataTypeDecimal<FromFieldType::PType>::get_scale_multiplier(from_scale);
74
521
        for (size_t i = 0; i < size; ++i) {
75
512
            CastToFloat::_from_decimalv3(vec_from_data[i], from_scale, vec_to_data[i],
76
512
                                         scale_multiplier, params);
77
512
        }
78
79
9
        block.get_by_position(result).column = std::move(col_to);
80
9
        return Status::OK();
81
9
    }
_ZNK5doris10CastToImplILNS_12CastModeTypeE0ENS_15DataTypeDecimalILNS_13PrimitiveTypeE35EEENS_14DataTypeNumberILS3_9EEEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKh
Line
Count
Source
49
9
                        const NullMap::value_type* null_map = nullptr) const override {
50
9
        using FromFieldType = typename FromDataType::FieldType;
51
9
        const ColumnWithTypeAndName& named_from = block.get_by_position(arguments[0]);
52
9
        const auto* col_from =
53
9
                check_and_get_column<typename FromDataType::ColumnType>(named_from.column.get());
54
9
        if (!col_from) {
55
0
            return Status::InternalError(fmt::format("Column type mismatch: expected {}, got {}",
56
0
                                                     type_to_string(FromDataType::PType),
57
0
                                                     named_from.column->get_name()));
58
0
        }
59
9
        const auto& from_decimal_type = assert_cast<const FromDataType&>(*named_from.type);
60
9
        UInt32 from_scale = from_decimal_type.get_scale();
61
62
9
        auto col_to = ToDataType::ColumnType::create(input_rows_count);
63
9
        const auto& vec_from = col_from->get_data();
64
9
        const auto* vec_from_data = vec_from.data();
65
9
        auto& vec_to = col_to->get_data();
66
9
        auto* vec_to_data = vec_to.data();
67
68
9
        CastParameters params;
69
9
        params.is_strict = (CastMode == CastModeType::StrictMode);
70
9
        size_t size = vec_from.size();
71
72
9
        typename FromFieldType::NativeType scale_multiplier =
73
9
                DataTypeDecimal<FromFieldType::PType>::get_scale_multiplier(from_scale);
74
521
        for (size_t i = 0; i < size; ++i) {
75
512
            CastToFloat::_from_decimalv3(vec_from_data[i], from_scale, vec_to_data[i],
76
512
                                         scale_multiplier, params);
77
512
        }
78
79
9
        block.get_by_position(result).column = std::move(col_to);
80
9
        return Status::OK();
81
9
    }
_ZNK5doris10CastToImplILNS_12CastModeTypeE1ENS_15DataTypeDecimalILNS_13PrimitiveTypeE35EEENS_14DataTypeNumberILS3_9EEEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKh
Line
Count
Source
49
9
                        const NullMap::value_type* null_map = nullptr) const override {
50
9
        using FromFieldType = typename FromDataType::FieldType;
51
9
        const ColumnWithTypeAndName& named_from = block.get_by_position(arguments[0]);
52
9
        const auto* col_from =
53
9
                check_and_get_column<typename FromDataType::ColumnType>(named_from.column.get());
54
9
        if (!col_from) {
55
0
            return Status::InternalError(fmt::format("Column type mismatch: expected {}, got {}",
56
0
                                                     type_to_string(FromDataType::PType),
57
0
                                                     named_from.column->get_name()));
58
0
        }
59
9
        const auto& from_decimal_type = assert_cast<const FromDataType&>(*named_from.type);
60
9
        UInt32 from_scale = from_decimal_type.get_scale();
61
62
9
        auto col_to = ToDataType::ColumnType::create(input_rows_count);
63
9
        const auto& vec_from = col_from->get_data();
64
9
        const auto* vec_from_data = vec_from.data();
65
9
        auto& vec_to = col_to->get_data();
66
9
        auto* vec_to_data = vec_to.data();
67
68
9
        CastParameters params;
69
9
        params.is_strict = (CastMode == CastModeType::StrictMode);
70
9
        size_t size = vec_from.size();
71
72
9
        typename FromFieldType::NativeType scale_multiplier =
73
9
                DataTypeDecimal<FromFieldType::PType>::get_scale_multiplier(from_scale);
74
521
        for (size_t i = 0; i < size; ++i) {
75
512
            CastToFloat::_from_decimalv3(vec_from_data[i], from_scale, vec_to_data[i],
76
512
                                         scale_multiplier, params);
77
512
        }
78
79
9
        block.get_by_position(result).column = std::move(col_to);
80
9
        return Status::OK();
81
9
    }
82
};
83
84
// cast date and datetime to float/double, will not overflow
85
// only support in non-strict mode. strict mode it's illegal!
86
template <typename FromDataType, typename ToDataType>
87
    requires(IsDataTypeFloat<ToDataType> &&
88
             (IsDatelikeV1Types<FromDataType> || IsDatelikeV2Types<FromDataType> ||
89
              std::is_same_v<FromDataType, DataTypeTimeV2>))
90
class CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType> : public CastToBase {
91
public:
92
    Status execute_impl(FunctionContext* context, Block& block, const ColumnNumbers& arguments,
93
                        uint32_t result, size_t input_rows_count,
94
14
                        const NullMap::value_type* null_map = nullptr) const override {
95
14
        return static_cast_no_overflow<FromDataType, ToDataType>(context, block, arguments, result,
96
14
                                                                 input_rows_count);
97
14
    }
Unexecuted instantiation: _ZNK5doris10CastToImplILNS_12CastModeTypeE1ENS_12DataTypeDateENS_14DataTypeNumberILNS_13PrimitiveTypeE8EEEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKh
_ZNK5doris10CastToImplILNS_12CastModeTypeE1ENS_14DataTypeDateV2ENS_14DataTypeNumberILNS_13PrimitiveTypeE8EEEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKh
Line
Count
Source
94
1
                        const NullMap::value_type* null_map = nullptr) const override {
95
1
        return static_cast_no_overflow<FromDataType, ToDataType>(context, block, arguments, result,
96
1
                                                                 input_rows_count);
97
1
    }
_ZNK5doris10CastToImplILNS_12CastModeTypeE1ENS_18DataTypeDateTimeV2ENS_14DataTypeNumberILNS_13PrimitiveTypeE8EEEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKh
Line
Count
Source
94
4
                        const NullMap::value_type* null_map = nullptr) const override {
95
4
        return static_cast_no_overflow<FromDataType, ToDataType>(context, block, arguments, result,
96
4
                                                                 input_rows_count);
97
4
    }
Unexecuted instantiation: _ZNK5doris10CastToImplILNS_12CastModeTypeE1ENS_16DataTypeDateTimeENS_14DataTypeNumberILNS_13PrimitiveTypeE8EEEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKh
_ZNK5doris10CastToImplILNS_12CastModeTypeE1ENS_14DataTypeTimeV2ENS_14DataTypeNumberILNS_13PrimitiveTypeE8EEEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKh
Line
Count
Source
94
2
                        const NullMap::value_type* null_map = nullptr) const override {
95
2
        return static_cast_no_overflow<FromDataType, ToDataType>(context, block, arguments, result,
96
2
                                                                 input_rows_count);
97
2
    }
Unexecuted instantiation: _ZNK5doris10CastToImplILNS_12CastModeTypeE1ENS_12DataTypeDateENS_14DataTypeNumberILNS_13PrimitiveTypeE9EEEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKh
_ZNK5doris10CastToImplILNS_12CastModeTypeE1ENS_14DataTypeDateV2ENS_14DataTypeNumberILNS_13PrimitiveTypeE9EEEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKh
Line
Count
Source
94
1
                        const NullMap::value_type* null_map = nullptr) const override {
95
1
        return static_cast_no_overflow<FromDataType, ToDataType>(context, block, arguments, result,
96
1
                                                                 input_rows_count);
97
1
    }
_ZNK5doris10CastToImplILNS_12CastModeTypeE1ENS_18DataTypeDateTimeV2ENS_14DataTypeNumberILNS_13PrimitiveTypeE9EEEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKh
Line
Count
Source
94
4
                        const NullMap::value_type* null_map = nullptr) const override {
95
4
        return static_cast_no_overflow<FromDataType, ToDataType>(context, block, arguments, result,
96
4
                                                                 input_rows_count);
97
4
    }
Unexecuted instantiation: _ZNK5doris10CastToImplILNS_12CastModeTypeE1ENS_16DataTypeDateTimeENS_14DataTypeNumberILNS_13PrimitiveTypeE9EEEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKh
_ZNK5doris10CastToImplILNS_12CastModeTypeE1ENS_14DataTypeTimeV2ENS_14DataTypeNumberILNS_13PrimitiveTypeE9EEEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKh
Line
Count
Source
94
2
                        const NullMap::value_type* null_map = nullptr) const override {
95
2
        return static_cast_no_overflow<FromDataType, ToDataType>(context, block, arguments, result,
96
2
                                                                 input_rows_count);
97
2
    }
98
};
99
100
namespace CastWrapper {
101
102
// max float: 3.40282e+38
103
// max int128:
104
// >> 0x7fffffffffffffffffffffffffffffff
105
// 170141183460469231731687303715884105727
106
// >>> len('170141183460469231731687303715884105727')
107
// 39
108
template <typename ToDataType>
109
16.4k
WrapperType create_float_wrapper(FunctionContext* context, const DataTypePtr& from_type) {
110
16.4k
    std::shared_ptr<CastToBase> cast_impl;
111
112
16.4k
    auto make_cast_wrapper = [&](const auto& types) -> bool {
113
16.4k
        using Types = std::decay_t<decltype(types)>;
114
16.4k
        using FromDataType = typename Types::LeftType;
115
16.4k
        if constexpr (type_allow_cast_to_basic_number<FromDataType>) {
116
16.4k
            if (context->enable_strict_mode()) {
117
16.2k
                cast_impl = std::make_shared<
118
16.2k
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
119
16.2k
            } else {
120
200
                cast_impl = std::make_shared<
121
200
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
122
200
            }
123
16.4k
            return true;
124
16.4k
        } else {
125
0
            return false;
126
0
        }
127
16.4k
    };
_ZZN5doris11CastWrapper20create_float_wrapperINS_14DataTypeNumberILNS_13PrimitiveTypeE8EEEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES8_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS2_ILS3_2EEEvEEEEbSS_
Line
Count
Source
112
2
    auto make_cast_wrapper = [&](const auto& types) -> bool {
113
2
        using Types = std::decay_t<decltype(types)>;
114
2
        using FromDataType = typename Types::LeftType;
115
2
        if constexpr (type_allow_cast_to_basic_number<FromDataType>) {
116
2
            if (context->enable_strict_mode()) {
117
1
                cast_impl = std::make_shared<
118
1
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
119
1
            } else {
120
1
                cast_impl = std::make_shared<
121
1
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
122
1
            }
123
2
            return true;
124
        } else {
125
            return false;
126
        }
127
2
    };
_ZZN5doris11CastWrapper20create_float_wrapperINS_14DataTypeNumberILNS_13PrimitiveTypeE8EEEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES8_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS2_ILS3_3EEEvEEEEbSS_
Line
Count
Source
112
2
    auto make_cast_wrapper = [&](const auto& types) -> bool {
113
2
        using Types = std::decay_t<decltype(types)>;
114
2
        using FromDataType = typename Types::LeftType;
115
2
        if constexpr (type_allow_cast_to_basic_number<FromDataType>) {
116
2
            if (context->enable_strict_mode()) {
117
1
                cast_impl = std::make_shared<
118
1
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
119
1
            } else {
120
1
                cast_impl = std::make_shared<
121
1
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
122
1
            }
123
2
            return true;
124
        } else {
125
            return false;
126
        }
127
2
    };
_ZZN5doris11CastWrapper20create_float_wrapperINS_14DataTypeNumberILNS_13PrimitiveTypeE8EEEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES8_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS2_ILS3_4EEEvEEEEbSS_
Line
Count
Source
112
2
    auto make_cast_wrapper = [&](const auto& types) -> bool {
113
2
        using Types = std::decay_t<decltype(types)>;
114
2
        using FromDataType = typename Types::LeftType;
115
2
        if constexpr (type_allow_cast_to_basic_number<FromDataType>) {
116
2
            if (context->enable_strict_mode()) {
117
1
                cast_impl = std::make_shared<
118
1
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
119
1
            } else {
120
1
                cast_impl = std::make_shared<
121
1
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
122
1
            }
123
2
            return true;
124
        } else {
125
            return false;
126
        }
127
2
    };
_ZZN5doris11CastWrapper20create_float_wrapperINS_14DataTypeNumberILNS_13PrimitiveTypeE8EEEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES8_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS2_ILS3_5EEEvEEEEbSS_
Line
Count
Source
112
2
    auto make_cast_wrapper = [&](const auto& types) -> bool {
113
2
        using Types = std::decay_t<decltype(types)>;
114
2
        using FromDataType = typename Types::LeftType;
115
2
        if constexpr (type_allow_cast_to_basic_number<FromDataType>) {
116
2
            if (context->enable_strict_mode()) {
117
1
                cast_impl = std::make_shared<
118
1
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
119
1
            } else {
120
1
                cast_impl = std::make_shared<
121
1
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
122
1
            }
123
2
            return true;
124
        } else {
125
            return false;
126
        }
127
2
    };
_ZZN5doris11CastWrapper20create_float_wrapperINS_14DataTypeNumberILNS_13PrimitiveTypeE8EEEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES8_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS2_ILS3_6EEEvEEEEbSS_
Line
Count
Source
112
2
    auto make_cast_wrapper = [&](const auto& types) -> bool {
113
2
        using Types = std::decay_t<decltype(types)>;
114
2
        using FromDataType = typename Types::LeftType;
115
2
        if constexpr (type_allow_cast_to_basic_number<FromDataType>) {
116
2
            if (context->enable_strict_mode()) {
117
1
                cast_impl = std::make_shared<
118
1
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
119
1
            } else {
120
1
                cast_impl = std::make_shared<
121
1
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
122
1
            }
123
2
            return true;
124
        } else {
125
            return false;
126
        }
127
2
    };
_ZZN5doris11CastWrapper20create_float_wrapperINS_14DataTypeNumberILNS_13PrimitiveTypeE8EEEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES8_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS2_ILS3_7EEEvEEEEbSS_
Line
Count
Source
112
2
    auto make_cast_wrapper = [&](const auto& types) -> bool {
113
2
        using Types = std::decay_t<decltype(types)>;
114
2
        using FromDataType = typename Types::LeftType;
115
2
        if constexpr (type_allow_cast_to_basic_number<FromDataType>) {
116
2
            if (context->enable_strict_mode()) {
117
1
                cast_impl = std::make_shared<
118
1
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
119
1
            } else {
120
1
                cast_impl = std::make_shared<
121
1
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
122
1
            }
123
2
            return true;
124
        } else {
125
            return false;
126
        }
127
2
    };
Unexecuted instantiation: _ZZN5doris11CastWrapper20create_float_wrapperINS_14DataTypeNumberILNS_13PrimitiveTypeE8EEEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES8_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairIS4_vEEEEbSS_
_ZZN5doris11CastWrapper20create_float_wrapperINS_14DataTypeNumberILNS_13PrimitiveTypeE8EEEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES8_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS2_ILS3_9EEEvEEEEbSS_
Line
Count
Source
112
2
    auto make_cast_wrapper = [&](const auto& types) -> bool {
113
2
        using Types = std::decay_t<decltype(types)>;
114
2
        using FromDataType = typename Types::LeftType;
115
2
        if constexpr (type_allow_cast_to_basic_number<FromDataType>) {
116
2
            if (context->enable_strict_mode()) {
117
1
                cast_impl = std::make_shared<
118
1
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
119
1
            } else {
120
1
                cast_impl = std::make_shared<
121
1
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
122
1
            }
123
2
            return true;
124
        } else {
125
            return false;
126
        }
127
2
    };
_ZZN5doris11CastWrapper20create_float_wrapperINS_14DataTypeNumberILNS_13PrimitiveTypeE8EEEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES8_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_15DataTypeDecimalILS3_28EEEvEEEEbSS_
Line
Count
Source
112
14
    auto make_cast_wrapper = [&](const auto& types) -> bool {
113
14
        using Types = std::decay_t<decltype(types)>;
114
14
        using FromDataType = typename Types::LeftType;
115
14
        if constexpr (type_allow_cast_to_basic_number<FromDataType>) {
116
14
            if (context->enable_strict_mode()) {
117
7
                cast_impl = std::make_shared<
118
7
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
119
7
            } else {
120
7
                cast_impl = std::make_shared<
121
7
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
122
7
            }
123
14
            return true;
124
        } else {
125
            return false;
126
        }
127
14
    };
_ZZN5doris11CastWrapper20create_float_wrapperINS_14DataTypeNumberILNS_13PrimitiveTypeE8EEEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES8_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_15DataTypeDecimalILS3_29EEEvEEEEbSS_
Line
Count
Source
112
18
    auto make_cast_wrapper = [&](const auto& types) -> bool {
113
18
        using Types = std::decay_t<decltype(types)>;
114
18
        using FromDataType = typename Types::LeftType;
115
18
        if constexpr (type_allow_cast_to_basic_number<FromDataType>) {
116
18
            if (context->enable_strict_mode()) {
117
9
                cast_impl = std::make_shared<
118
9
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
119
9
            } else {
120
9
                cast_impl = std::make_shared<
121
9
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
122
9
            }
123
18
            return true;
124
        } else {
125
            return false;
126
        }
127
18
    };
_ZZN5doris11CastWrapper20create_float_wrapperINS_14DataTypeNumberILNS_13PrimitiveTypeE8EEEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES8_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_15DataTypeDecimalILS3_20EEEvEEEEbSS_
Line
Count
Source
112
14
    auto make_cast_wrapper = [&](const auto& types) -> bool {
113
14
        using Types = std::decay_t<decltype(types)>;
114
14
        using FromDataType = typename Types::LeftType;
115
14
        if constexpr (type_allow_cast_to_basic_number<FromDataType>) {
116
14
            if (context->enable_strict_mode()) {
117
7
                cast_impl = std::make_shared<
118
7
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
119
7
            } else {
120
7
                cast_impl = std::make_shared<
121
7
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
122
7
            }
123
14
            return true;
124
        } else {
125
            return false;
126
        }
127
14
    };
_ZZN5doris11CastWrapper20create_float_wrapperINS_14DataTypeNumberILNS_13PrimitiveTypeE8EEEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES8_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_15DataTypeDecimalILS3_30EEEvEEEEbSS_
Line
Count
Source
112
18
    auto make_cast_wrapper = [&](const auto& types) -> bool {
113
18
        using Types = std::decay_t<decltype(types)>;
114
18
        using FromDataType = typename Types::LeftType;
115
18
        if constexpr (type_allow_cast_to_basic_number<FromDataType>) {
116
18
            if (context->enable_strict_mode()) {
117
9
                cast_impl = std::make_shared<
118
9
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
119
9
            } else {
120
9
                cast_impl = std::make_shared<
121
9
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
122
9
            }
123
18
            return true;
124
        } else {
125
            return false;
126
        }
127
18
    };
_ZZN5doris11CastWrapper20create_float_wrapperINS_14DataTypeNumberILNS_13PrimitiveTypeE8EEEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES8_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_15DataTypeDecimalILS3_35EEEvEEEEbSS_
Line
Count
Source
112
36
    auto make_cast_wrapper = [&](const auto& types) -> bool {
113
36
        using Types = std::decay_t<decltype(types)>;
114
36
        using FromDataType = typename Types::LeftType;
115
36
        if constexpr (type_allow_cast_to_basic_number<FromDataType>) {
116
36
            if (context->enable_strict_mode()) {
117
18
                cast_impl = std::make_shared<
118
18
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
119
18
            } else {
120
18
                cast_impl = std::make_shared<
121
18
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
122
18
            }
123
36
            return true;
124
        } else {
125
            return false;
126
        }
127
36
    };
Unexecuted instantiation: _ZZN5doris11CastWrapper20create_float_wrapperINS_14DataTypeNumberILNS_13PrimitiveTypeE8EEEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES8_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_12DataTypeDateEvEEEEbSS_
_ZZN5doris11CastWrapper20create_float_wrapperINS_14DataTypeNumberILNS_13PrimitiveTypeE8EEEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES8_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_14DataTypeDateV2EvEEEEbSS_
Line
Count
Source
112
37
    auto make_cast_wrapper = [&](const auto& types) -> bool {
113
37
        using Types = std::decay_t<decltype(types)>;
114
37
        using FromDataType = typename Types::LeftType;
115
37
        if constexpr (type_allow_cast_to_basic_number<FromDataType>) {
116
37
            if (context->enable_strict_mode()) {
117
36
                cast_impl = std::make_shared<
118
36
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
119
36
            } else {
120
1
                cast_impl = std::make_shared<
121
1
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
122
1
            }
123
37
            return true;
124
        } else {
125
            return false;
126
        }
127
37
    };
_ZZN5doris11CastWrapper20create_float_wrapperINS_14DataTypeNumberILNS_13PrimitiveTypeE8EEEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES8_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_18DataTypeDateTimeV2EvEEEEbSS_
Line
Count
Source
112
7.78k
    auto make_cast_wrapper = [&](const auto& types) -> bool {
113
7.78k
        using Types = std::decay_t<decltype(types)>;
114
7.78k
        using FromDataType = typename Types::LeftType;
115
7.78k
        if constexpr (type_allow_cast_to_basic_number<FromDataType>) {
116
7.78k
            if (context->enable_strict_mode()) {
117
7.77k
                cast_impl = std::make_shared<
118
7.77k
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
119
7.77k
            } else {
120
4
                cast_impl = std::make_shared<
121
4
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
122
4
            }
123
7.78k
            return true;
124
        } else {
125
            return false;
126
        }
127
7.78k
    };
Unexecuted instantiation: _ZZN5doris11CastWrapper20create_float_wrapperINS_14DataTypeNumberILNS_13PrimitiveTypeE8EEEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES8_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_16DataTypeDateTimeEvEEEEbSS_
_ZZN5doris11CastWrapper20create_float_wrapperINS_14DataTypeNumberILNS_13PrimitiveTypeE8EEEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES8_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_14DataTypeTimeV2EvEEEEbSS_
Line
Count
Source
112
162
    auto make_cast_wrapper = [&](const auto& types) -> bool {
113
162
        using Types = std::decay_t<decltype(types)>;
114
162
        using FromDataType = typename Types::LeftType;
115
162
        if constexpr (type_allow_cast_to_basic_number<FromDataType>) {
116
162
            if (context->enable_strict_mode()) {
117
160
                cast_impl = std::make_shared<
118
160
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
119
160
            } else {
120
2
                cast_impl = std::make_shared<
121
2
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
122
2
            }
123
162
            return true;
124
        } else {
125
            return false;
126
        }
127
162
    };
Unexecuted instantiation: _ZZN5doris11CastWrapper20create_float_wrapperINS_14DataTypeNumberILNS_13PrimitiveTypeE8EEEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES8_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_19DataTypeTimeStampTzEvEEEEbSS_
Unexecuted instantiation: _ZZN5doris11CastWrapper20create_float_wrapperINS_14DataTypeNumberILNS_13PrimitiveTypeE8EEEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES8_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_12DataTypeIPv4EvEEEEbSS_
Unexecuted instantiation: _ZZN5doris11CastWrapper20create_float_wrapperINS_14DataTypeNumberILNS_13PrimitiveTypeE8EEEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES8_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_12DataTypeIPv6EvEEEEbSS_
_ZZN5doris11CastWrapper20create_float_wrapperINS_14DataTypeNumberILNS_13PrimitiveTypeE8EEEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES8_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_14DataTypeStringEvEEEEbSS_
Line
Count
Source
112
80
    auto make_cast_wrapper = [&](const auto& types) -> bool {
113
80
        using Types = std::decay_t<decltype(types)>;
114
80
        using FromDataType = typename Types::LeftType;
115
80
        if constexpr (type_allow_cast_to_basic_number<FromDataType>) {
116
80
            if (context->enable_strict_mode()) {
117
76
                cast_impl = std::make_shared<
118
76
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
119
76
            } else {
120
4
                cast_impl = std::make_shared<
121
4
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
122
4
            }
123
80
            return true;
124
        } else {
125
            return false;
126
        }
127
80
    };
_ZZN5doris11CastWrapper20create_float_wrapperINS_14DataTypeNumberILNS_13PrimitiveTypeE9EEEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES8_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS2_ILS3_2EEEvEEEEbSS_
Line
Count
Source
112
75
    auto make_cast_wrapper = [&](const auto& types) -> bool {
113
75
        using Types = std::decay_t<decltype(types)>;
114
75
        using FromDataType = typename Types::LeftType;
115
75
        if constexpr (type_allow_cast_to_basic_number<FromDataType>) {
116
75
            if (context->enable_strict_mode()) {
117
1
                cast_impl = std::make_shared<
118
1
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
119
74
            } else {
120
74
                cast_impl = std::make_shared<
121
74
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
122
74
            }
123
75
            return true;
124
        } else {
125
            return false;
126
        }
127
75
    };
_ZZN5doris11CastWrapper20create_float_wrapperINS_14DataTypeNumberILNS_13PrimitiveTypeE9EEEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES8_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS2_ILS3_3EEEvEEEEbSS_
Line
Count
Source
112
2
    auto make_cast_wrapper = [&](const auto& types) -> bool {
113
2
        using Types = std::decay_t<decltype(types)>;
114
2
        using FromDataType = typename Types::LeftType;
115
2
        if constexpr (type_allow_cast_to_basic_number<FromDataType>) {
116
2
            if (context->enable_strict_mode()) {
117
1
                cast_impl = std::make_shared<
118
1
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
119
1
            } else {
120
1
                cast_impl = std::make_shared<
121
1
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
122
1
            }
123
2
            return true;
124
        } else {
125
            return false;
126
        }
127
2
    };
_ZZN5doris11CastWrapper20create_float_wrapperINS_14DataTypeNumberILNS_13PrimitiveTypeE9EEEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES8_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS2_ILS3_4EEEvEEEEbSS_
Line
Count
Source
112
2
    auto make_cast_wrapper = [&](const auto& types) -> bool {
113
2
        using Types = std::decay_t<decltype(types)>;
114
2
        using FromDataType = typename Types::LeftType;
115
2
        if constexpr (type_allow_cast_to_basic_number<FromDataType>) {
116
2
            if (context->enable_strict_mode()) {
117
1
                cast_impl = std::make_shared<
118
1
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
119
1
            } else {
120
1
                cast_impl = std::make_shared<
121
1
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
122
1
            }
123
2
            return true;
124
        } else {
125
            return false;
126
        }
127
2
    };
_ZZN5doris11CastWrapper20create_float_wrapperINS_14DataTypeNumberILNS_13PrimitiveTypeE9EEEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES8_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS2_ILS3_5EEEvEEEEbSS_
Line
Count
Source
112
2
    auto make_cast_wrapper = [&](const auto& types) -> bool {
113
2
        using Types = std::decay_t<decltype(types)>;
114
2
        using FromDataType = typename Types::LeftType;
115
2
        if constexpr (type_allow_cast_to_basic_number<FromDataType>) {
116
2
            if (context->enable_strict_mode()) {
117
1
                cast_impl = std::make_shared<
118
1
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
119
1
            } else {
120
1
                cast_impl = std::make_shared<
121
1
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
122
1
            }
123
2
            return true;
124
        } else {
125
            return false;
126
        }
127
2
    };
_ZZN5doris11CastWrapper20create_float_wrapperINS_14DataTypeNumberILNS_13PrimitiveTypeE9EEEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES8_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS2_ILS3_6EEEvEEEEbSS_
Line
Count
Source
112
2
    auto make_cast_wrapper = [&](const auto& types) -> bool {
113
2
        using Types = std::decay_t<decltype(types)>;
114
2
        using FromDataType = typename Types::LeftType;
115
2
        if constexpr (type_allow_cast_to_basic_number<FromDataType>) {
116
2
            if (context->enable_strict_mode()) {
117
1
                cast_impl = std::make_shared<
118
1
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
119
1
            } else {
120
1
                cast_impl = std::make_shared<
121
1
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
122
1
            }
123
2
            return true;
124
        } else {
125
            return false;
126
        }
127
2
    };
_ZZN5doris11CastWrapper20create_float_wrapperINS_14DataTypeNumberILNS_13PrimitiveTypeE9EEEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES8_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS2_ILS3_7EEEvEEEEbSS_
Line
Count
Source
112
2
    auto make_cast_wrapper = [&](const auto& types) -> bool {
113
2
        using Types = std::decay_t<decltype(types)>;
114
2
        using FromDataType = typename Types::LeftType;
115
2
        if constexpr (type_allow_cast_to_basic_number<FromDataType>) {
116
2
            if (context->enable_strict_mode()) {
117
1
                cast_impl = std::make_shared<
118
1
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
119
1
            } else {
120
1
                cast_impl = std::make_shared<
121
1
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
122
1
            }
123
2
            return true;
124
        } else {
125
            return false;
126
        }
127
2
    };
_ZZN5doris11CastWrapper20create_float_wrapperINS_14DataTypeNumberILNS_13PrimitiveTypeE9EEEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES8_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS2_ILS3_8EEEvEEEEbSS_
Line
Count
Source
112
2
    auto make_cast_wrapper = [&](const auto& types) -> bool {
113
2
        using Types = std::decay_t<decltype(types)>;
114
2
        using FromDataType = typename Types::LeftType;
115
2
        if constexpr (type_allow_cast_to_basic_number<FromDataType>) {
116
2
            if (context->enable_strict_mode()) {
117
1
                cast_impl = std::make_shared<
118
1
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
119
1
            } else {
120
1
                cast_impl = std::make_shared<
121
1
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
122
1
            }
123
2
            return true;
124
        } else {
125
            return false;
126
        }
127
2
    };
Unexecuted instantiation: _ZZN5doris11CastWrapper20create_float_wrapperINS_14DataTypeNumberILNS_13PrimitiveTypeE9EEEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES8_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairIS4_vEEEEbSS_
_ZZN5doris11CastWrapper20create_float_wrapperINS_14DataTypeNumberILNS_13PrimitiveTypeE9EEEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES8_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_15DataTypeDecimalILS3_28EEEvEEEEbSS_
Line
Count
Source
112
14
    auto make_cast_wrapper = [&](const auto& types) -> bool {
113
14
        using Types = std::decay_t<decltype(types)>;
114
14
        using FromDataType = typename Types::LeftType;
115
14
        if constexpr (type_allow_cast_to_basic_number<FromDataType>) {
116
14
            if (context->enable_strict_mode()) {
117
7
                cast_impl = std::make_shared<
118
7
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
119
7
            } else {
120
7
                cast_impl = std::make_shared<
121
7
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
122
7
            }
123
14
            return true;
124
        } else {
125
            return false;
126
        }
127
14
    };
_ZZN5doris11CastWrapper20create_float_wrapperINS_14DataTypeNumberILNS_13PrimitiveTypeE9EEEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES8_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_15DataTypeDecimalILS3_29EEEvEEEEbSS_
Line
Count
Source
112
18
    auto make_cast_wrapper = [&](const auto& types) -> bool {
113
18
        using Types = std::decay_t<decltype(types)>;
114
18
        using FromDataType = typename Types::LeftType;
115
18
        if constexpr (type_allow_cast_to_basic_number<FromDataType>) {
116
18
            if (context->enable_strict_mode()) {
117
9
                cast_impl = std::make_shared<
118
9
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
119
9
            } else {
120
9
                cast_impl = std::make_shared<
121
9
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
122
9
            }
123
18
            return true;
124
        } else {
125
            return false;
126
        }
127
18
    };
_ZZN5doris11CastWrapper20create_float_wrapperINS_14DataTypeNumberILNS_13PrimitiveTypeE9EEEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES8_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_15DataTypeDecimalILS3_20EEEvEEEEbSS_
Line
Count
Source
112
14
    auto make_cast_wrapper = [&](const auto& types) -> bool {
113
14
        using Types = std::decay_t<decltype(types)>;
114
14
        using FromDataType = typename Types::LeftType;
115
14
        if constexpr (type_allow_cast_to_basic_number<FromDataType>) {
116
14
            if (context->enable_strict_mode()) {
117
7
                cast_impl = std::make_shared<
118
7
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
119
7
            } else {
120
7
                cast_impl = std::make_shared<
121
7
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
122
7
            }
123
14
            return true;
124
        } else {
125
            return false;
126
        }
127
14
    };
_ZZN5doris11CastWrapper20create_float_wrapperINS_14DataTypeNumberILNS_13PrimitiveTypeE9EEEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES8_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_15DataTypeDecimalILS3_30EEEvEEEEbSS_
Line
Count
Source
112
18
    auto make_cast_wrapper = [&](const auto& types) -> bool {
113
18
        using Types = std::decay_t<decltype(types)>;
114
18
        using FromDataType = typename Types::LeftType;
115
18
        if constexpr (type_allow_cast_to_basic_number<FromDataType>) {
116
18
            if (context->enable_strict_mode()) {
117
9
                cast_impl = std::make_shared<
118
9
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
119
9
            } else {
120
9
                cast_impl = std::make_shared<
121
9
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
122
9
            }
123
18
            return true;
124
        } else {
125
            return false;
126
        }
127
18
    };
_ZZN5doris11CastWrapper20create_float_wrapperINS_14DataTypeNumberILNS_13PrimitiveTypeE9EEEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES8_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_15DataTypeDecimalILS3_35EEEvEEEEbSS_
Line
Count
Source
112
18
    auto make_cast_wrapper = [&](const auto& types) -> bool {
113
18
        using Types = std::decay_t<decltype(types)>;
114
18
        using FromDataType = typename Types::LeftType;
115
18
        if constexpr (type_allow_cast_to_basic_number<FromDataType>) {
116
18
            if (context->enable_strict_mode()) {
117
9
                cast_impl = std::make_shared<
118
9
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
119
9
            } else {
120
9
                cast_impl = std::make_shared<
121
9
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
122
9
            }
123
18
            return true;
124
        } else {
125
            return false;
126
        }
127
18
    };
Unexecuted instantiation: _ZZN5doris11CastWrapper20create_float_wrapperINS_14DataTypeNumberILNS_13PrimitiveTypeE9EEEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES8_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_12DataTypeDateEvEEEEbSS_
_ZZN5doris11CastWrapper20create_float_wrapperINS_14DataTypeNumberILNS_13PrimitiveTypeE9EEEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES8_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_14DataTypeDateV2EvEEEEbSS_
Line
Count
Source
112
37
    auto make_cast_wrapper = [&](const auto& types) -> bool {
113
37
        using Types = std::decay_t<decltype(types)>;
114
37
        using FromDataType = typename Types::LeftType;
115
37
        if constexpr (type_allow_cast_to_basic_number<FromDataType>) {
116
37
            if (context->enable_strict_mode()) {
117
36
                cast_impl = std::make_shared<
118
36
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
119
36
            } else {
120
1
                cast_impl = std::make_shared<
121
1
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
122
1
            }
123
37
            return true;
124
        } else {
125
            return false;
126
        }
127
37
    };
_ZZN5doris11CastWrapper20create_float_wrapperINS_14DataTypeNumberILNS_13PrimitiveTypeE9EEEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES8_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_18DataTypeDateTimeV2EvEEEEbSS_
Line
Count
Source
112
7.78k
    auto make_cast_wrapper = [&](const auto& types) -> bool {
113
7.78k
        using Types = std::decay_t<decltype(types)>;
114
7.78k
        using FromDataType = typename Types::LeftType;
115
7.78k
        if constexpr (type_allow_cast_to_basic_number<FromDataType>) {
116
7.78k
            if (context->enable_strict_mode()) {
117
7.77k
                cast_impl = std::make_shared<
118
7.77k
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
119
7.77k
            } else {
120
4
                cast_impl = std::make_shared<
121
4
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
122
4
            }
123
7.78k
            return true;
124
        } else {
125
            return false;
126
        }
127
7.78k
    };
Unexecuted instantiation: _ZZN5doris11CastWrapper20create_float_wrapperINS_14DataTypeNumberILNS_13PrimitiveTypeE9EEEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES8_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_16DataTypeDateTimeEvEEEEbSS_
_ZZN5doris11CastWrapper20create_float_wrapperINS_14DataTypeNumberILNS_13PrimitiveTypeE9EEEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES8_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_14DataTypeTimeV2EvEEEEbSS_
Line
Count
Source
112
162
    auto make_cast_wrapper = [&](const auto& types) -> bool {
113
162
        using Types = std::decay_t<decltype(types)>;
114
162
        using FromDataType = typename Types::LeftType;
115
162
        if constexpr (type_allow_cast_to_basic_number<FromDataType>) {
116
162
            if (context->enable_strict_mode()) {
117
160
                cast_impl = std::make_shared<
118
160
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
119
160
            } else {
120
2
                cast_impl = std::make_shared<
121
2
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
122
2
            }
123
162
            return true;
124
        } else {
125
            return false;
126
        }
127
162
    };
Unexecuted instantiation: _ZZN5doris11CastWrapper20create_float_wrapperINS_14DataTypeNumberILNS_13PrimitiveTypeE9EEEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES8_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_19DataTypeTimeStampTzEvEEEEbSS_
Unexecuted instantiation: _ZZN5doris11CastWrapper20create_float_wrapperINS_14DataTypeNumberILNS_13PrimitiveTypeE9EEEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES8_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_12DataTypeIPv4EvEEEEbSS_
Unexecuted instantiation: _ZZN5doris11CastWrapper20create_float_wrapperINS_14DataTypeNumberILNS_13PrimitiveTypeE9EEEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES8_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_12DataTypeIPv6EvEEEEbSS_
_ZZN5doris11CastWrapper20create_float_wrapperINS_14DataTypeNumberILNS_13PrimitiveTypeE9EEEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES8_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlRKT_E_clINS_8TypePairINS_14DataTypeStringEvEEEEbSS_
Line
Count
Source
112
80
    auto make_cast_wrapper = [&](const auto& types) -> bool {
113
80
        using Types = std::decay_t<decltype(types)>;
114
80
        using FromDataType = typename Types::LeftType;
115
80
        if constexpr (type_allow_cast_to_basic_number<FromDataType>) {
116
80
            if (context->enable_strict_mode()) {
117
76
                cast_impl = std::make_shared<
118
76
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
119
76
            } else {
120
4
                cast_impl = std::make_shared<
121
4
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
122
4
            }
123
80
            return true;
124
        } else {
125
            return false;
126
        }
127
80
    };
128
129
16.4k
    if (!call_on_index_and_data_type<void>(from_type->get_primitive_type(), make_cast_wrapper)) {
130
0
        return create_unsupport_wrapper(
131
0
                fmt::format("CAST AS number not supported {}", from_type->get_name()));
132
0
    }
133
134
16.4k
    return [cast_impl](FunctionContext* context, Block& block, const ColumnNumbers& arguments,
135
16.4k
                       uint32_t result, size_t input_rows_count,
136
16.4k
                       const NullMap::value_type* null_map = nullptr) {
137
16.4k
        return cast_impl->execute_impl(context, block, arguments, result, input_rows_count,
138
16.4k
                                       null_map);
139
16.4k
    };
_ZZN5doris11CastWrapper20create_float_wrapperINS_14DataTypeNumberILNS_13PrimitiveTypeE8EEEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES8_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlS8_SA_SF_jmSH_E_clES8_SA_SF_jmSH_
Line
Count
Source
136
8.17k
                       const NullMap::value_type* null_map = nullptr) {
137
8.17k
        return cast_impl->execute_impl(context, block, arguments, result, input_rows_count,
138
8.17k
                                       null_map);
139
8.17k
    };
_ZZN5doris11CastWrapper20create_float_wrapperINS_14DataTypeNumberILNS_13PrimitiveTypeE9EEEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES8_RKSt10shared_ptrIKNS_9IDataTypeEEENKUlS8_SA_SF_jmSH_E_clES8_SA_SF_jmSH_
Line
Count
Source
136
8.22k
                       const NullMap::value_type* null_map = nullptr) {
137
8.22k
        return cast_impl->execute_impl(context, block, arguments, result, input_rows_count,
138
8.22k
                                       null_map);
139
8.22k
    };
140
16.4k
}
_ZN5doris11CastWrapper20create_float_wrapperINS_14DataTypeNumberILNS_13PrimitiveTypeE8EEEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES8_RKSt10shared_ptrIKNS_9IDataTypeEE
Line
Count
Source
109
8.17k
WrapperType create_float_wrapper(FunctionContext* context, const DataTypePtr& from_type) {
110
8.17k
    std::shared_ptr<CastToBase> cast_impl;
111
112
8.17k
    auto make_cast_wrapper = [&](const auto& types) -> bool {
113
8.17k
        using Types = std::decay_t<decltype(types)>;
114
8.17k
        using FromDataType = typename Types::LeftType;
115
8.17k
        if constexpr (type_allow_cast_to_basic_number<FromDataType>) {
116
8.17k
            if (context->enable_strict_mode()) {
117
8.17k
                cast_impl = std::make_shared<
118
8.17k
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
119
8.17k
            } else {
120
8.17k
                cast_impl = std::make_shared<
121
8.17k
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
122
8.17k
            }
123
8.17k
            return true;
124
8.17k
        } else {
125
8.17k
            return false;
126
8.17k
        }
127
8.17k
    };
128
129
8.17k
    if (!call_on_index_and_data_type<void>(from_type->get_primitive_type(), make_cast_wrapper)) {
130
0
        return create_unsupport_wrapper(
131
0
                fmt::format("CAST AS number not supported {}", from_type->get_name()));
132
0
    }
133
134
8.17k
    return [cast_impl](FunctionContext* context, Block& block, const ColumnNumbers& arguments,
135
8.17k
                       uint32_t result, size_t input_rows_count,
136
8.17k
                       const NullMap::value_type* null_map = nullptr) {
137
8.17k
        return cast_impl->execute_impl(context, block, arguments, result, input_rows_count,
138
8.17k
                                       null_map);
139
8.17k
    };
140
8.17k
}
_ZN5doris11CastWrapper20create_float_wrapperINS_14DataTypeNumberILNS_13PrimitiveTypeE9EEEEESt8functionIFNS_6StatusEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmPKhEES8_RKSt10shared_ptrIKNS_9IDataTypeEE
Line
Count
Source
109
8.22k
WrapperType create_float_wrapper(FunctionContext* context, const DataTypePtr& from_type) {
110
8.22k
    std::shared_ptr<CastToBase> cast_impl;
111
112
8.22k
    auto make_cast_wrapper = [&](const auto& types) -> bool {
113
8.22k
        using Types = std::decay_t<decltype(types)>;
114
8.22k
        using FromDataType = typename Types::LeftType;
115
8.22k
        if constexpr (type_allow_cast_to_basic_number<FromDataType>) {
116
8.22k
            if (context->enable_strict_mode()) {
117
8.22k
                cast_impl = std::make_shared<
118
8.22k
                        CastToImpl<CastModeType::StrictMode, FromDataType, ToDataType>>();
119
8.22k
            } else {
120
8.22k
                cast_impl = std::make_shared<
121
8.22k
                        CastToImpl<CastModeType::NonStrictMode, FromDataType, ToDataType>>();
122
8.22k
            }
123
8.22k
            return true;
124
8.22k
        } else {
125
8.22k
            return false;
126
8.22k
        }
127
8.22k
    };
128
129
8.22k
    if (!call_on_index_and_data_type<void>(from_type->get_primitive_type(), make_cast_wrapper)) {
130
0
        return create_unsupport_wrapper(
131
0
                fmt::format("CAST AS number not supported {}", from_type->get_name()));
132
0
    }
133
134
8.22k
    return [cast_impl](FunctionContext* context, Block& block, const ColumnNumbers& arguments,
135
8.22k
                       uint32_t result, size_t input_rows_count,
136
8.22k
                       const NullMap::value_type* null_map = nullptr) {
137
8.22k
        return cast_impl->execute_impl(context, block, arguments, result, input_rows_count,
138
8.22k
                                       null_map);
139
8.22k
    };
140
8.22k
}
141
} // namespace CastWrapper
142
#include "common/compile_check_end.h"
143
} // namespace doris