Coverage Report

Created: 2026-09-06 18:00

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
be/src/exprs/vcase_expr.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 <string>
21
22
#include "common/exception.h"
23
#include "common/status.h"
24
#include "core/column/column_array.h"
25
#include "core/column/column_complex.h"
26
#include "core/column/column_const.h"
27
#include "core/column/column_decimal.h"
28
#include "core/column/column_map.h"
29
#include "core/column/column_nullable.h"
30
#include "core/column/column_struct.h"
31
#include "core/column/column_variant.h"
32
#include "core/column/variant_v2/column_variant_v2.h"
33
#include "core/data_type/data_type_nullable.h"
34
#include "core/data_type/data_type_variant.h"
35
#include "core/data_type/data_type_variant_v2.h"
36
#include "core/data_type/define_primitive_type.h"
37
#include "core/data_type/primitive_type.h"
38
#include "exprs/function/function.h"
39
#include "exprs/function_context.h"
40
#include "exprs/vexpr.h"
41
42
namespace doris {
43
class RowDescriptor;
44
class RuntimeState;
45
class TExprNode;
46
47
class Block;
48
} // namespace doris
49
50
namespace doris {
51
52
class VCaseExpr final : public VExpr {
53
    ENABLE_FACTORY_CREATOR(VCaseExpr);
54
55
public:
56
    VCaseExpr(const TExprNode& node);
57
    ~VCaseExpr() override = default;
58
    Status execute_column_impl(VExprContext* context, const Block* block, const Selector* selector,
59
                               size_t count, ColumnPtr& result_column) const override;
60
    Status prepare(RuntimeState* state, const RowDescriptor& desc, VExprContext* context) override;
61
    Status open(RuntimeState* state, VExprContext* context,
62
                FunctionContext::FunctionStateScope scope) override;
63
    void close(VExprContext* context, FunctionContext::FunctionStateScope scope) override;
64
    const std::string& expr_name() const override;
65
    std::string debug_string() const override;
66
0
    bool has_else_expr() const { return _has_else_expr; }
67
1
    Status clone_node(VExprSPtr* cloned_expr) const override {
68
1
        DORIS_CHECK(cloned_expr != nullptr);
69
1
        auto node = clone_texpr_node();
70
1
        TCaseExpr case_node;
71
1
        case_node.__set_has_case_expr(false);
72
1
        case_node.__set_has_else_expr(_has_else_expr);
73
1
        node.__set_case_expr(case_node);
74
1
        *cloned_expr = VCaseExpr::create_shared(node);
75
1
        return Status::OK();
76
1
    }
77
78
private:
79
    template <typename IndexType, typename ColumnType>
80
    ColumnPtr _execute_update_result_impl(const IndexType* then_idx,
81
                                          std::vector<ColumnPtr>& then_columns,
82
2.07k
                                          size_t rows_count) const {
83
2.07k
        auto result_column_ptr = data_type()->create_column();
84
2.07k
        result_column_ptr->reserve(rows_count);
85
        if constexpr (std::is_same_v<ColumnType, ColumnString> ||
86
                      std::is_same_v<ColumnType, ColumnBitmap> ||
87
                      std::is_same_v<ColumnType, ColumnArray> ||
88
                      std::is_same_v<ColumnType, ColumnMap> ||
89
                      std::is_same_v<ColumnType, ColumnStruct> ||
90
                      std::is_same_v<ColumnType, ColumnVariant> ||
91
                      std::is_same_v<ColumnType, ColumnVariantV2> ||
92
                      std::is_same_v<ColumnType, ColumnHLL> ||
93
                      std::is_same_v<ColumnType, ColumnQuantileState> ||
94
                      std::is_same_v<ColumnType, ColumnIPv4> ||
95
218
                      std::is_same_v<ColumnType, ColumnIPv6>) {
96
            // result_column and all then_column is not nullable.
97
            // can't simd when type is string.
98
218
            if (data_type()->is_nullable()) {
99
160
                update_result_normal<IndexType, ColumnType, true>(result_column_ptr, then_idx,
100
160
                                                                  then_columns, rows_count);
101
160
            } else {
102
58
                update_result_normal<IndexType, ColumnType, false>(result_column_ptr, then_idx,
103
58
                                                                   then_columns, rows_count);
104
58
            }
105
1.85k
        } else if (data_type()->is_nullable()) {
106
            // result_column and all then_column is nullable.
107
64
            update_result_normal<IndexType, ColumnType, true>(result_column_ptr, then_idx,
108
64
                                                              then_columns, rows_count);
109
1.79k
        } else {
110
1.79k
            update_result_auto_simd<IndexType, ColumnType>(result_column_ptr, then_idx,
111
1.79k
                                                           then_columns, rows_count);
112
1.79k
        }
113
2.07k
        return result_column_ptr;
114
2.07k
    }
Unexecuted instantiation: _ZNK5doris9VCaseExpr27_execute_update_result_implItNS_12ColumnVectorILNS_13PrimitiveTypeE2EEEEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EEPKT_RSt6vectorIS9_SaIS9_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr27_execute_update_result_implItNS_12ColumnVectorILNS_13PrimitiveTypeE3EEEEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EEPKT_RSt6vectorIS9_SaIS9_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr27_execute_update_result_implItNS_12ColumnVectorILNS_13PrimitiveTypeE4EEEEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EEPKT_RSt6vectorIS9_SaIS9_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr27_execute_update_result_implItNS_12ColumnVectorILNS_13PrimitiveTypeE5EEEEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EEPKT_RSt6vectorIS9_SaIS9_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr27_execute_update_result_implItNS_12ColumnVectorILNS_13PrimitiveTypeE6EEEEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EEPKT_RSt6vectorIS9_SaIS9_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr27_execute_update_result_implItNS_12ColumnVectorILNS_13PrimitiveTypeE7EEEEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EEPKT_RSt6vectorIS9_SaIS9_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr27_execute_update_result_implItNS_12ColumnVectorILNS_13PrimitiveTypeE8EEEEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EEPKT_RSt6vectorIS9_SaIS9_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr27_execute_update_result_implItNS_12ColumnVectorILNS_13PrimitiveTypeE9EEEEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EEPKT_RSt6vectorIS9_SaIS9_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr27_execute_update_result_implItNS_13ColumnDecimalILNS_13PrimitiveTypeE28EEEEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EEPKT_RSt6vectorIS9_SaIS9_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr27_execute_update_result_implItNS_13ColumnDecimalILNS_13PrimitiveTypeE29EEEEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EEPKT_RSt6vectorIS9_SaIS9_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr27_execute_update_result_implItNS_13ColumnDecimalILNS_13PrimitiveTypeE35EEEEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EEPKT_RSt6vectorIS9_SaIS9_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr27_execute_update_result_implItNS_13ColumnDecimalILNS_13PrimitiveTypeE30EEEEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EEPKT_RSt6vectorIS9_SaIS9_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr27_execute_update_result_implItNS_13ColumnDecimalILNS_13PrimitiveTypeE20EEEEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EEPKT_RSt6vectorIS9_SaIS9_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr27_execute_update_result_implItNS_9ColumnStrIjEEEENS_3COWINS_7IColumnEE13immutable_ptrIS5_EEPKT_RSt6vectorIS8_SaIS8_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr27_execute_update_result_implItNS_12ColumnVectorILNS_13PrimitiveTypeE11EEEEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EEPKT_RSt6vectorIS9_SaIS9_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr27_execute_update_result_implItNS_12ColumnVectorILNS_13PrimitiveTypeE12EEEEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EEPKT_RSt6vectorIS9_SaIS9_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr27_execute_update_result_implItNS_12ColumnVectorILNS_13PrimitiveTypeE25EEEEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EEPKT_RSt6vectorIS9_SaIS9_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr27_execute_update_result_implItNS_12ColumnVectorILNS_13PrimitiveTypeE26EEEEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EEPKT_RSt6vectorIS9_SaIS9_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr27_execute_update_result_implItNS_12ColumnVectorILNS_13PrimitiveTypeE43EEEEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EEPKT_RSt6vectorIS9_SaIS9_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr27_execute_update_result_implItNS_12ColumnVectorILNS_13PrimitiveTypeE42EEEEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EEPKT_RSt6vectorIS9_SaIS9_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr27_execute_update_result_implItNS_12ColumnVectorILNS_13PrimitiveTypeE37EEEEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EEPKT_RSt6vectorIS9_SaIS9_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr27_execute_update_result_implItNS_12ColumnVectorILNS_13PrimitiveTypeE36EEEEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EEPKT_RSt6vectorIS9_SaIS9_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr27_execute_update_result_implItNS_11ColumnArrayEEENS_3COWINS_7IColumnEE13immutable_ptrIS4_EEPKT_RSt6vectorIS7_SaIS7_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr27_execute_update_result_implItNS_9ColumnMapEEENS_3COWINS_7IColumnEE13immutable_ptrIS4_EEPKT_RSt6vectorIS7_SaIS7_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr27_execute_update_result_implItNS_12ColumnStructEEENS_3COWINS_7IColumnEE13immutable_ptrIS4_EEPKT_RSt6vectorIS7_SaIS7_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr27_execute_update_result_implItNS_17ColumnComplexTypeILNS_13PrimitiveTypeE22EEEEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EEPKT_RSt6vectorIS9_SaIS9_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr27_execute_update_result_implItNS_17ColumnComplexTypeILNS_13PrimitiveTypeE19EEEEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EEPKT_RSt6vectorIS9_SaIS9_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr27_execute_update_result_implItNS_17ColumnComplexTypeILNS_13PrimitiveTypeE24EEEEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EEPKT_RSt6vectorIS9_SaIS9_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr27_execute_update_result_implItNS_15ColumnVariantV2EEENS_3COWINS_7IColumnEE13immutable_ptrIS4_EEPKT_RSt6vectorIS7_SaIS7_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr27_execute_update_result_implItNS_13ColumnVariantEEENS_3COWINS_7IColumnEE13immutable_ptrIS4_EEPKT_RSt6vectorIS7_SaIS7_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr27_execute_update_result_implIhNS_12ColumnVectorILNS_13PrimitiveTypeE2EEEEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EEPKT_RSt6vectorIS9_SaIS9_EEm
_ZNK5doris9VCaseExpr27_execute_update_result_implIhNS_12ColumnVectorILNS_13PrimitiveTypeE3EEEEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EEPKT_RSt6vectorIS9_SaIS9_EEm
Line
Count
Source
82
1.67k
                                          size_t rows_count) const {
83
1.67k
        auto result_column_ptr = data_type()->create_column();
84
1.67k
        result_column_ptr->reserve(rows_count);
85
        if constexpr (std::is_same_v<ColumnType, ColumnString> ||
86
                      std::is_same_v<ColumnType, ColumnBitmap> ||
87
                      std::is_same_v<ColumnType, ColumnArray> ||
88
                      std::is_same_v<ColumnType, ColumnMap> ||
89
                      std::is_same_v<ColumnType, ColumnStruct> ||
90
                      std::is_same_v<ColumnType, ColumnVariant> ||
91
                      std::is_same_v<ColumnType, ColumnVariantV2> ||
92
                      std::is_same_v<ColumnType, ColumnHLL> ||
93
                      std::is_same_v<ColumnType, ColumnQuantileState> ||
94
                      std::is_same_v<ColumnType, ColumnIPv4> ||
95
                      std::is_same_v<ColumnType, ColumnIPv6>) {
96
            // result_column and all then_column is not nullable.
97
            // can't simd when type is string.
98
            if (data_type()->is_nullable()) {
99
                update_result_normal<IndexType, ColumnType, true>(result_column_ptr, then_idx,
100
                                                                  then_columns, rows_count);
101
            } else {
102
                update_result_normal<IndexType, ColumnType, false>(result_column_ptr, then_idx,
103
                                                                   then_columns, rows_count);
104
            }
105
1.67k
        } else if (data_type()->is_nullable()) {
106
            // result_column and all then_column is nullable.
107
4
            update_result_normal<IndexType, ColumnType, true>(result_column_ptr, then_idx,
108
4
                                                              then_columns, rows_count);
109
1.66k
        } else {
110
1.66k
            update_result_auto_simd<IndexType, ColumnType>(result_column_ptr, then_idx,
111
1.66k
                                                           then_columns, rows_count);
112
1.66k
        }
113
1.67k
        return result_column_ptr;
114
1.67k
    }
Unexecuted instantiation: _ZNK5doris9VCaseExpr27_execute_update_result_implIhNS_12ColumnVectorILNS_13PrimitiveTypeE4EEEEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EEPKT_RSt6vectorIS9_SaIS9_EEm
_ZNK5doris9VCaseExpr27_execute_update_result_implIhNS_12ColumnVectorILNS_13PrimitiveTypeE5EEEEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EEPKT_RSt6vectorIS9_SaIS9_EEm
Line
Count
Source
82
38
                                          size_t rows_count) const {
83
38
        auto result_column_ptr = data_type()->create_column();
84
38
        result_column_ptr->reserve(rows_count);
85
        if constexpr (std::is_same_v<ColumnType, ColumnString> ||
86
                      std::is_same_v<ColumnType, ColumnBitmap> ||
87
                      std::is_same_v<ColumnType, ColumnArray> ||
88
                      std::is_same_v<ColumnType, ColumnMap> ||
89
                      std::is_same_v<ColumnType, ColumnStruct> ||
90
                      std::is_same_v<ColumnType, ColumnVariant> ||
91
                      std::is_same_v<ColumnType, ColumnVariantV2> ||
92
                      std::is_same_v<ColumnType, ColumnHLL> ||
93
                      std::is_same_v<ColumnType, ColumnQuantileState> ||
94
                      std::is_same_v<ColumnType, ColumnIPv4> ||
95
                      std::is_same_v<ColumnType, ColumnIPv6>) {
96
            // result_column and all then_column is not nullable.
97
            // can't simd when type is string.
98
            if (data_type()->is_nullable()) {
99
                update_result_normal<IndexType, ColumnType, true>(result_column_ptr, then_idx,
100
                                                                  then_columns, rows_count);
101
            } else {
102
                update_result_normal<IndexType, ColumnType, false>(result_column_ptr, then_idx,
103
                                                                   then_columns, rows_count);
104
            }
105
38
        } else if (data_type()->is_nullable()) {
106
            // result_column and all then_column is nullable.
107
38
            update_result_normal<IndexType, ColumnType, true>(result_column_ptr, then_idx,
108
38
                                                              then_columns, rows_count);
109
38
        } else {
110
0
            update_result_auto_simd<IndexType, ColumnType>(result_column_ptr, then_idx,
111
0
                                                           then_columns, rows_count);
112
0
        }
113
38
        return result_column_ptr;
114
38
    }
_ZNK5doris9VCaseExpr27_execute_update_result_implIhNS_12ColumnVectorILNS_13PrimitiveTypeE6EEEEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EEPKT_RSt6vectorIS9_SaIS9_EEm
Line
Count
Source
82
134
                                          size_t rows_count) const {
83
134
        auto result_column_ptr = data_type()->create_column();
84
134
        result_column_ptr->reserve(rows_count);
85
        if constexpr (std::is_same_v<ColumnType, ColumnString> ||
86
                      std::is_same_v<ColumnType, ColumnBitmap> ||
87
                      std::is_same_v<ColumnType, ColumnArray> ||
88
                      std::is_same_v<ColumnType, ColumnMap> ||
89
                      std::is_same_v<ColumnType, ColumnStruct> ||
90
                      std::is_same_v<ColumnType, ColumnVariant> ||
91
                      std::is_same_v<ColumnType, ColumnVariantV2> ||
92
                      std::is_same_v<ColumnType, ColumnHLL> ||
93
                      std::is_same_v<ColumnType, ColumnQuantileState> ||
94
                      std::is_same_v<ColumnType, ColumnIPv4> ||
95
                      std::is_same_v<ColumnType, ColumnIPv6>) {
96
            // result_column and all then_column is not nullable.
97
            // can't simd when type is string.
98
            if (data_type()->is_nullable()) {
99
                update_result_normal<IndexType, ColumnType, true>(result_column_ptr, then_idx,
100
                                                                  then_columns, rows_count);
101
            } else {
102
                update_result_normal<IndexType, ColumnType, false>(result_column_ptr, then_idx,
103
                                                                   then_columns, rows_count);
104
            }
105
134
        } else if (data_type()->is_nullable()) {
106
            // result_column and all then_column is nullable.
107
12
            update_result_normal<IndexType, ColumnType, true>(result_column_ptr, then_idx,
108
12
                                                              then_columns, rows_count);
109
122
        } else {
110
122
            update_result_auto_simd<IndexType, ColumnType>(result_column_ptr, then_idx,
111
122
                                                           then_columns, rows_count);
112
122
        }
113
134
        return result_column_ptr;
114
134
    }
Unexecuted instantiation: _ZNK5doris9VCaseExpr27_execute_update_result_implIhNS_12ColumnVectorILNS_13PrimitiveTypeE7EEEEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EEPKT_RSt6vectorIS9_SaIS9_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr27_execute_update_result_implIhNS_12ColumnVectorILNS_13PrimitiveTypeE8EEEEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EEPKT_RSt6vectorIS9_SaIS9_EEm
_ZNK5doris9VCaseExpr27_execute_update_result_implIhNS_12ColumnVectorILNS_13PrimitiveTypeE9EEEEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EEPKT_RSt6vectorIS9_SaIS9_EEm
Line
Count
Source
82
3
                                          size_t rows_count) const {
83
3
        auto result_column_ptr = data_type()->create_column();
84
3
        result_column_ptr->reserve(rows_count);
85
        if constexpr (std::is_same_v<ColumnType, ColumnString> ||
86
                      std::is_same_v<ColumnType, ColumnBitmap> ||
87
                      std::is_same_v<ColumnType, ColumnArray> ||
88
                      std::is_same_v<ColumnType, ColumnMap> ||
89
                      std::is_same_v<ColumnType, ColumnStruct> ||
90
                      std::is_same_v<ColumnType, ColumnVariant> ||
91
                      std::is_same_v<ColumnType, ColumnVariantV2> ||
92
                      std::is_same_v<ColumnType, ColumnHLL> ||
93
                      std::is_same_v<ColumnType, ColumnQuantileState> ||
94
                      std::is_same_v<ColumnType, ColumnIPv4> ||
95
                      std::is_same_v<ColumnType, ColumnIPv6>) {
96
            // result_column and all then_column is not nullable.
97
            // can't simd when type is string.
98
            if (data_type()->is_nullable()) {
99
                update_result_normal<IndexType, ColumnType, true>(result_column_ptr, then_idx,
100
                                                                  then_columns, rows_count);
101
            } else {
102
                update_result_normal<IndexType, ColumnType, false>(result_column_ptr, then_idx,
103
                                                                   then_columns, rows_count);
104
            }
105
3
        } else if (data_type()->is_nullable()) {
106
            // result_column and all then_column is nullable.
107
3
            update_result_normal<IndexType, ColumnType, true>(result_column_ptr, then_idx,
108
3
                                                              then_columns, rows_count);
109
3
        } else {
110
0
            update_result_auto_simd<IndexType, ColumnType>(result_column_ptr, then_idx,
111
0
                                                           then_columns, rows_count);
112
0
        }
113
3
        return result_column_ptr;
114
3
    }
Unexecuted instantiation: _ZNK5doris9VCaseExpr27_execute_update_result_implIhNS_13ColumnDecimalILNS_13PrimitiveTypeE28EEEEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EEPKT_RSt6vectorIS9_SaIS9_EEm
_ZNK5doris9VCaseExpr27_execute_update_result_implIhNS_13ColumnDecimalILNS_13PrimitiveTypeE29EEEEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EEPKT_RSt6vectorIS9_SaIS9_EEm
Line
Count
Source
82
1
                                          size_t rows_count) const {
83
1
        auto result_column_ptr = data_type()->create_column();
84
1
        result_column_ptr->reserve(rows_count);
85
        if constexpr (std::is_same_v<ColumnType, ColumnString> ||
86
                      std::is_same_v<ColumnType, ColumnBitmap> ||
87
                      std::is_same_v<ColumnType, ColumnArray> ||
88
                      std::is_same_v<ColumnType, ColumnMap> ||
89
                      std::is_same_v<ColumnType, ColumnStruct> ||
90
                      std::is_same_v<ColumnType, ColumnVariant> ||
91
                      std::is_same_v<ColumnType, ColumnVariantV2> ||
92
                      std::is_same_v<ColumnType, ColumnHLL> ||
93
                      std::is_same_v<ColumnType, ColumnQuantileState> ||
94
                      std::is_same_v<ColumnType, ColumnIPv4> ||
95
                      std::is_same_v<ColumnType, ColumnIPv6>) {
96
            // result_column and all then_column is not nullable.
97
            // can't simd when type is string.
98
            if (data_type()->is_nullable()) {
99
                update_result_normal<IndexType, ColumnType, true>(result_column_ptr, then_idx,
100
                                                                  then_columns, rows_count);
101
            } else {
102
                update_result_normal<IndexType, ColumnType, false>(result_column_ptr, then_idx,
103
                                                                   then_columns, rows_count);
104
            }
105
1
        } else if (data_type()->is_nullable()) {
106
            // result_column and all then_column is nullable.
107
1
            update_result_normal<IndexType, ColumnType, true>(result_column_ptr, then_idx,
108
1
                                                              then_columns, rows_count);
109
1
        } else {
110
0
            update_result_auto_simd<IndexType, ColumnType>(result_column_ptr, then_idx,
111
0
                                                           then_columns, rows_count);
112
0
        }
113
1
        return result_column_ptr;
114
1
    }
_ZNK5doris9VCaseExpr27_execute_update_result_implIhNS_13ColumnDecimalILNS_13PrimitiveTypeE35EEEEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EEPKT_RSt6vectorIS9_SaIS9_EEm
Line
Count
Source
82
2
                                          size_t rows_count) const {
83
2
        auto result_column_ptr = data_type()->create_column();
84
2
        result_column_ptr->reserve(rows_count);
85
        if constexpr (std::is_same_v<ColumnType, ColumnString> ||
86
                      std::is_same_v<ColumnType, ColumnBitmap> ||
87
                      std::is_same_v<ColumnType, ColumnArray> ||
88
                      std::is_same_v<ColumnType, ColumnMap> ||
89
                      std::is_same_v<ColumnType, ColumnStruct> ||
90
                      std::is_same_v<ColumnType, ColumnVariant> ||
91
                      std::is_same_v<ColumnType, ColumnVariantV2> ||
92
                      std::is_same_v<ColumnType, ColumnHLL> ||
93
                      std::is_same_v<ColumnType, ColumnQuantileState> ||
94
                      std::is_same_v<ColumnType, ColumnIPv4> ||
95
                      std::is_same_v<ColumnType, ColumnIPv6>) {
96
            // result_column and all then_column is not nullable.
97
            // can't simd when type is string.
98
            if (data_type()->is_nullable()) {
99
                update_result_normal<IndexType, ColumnType, true>(result_column_ptr, then_idx,
100
                                                                  then_columns, rows_count);
101
            } else {
102
                update_result_normal<IndexType, ColumnType, false>(result_column_ptr, then_idx,
103
                                                                   then_columns, rows_count);
104
            }
105
2
        } else if (data_type()->is_nullable()) {
106
            // result_column and all then_column is nullable.
107
2
            update_result_normal<IndexType, ColumnType, true>(result_column_ptr, then_idx,
108
2
                                                              then_columns, rows_count);
109
2
        } else {
110
0
            update_result_auto_simd<IndexType, ColumnType>(result_column_ptr, then_idx,
111
0
                                                           then_columns, rows_count);
112
0
        }
113
2
        return result_column_ptr;
114
2
    }
_ZNK5doris9VCaseExpr27_execute_update_result_implIhNS_13ColumnDecimalILNS_13PrimitiveTypeE30EEEEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EEPKT_RSt6vectorIS9_SaIS9_EEm
Line
Count
Source
82
1
                                          size_t rows_count) const {
83
1
        auto result_column_ptr = data_type()->create_column();
84
1
        result_column_ptr->reserve(rows_count);
85
        if constexpr (std::is_same_v<ColumnType, ColumnString> ||
86
                      std::is_same_v<ColumnType, ColumnBitmap> ||
87
                      std::is_same_v<ColumnType, ColumnArray> ||
88
                      std::is_same_v<ColumnType, ColumnMap> ||
89
                      std::is_same_v<ColumnType, ColumnStruct> ||
90
                      std::is_same_v<ColumnType, ColumnVariant> ||
91
                      std::is_same_v<ColumnType, ColumnVariantV2> ||
92
                      std::is_same_v<ColumnType, ColumnHLL> ||
93
                      std::is_same_v<ColumnType, ColumnQuantileState> ||
94
                      std::is_same_v<ColumnType, ColumnIPv4> ||
95
                      std::is_same_v<ColumnType, ColumnIPv6>) {
96
            // result_column and all then_column is not nullable.
97
            // can't simd when type is string.
98
            if (data_type()->is_nullable()) {
99
                update_result_normal<IndexType, ColumnType, true>(result_column_ptr, then_idx,
100
                                                                  then_columns, rows_count);
101
            } else {
102
                update_result_normal<IndexType, ColumnType, false>(result_column_ptr, then_idx,
103
                                                                   then_columns, rows_count);
104
            }
105
1
        } else if (data_type()->is_nullable()) {
106
            // result_column and all then_column is nullable.
107
1
            update_result_normal<IndexType, ColumnType, true>(result_column_ptr, then_idx,
108
1
                                                              then_columns, rows_count);
109
1
        } else {
110
0
            update_result_auto_simd<IndexType, ColumnType>(result_column_ptr, then_idx,
111
0
                                                           then_columns, rows_count);
112
0
        }
113
1
        return result_column_ptr;
114
1
    }
Unexecuted instantiation: _ZNK5doris9VCaseExpr27_execute_update_result_implIhNS_13ColumnDecimalILNS_13PrimitiveTypeE20EEEEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EEPKT_RSt6vectorIS9_SaIS9_EEm
_ZNK5doris9VCaseExpr27_execute_update_result_implIhNS_9ColumnStrIjEEEENS_3COWINS_7IColumnEE13immutable_ptrIS5_EEPKT_RSt6vectorIS8_SaIS8_EEm
Line
Count
Source
82
207
                                          size_t rows_count) const {
83
207
        auto result_column_ptr = data_type()->create_column();
84
207
        result_column_ptr->reserve(rows_count);
85
        if constexpr (std::is_same_v<ColumnType, ColumnString> ||
86
                      std::is_same_v<ColumnType, ColumnBitmap> ||
87
                      std::is_same_v<ColumnType, ColumnArray> ||
88
                      std::is_same_v<ColumnType, ColumnMap> ||
89
                      std::is_same_v<ColumnType, ColumnStruct> ||
90
                      std::is_same_v<ColumnType, ColumnVariant> ||
91
                      std::is_same_v<ColumnType, ColumnVariantV2> ||
92
                      std::is_same_v<ColumnType, ColumnHLL> ||
93
                      std::is_same_v<ColumnType, ColumnQuantileState> ||
94
                      std::is_same_v<ColumnType, ColumnIPv4> ||
95
207
                      std::is_same_v<ColumnType, ColumnIPv6>) {
96
            // result_column and all then_column is not nullable.
97
            // can't simd when type is string.
98
207
            if (data_type()->is_nullable()) {
99
149
                update_result_normal<IndexType, ColumnType, true>(result_column_ptr, then_idx,
100
149
                                                                  then_columns, rows_count);
101
149
            } else {
102
58
                update_result_normal<IndexType, ColumnType, false>(result_column_ptr, then_idx,
103
58
                                                                   then_columns, rows_count);
104
58
            }
105
        } else if (data_type()->is_nullable()) {
106
            // result_column and all then_column is nullable.
107
            update_result_normal<IndexType, ColumnType, true>(result_column_ptr, then_idx,
108
                                                              then_columns, rows_count);
109
        } else {
110
            update_result_auto_simd<IndexType, ColumnType>(result_column_ptr, then_idx,
111
                                                           then_columns, rows_count);
112
        }
113
207
        return result_column_ptr;
114
207
    }
Unexecuted instantiation: _ZNK5doris9VCaseExpr27_execute_update_result_implIhNS_12ColumnVectorILNS_13PrimitiveTypeE11EEEEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EEPKT_RSt6vectorIS9_SaIS9_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr27_execute_update_result_implIhNS_12ColumnVectorILNS_13PrimitiveTypeE12EEEEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EEPKT_RSt6vectorIS9_SaIS9_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr27_execute_update_result_implIhNS_12ColumnVectorILNS_13PrimitiveTypeE25EEEEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EEPKT_RSt6vectorIS9_SaIS9_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr27_execute_update_result_implIhNS_12ColumnVectorILNS_13PrimitiveTypeE26EEEEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EEPKT_RSt6vectorIS9_SaIS9_EEm
_ZNK5doris9VCaseExpr27_execute_update_result_implIhNS_12ColumnVectorILNS_13PrimitiveTypeE43EEEEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EEPKT_RSt6vectorIS9_SaIS9_EEm
Line
Count
Source
82
3
                                          size_t rows_count) const {
83
3
        auto result_column_ptr = data_type()->create_column();
84
3
        result_column_ptr->reserve(rows_count);
85
        if constexpr (std::is_same_v<ColumnType, ColumnString> ||
86
                      std::is_same_v<ColumnType, ColumnBitmap> ||
87
                      std::is_same_v<ColumnType, ColumnArray> ||
88
                      std::is_same_v<ColumnType, ColumnMap> ||
89
                      std::is_same_v<ColumnType, ColumnStruct> ||
90
                      std::is_same_v<ColumnType, ColumnVariant> ||
91
                      std::is_same_v<ColumnType, ColumnVariantV2> ||
92
                      std::is_same_v<ColumnType, ColumnHLL> ||
93
                      std::is_same_v<ColumnType, ColumnQuantileState> ||
94
                      std::is_same_v<ColumnType, ColumnIPv4> ||
95
                      std::is_same_v<ColumnType, ColumnIPv6>) {
96
            // result_column and all then_column is not nullable.
97
            // can't simd when type is string.
98
            if (data_type()->is_nullable()) {
99
                update_result_normal<IndexType, ColumnType, true>(result_column_ptr, then_idx,
100
                                                                  then_columns, rows_count);
101
            } else {
102
                update_result_normal<IndexType, ColumnType, false>(result_column_ptr, then_idx,
103
                                                                   then_columns, rows_count);
104
            }
105
3
        } else if (data_type()->is_nullable()) {
106
            // result_column and all then_column is nullable.
107
3
            update_result_normal<IndexType, ColumnType, true>(result_column_ptr, then_idx,
108
3
                                                              then_columns, rows_count);
109
3
        } else {
110
0
            update_result_auto_simd<IndexType, ColumnType>(result_column_ptr, then_idx,
111
0
                                                           then_columns, rows_count);
112
0
        }
113
3
        return result_column_ptr;
114
3
    }
Unexecuted instantiation: _ZNK5doris9VCaseExpr27_execute_update_result_implIhNS_12ColumnVectorILNS_13PrimitiveTypeE42EEEEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EEPKT_RSt6vectorIS9_SaIS9_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr27_execute_update_result_implIhNS_12ColumnVectorILNS_13PrimitiveTypeE37EEEEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EEPKT_RSt6vectorIS9_SaIS9_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr27_execute_update_result_implIhNS_12ColumnVectorILNS_13PrimitiveTypeE36EEEEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EEPKT_RSt6vectorIS9_SaIS9_EEm
_ZNK5doris9VCaseExpr27_execute_update_result_implIhNS_11ColumnArrayEEENS_3COWINS_7IColumnEE13immutable_ptrIS4_EEPKT_RSt6vectorIS7_SaIS7_EEm
Line
Count
Source
82
1
                                          size_t rows_count) const {
83
1
        auto result_column_ptr = data_type()->create_column();
84
1
        result_column_ptr->reserve(rows_count);
85
        if constexpr (std::is_same_v<ColumnType, ColumnString> ||
86
                      std::is_same_v<ColumnType, ColumnBitmap> ||
87
                      std::is_same_v<ColumnType, ColumnArray> ||
88
                      std::is_same_v<ColumnType, ColumnMap> ||
89
                      std::is_same_v<ColumnType, ColumnStruct> ||
90
                      std::is_same_v<ColumnType, ColumnVariant> ||
91
                      std::is_same_v<ColumnType, ColumnVariantV2> ||
92
                      std::is_same_v<ColumnType, ColumnHLL> ||
93
                      std::is_same_v<ColumnType, ColumnQuantileState> ||
94
                      std::is_same_v<ColumnType, ColumnIPv4> ||
95
1
                      std::is_same_v<ColumnType, ColumnIPv6>) {
96
            // result_column and all then_column is not nullable.
97
            // can't simd when type is string.
98
1
            if (data_type()->is_nullable()) {
99
1
                update_result_normal<IndexType, ColumnType, true>(result_column_ptr, then_idx,
100
1
                                                                  then_columns, rows_count);
101
1
            } else {
102
0
                update_result_normal<IndexType, ColumnType, false>(result_column_ptr, then_idx,
103
0
                                                                   then_columns, rows_count);
104
0
            }
105
        } else if (data_type()->is_nullable()) {
106
            // result_column and all then_column is nullable.
107
            update_result_normal<IndexType, ColumnType, true>(result_column_ptr, then_idx,
108
                                                              then_columns, rows_count);
109
        } else {
110
            update_result_auto_simd<IndexType, ColumnType>(result_column_ptr, then_idx,
111
                                                           then_columns, rows_count);
112
        }
113
1
        return result_column_ptr;
114
1
    }
Unexecuted instantiation: _ZNK5doris9VCaseExpr27_execute_update_result_implIhNS_9ColumnMapEEENS_3COWINS_7IColumnEE13immutable_ptrIS4_EEPKT_RSt6vectorIS7_SaIS7_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr27_execute_update_result_implIhNS_12ColumnStructEEENS_3COWINS_7IColumnEE13immutable_ptrIS4_EEPKT_RSt6vectorIS7_SaIS7_EEm
_ZNK5doris9VCaseExpr27_execute_update_result_implIhNS_17ColumnComplexTypeILNS_13PrimitiveTypeE22EEEEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EEPKT_RSt6vectorIS9_SaIS9_EEm
Line
Count
Source
82
10
                                          size_t rows_count) const {
83
10
        auto result_column_ptr = data_type()->create_column();
84
10
        result_column_ptr->reserve(rows_count);
85
        if constexpr (std::is_same_v<ColumnType, ColumnString> ||
86
                      std::is_same_v<ColumnType, ColumnBitmap> ||
87
                      std::is_same_v<ColumnType, ColumnArray> ||
88
                      std::is_same_v<ColumnType, ColumnMap> ||
89
                      std::is_same_v<ColumnType, ColumnStruct> ||
90
                      std::is_same_v<ColumnType, ColumnVariant> ||
91
                      std::is_same_v<ColumnType, ColumnVariantV2> ||
92
                      std::is_same_v<ColumnType, ColumnHLL> ||
93
                      std::is_same_v<ColumnType, ColumnQuantileState> ||
94
                      std::is_same_v<ColumnType, ColumnIPv4> ||
95
10
                      std::is_same_v<ColumnType, ColumnIPv6>) {
96
            // result_column and all then_column is not nullable.
97
            // can't simd when type is string.
98
10
            if (data_type()->is_nullable()) {
99
10
                update_result_normal<IndexType, ColumnType, true>(result_column_ptr, then_idx,
100
10
                                                                  then_columns, rows_count);
101
10
            } else {
102
0
                update_result_normal<IndexType, ColumnType, false>(result_column_ptr, then_idx,
103
0
                                                                   then_columns, rows_count);
104
0
            }
105
        } else if (data_type()->is_nullable()) {
106
            // result_column and all then_column is nullable.
107
            update_result_normal<IndexType, ColumnType, true>(result_column_ptr, then_idx,
108
                                                              then_columns, rows_count);
109
        } else {
110
            update_result_auto_simd<IndexType, ColumnType>(result_column_ptr, then_idx,
111
                                                           then_columns, rows_count);
112
        }
113
10
        return result_column_ptr;
114
10
    }
Unexecuted instantiation: _ZNK5doris9VCaseExpr27_execute_update_result_implIhNS_17ColumnComplexTypeILNS_13PrimitiveTypeE19EEEEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EEPKT_RSt6vectorIS9_SaIS9_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr27_execute_update_result_implIhNS_17ColumnComplexTypeILNS_13PrimitiveTypeE24EEEEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EEPKT_RSt6vectorIS9_SaIS9_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr27_execute_update_result_implIhNS_15ColumnVariantV2EEENS_3COWINS_7IColumnEE13immutable_ptrIS4_EEPKT_RSt6vectorIS7_SaIS7_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr27_execute_update_result_implIhNS_13ColumnVariantEEENS_3COWINS_7IColumnEE13immutable_ptrIS4_EEPKT_RSt6vectorIS7_SaIS7_EEm
115
116
    template <typename IndexType>
117
    ColumnPtr _execute_update_result(const IndexType* then_idx,
118
                                     std::vector<ColumnPtr>& then_columns,
119
2.07k
                                     size_t rows_count) const {
120
2.07k
#define CASE_TYPE(ptype, coltype) \
121
2.07k
    case PrimitiveType::ptype:    \
122
2.07k
        return _execute_update_result_impl<IndexType, coltype>(then_idx, then_columns, rows_count);
123
124
2.07k
        switch (data_type()->get_primitive_type()) {
125
0
            CASE_TYPE(TYPE_BOOLEAN, ColumnUInt8)
126
1.67k
            CASE_TYPE(TYPE_TINYINT, ColumnInt8)
127
0
            CASE_TYPE(TYPE_SMALLINT, ColumnInt16)
128
38
            CASE_TYPE(TYPE_INT, ColumnInt32)
129
134
            CASE_TYPE(TYPE_BIGINT, ColumnInt64)
130
0
            CASE_TYPE(TYPE_LARGEINT, ColumnInt128)
131
0
            CASE_TYPE(TYPE_FLOAT, ColumnFloat32)
132
3
            CASE_TYPE(TYPE_DOUBLE, ColumnFloat64)
133
0
            CASE_TYPE(TYPE_DECIMAL32, ColumnDecimal32)
134
1
            CASE_TYPE(TYPE_DECIMAL64, ColumnDecimal64)
135
2
            CASE_TYPE(TYPE_DECIMAL256, ColumnDecimal256)
136
1
            CASE_TYPE(TYPE_DECIMAL128I, ColumnDecimal128V3)
137
0
            CASE_TYPE(TYPE_DECIMALV2, ColumnDecimal128V2)
138
32
            CASE_TYPE(TYPE_STRING, ColumnString)
139
0
            CASE_TYPE(TYPE_CHAR, ColumnString)
140
175
            CASE_TYPE(TYPE_VARCHAR, ColumnString)
141
0
            CASE_TYPE(TYPE_JSONB, ColumnString)
142
0
            CASE_TYPE(TYPE_DATE, ColumnDate)
143
0
            CASE_TYPE(TYPE_DATETIME, ColumnDateTime)
144
0
            CASE_TYPE(TYPE_DATEV2, ColumnDateV2)
145
0
            CASE_TYPE(TYPE_DATETIMEV2, ColumnDateTimeV2)
146
3
            CASE_TYPE(TYPE_TIMESTAMP_NS, ColumnTimeStampNs)
147
0
            CASE_TYPE(TYPE_TIMESTAMPTZ, ColumnTimeStampTz)
148
0
            CASE_TYPE(TYPE_IPV6, ColumnIPv6)
149
0
            CASE_TYPE(TYPE_IPV4, ColumnIPv4)
150
1
            CASE_TYPE(TYPE_ARRAY, ColumnArray)
151
0
            CASE_TYPE(TYPE_MAP, ColumnMap)
152
0
            CASE_TYPE(TYPE_STRUCT, ColumnStruct)
153
10
            CASE_TYPE(TYPE_BITMAP, ColumnBitmap)
154
0
            CASE_TYPE(TYPE_HLL, ColumnHLL)
155
0
            CASE_TYPE(TYPE_QUANTILE_STATE, ColumnQuantileState)
156
0
        case PrimitiveType::TYPE_VARIANT: {
157
0
            const IDataType* variant_type = remove_nullable(data_type()).get();
158
0
            if (dynamic_cast<const DataTypeVariantV2*>(variant_type) != nullptr) {
159
0
                return _execute_update_result_impl<IndexType, ColumnVariantV2>(
160
0
                        then_idx, then_columns, rows_count);
161
0
            }
162
0
            DORIS_CHECK(dynamic_cast<const DataTypeVariant*>(variant_type) != nullptr);
163
0
            return _execute_update_result_impl<IndexType, ColumnVariant>(then_idx, then_columns,
164
0
                                                                         rows_count);
165
0
        }
166
0
        default:
167
0
            throw Exception(ErrorCode::NOT_IMPLEMENTED_ERROR, "argument_type {} not supported",
168
0
                            data_type()->get_name());
169
2.07k
        }
170
2.07k
#undef CASE_TYPE
171
2.07k
    }
Unexecuted instantiation: _ZNK5doris9VCaseExpr22_execute_update_resultItEENS_3COWINS_7IColumnEE13immutable_ptrIS3_EEPKT_RSt6vectorIS6_SaIS6_EEm
_ZNK5doris9VCaseExpr22_execute_update_resultIhEENS_3COWINS_7IColumnEE13immutable_ptrIS3_EEPKT_RSt6vectorIS6_SaIS6_EEm
Line
Count
Source
119
2.07k
                                     size_t rows_count) const {
120
2.07k
#define CASE_TYPE(ptype, coltype) \
121
2.07k
    case PrimitiveType::ptype:    \
122
2.07k
        return _execute_update_result_impl<IndexType, coltype>(then_idx, then_columns, rows_count);
123
124
2.07k
        switch (data_type()->get_primitive_type()) {
125
0
            CASE_TYPE(TYPE_BOOLEAN, ColumnUInt8)
126
1.67k
            CASE_TYPE(TYPE_TINYINT, ColumnInt8)
127
0
            CASE_TYPE(TYPE_SMALLINT, ColumnInt16)
128
38
            CASE_TYPE(TYPE_INT, ColumnInt32)
129
134
            CASE_TYPE(TYPE_BIGINT, ColumnInt64)
130
0
            CASE_TYPE(TYPE_LARGEINT, ColumnInt128)
131
0
            CASE_TYPE(TYPE_FLOAT, ColumnFloat32)
132
3
            CASE_TYPE(TYPE_DOUBLE, ColumnFloat64)
133
0
            CASE_TYPE(TYPE_DECIMAL32, ColumnDecimal32)
134
1
            CASE_TYPE(TYPE_DECIMAL64, ColumnDecimal64)
135
2
            CASE_TYPE(TYPE_DECIMAL256, ColumnDecimal256)
136
1
            CASE_TYPE(TYPE_DECIMAL128I, ColumnDecimal128V3)
137
0
            CASE_TYPE(TYPE_DECIMALV2, ColumnDecimal128V2)
138
32
            CASE_TYPE(TYPE_STRING, ColumnString)
139
0
            CASE_TYPE(TYPE_CHAR, ColumnString)
140
175
            CASE_TYPE(TYPE_VARCHAR, ColumnString)
141
0
            CASE_TYPE(TYPE_JSONB, ColumnString)
142
0
            CASE_TYPE(TYPE_DATE, ColumnDate)
143
0
            CASE_TYPE(TYPE_DATETIME, ColumnDateTime)
144
0
            CASE_TYPE(TYPE_DATEV2, ColumnDateV2)
145
0
            CASE_TYPE(TYPE_DATETIMEV2, ColumnDateTimeV2)
146
3
            CASE_TYPE(TYPE_TIMESTAMP_NS, ColumnTimeStampNs)
147
0
            CASE_TYPE(TYPE_TIMESTAMPTZ, ColumnTimeStampTz)
148
0
            CASE_TYPE(TYPE_IPV6, ColumnIPv6)
149
0
            CASE_TYPE(TYPE_IPV4, ColumnIPv4)
150
1
            CASE_TYPE(TYPE_ARRAY, ColumnArray)
151
0
            CASE_TYPE(TYPE_MAP, ColumnMap)
152
0
            CASE_TYPE(TYPE_STRUCT, ColumnStruct)
153
10
            CASE_TYPE(TYPE_BITMAP, ColumnBitmap)
154
0
            CASE_TYPE(TYPE_HLL, ColumnHLL)
155
0
            CASE_TYPE(TYPE_QUANTILE_STATE, ColumnQuantileState)
156
0
        case PrimitiveType::TYPE_VARIANT: {
157
0
            const IDataType* variant_type = remove_nullable(data_type()).get();
158
0
            if (dynamic_cast<const DataTypeVariantV2*>(variant_type) != nullptr) {
159
0
                return _execute_update_result_impl<IndexType, ColumnVariantV2>(
160
0
                        then_idx, then_columns, rows_count);
161
0
            }
162
0
            DORIS_CHECK(dynamic_cast<const DataTypeVariant*>(variant_type) != nullptr);
163
0
            return _execute_update_result_impl<IndexType, ColumnVariant>(then_idx, then_columns,
164
0
                                                                         rows_count);
165
0
        }
166
0
        default:
167
0
            throw Exception(ErrorCode::NOT_IMPLEMENTED_ERROR, "argument_type {} not supported",
168
0
                            data_type()->get_name());
169
2.07k
        }
170
2.07k
#undef CASE_TYPE
171
2.07k
    }
172
173
    template <typename IndexType, typename ColumnType, bool then_null>
174
    void update_result_normal(MutableColumnPtr& result_column_ptr,
175
                              const IndexType* __restrict then_idx,
176
282
                              std::vector<ColumnPtr>& then_columns, size_t rows_count) const {
177
282
        std::vector<ColumnPtr> raw_then_columns(then_columns.size());
178
282
        std::vector<uint8_t> is_consts(then_columns.size());
179
282
        std::vector<uint8_t> is_nullable(then_columns.size());
180
1.61k
        for (size_t i = 0; i < then_columns.size(); i++) {
181
1.33k
            if (!then_columns[i]) {
182
26
                continue;
183
26
            }
184
1.31k
            std::tie(raw_then_columns[i], is_consts[i]) = unpack_if_const(then_columns[i]);
185
1.31k
            is_nullable[i] = is_column_nullable(*raw_then_columns[i]);
186
1.31k
        }
187
188
282
        auto* raw_result_column = result_column_ptr.get();
189
4.62k
        for (int row_idx = 0; row_idx < rows_count; row_idx++) {
190
4.34k
            if (!_has_else_expr && !then_idx[row_idx]) {
191
11
                assert_cast<ColumnNullable*, TypeCheckOnRelease::DISABLE>(raw_result_column)
192
11
                        ->insert_default();
193
11
                continue;
194
11
            }
195
4.33k
            size_t target = is_consts[then_idx[row_idx]] ? 0 : row_idx;
196
4.33k
            if constexpr (then_null) {
197
4.16k
                auto* nullable = assert_cast<ColumnNullable*, TypeCheckOnRelease::DISABLE>(
198
4.16k
                        result_column_ptr.get());
199
4.16k
                if (is_nullable[then_idx[row_idx]]) {
200
408
                    nullable->insert_from_with_type<ColumnType>(
201
408
                            *raw_then_columns[then_idx[row_idx]], target);
202
3.75k
                } else {
203
3.75k
                    auto* nested = assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(
204
3.75k
                            nullable->get_nested_column_ptr().get());
205
3.75k
                    nested->insert_from(*raw_then_columns[then_idx[row_idx]], target);
206
3.75k
                    nullable->push_false_to_nullmap(1);
207
3.75k
                }
208
4.16k
            } else {
209
172
                assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(result_column_ptr.get())
210
172
                        ->insert_from(*raw_then_columns[then_idx[row_idx]], target);
211
172
            }
212
4.33k
        }
213
282
    }
Unexecuted instantiation: _ZNK5doris9VCaseExpr20update_result_normalItNS_12ColumnVectorILNS_13PrimitiveTypeE2EEELb1EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr20update_result_normalItNS_12ColumnVectorILNS_13PrimitiveTypeE3EEELb1EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr20update_result_normalItNS_12ColumnVectorILNS_13PrimitiveTypeE4EEELb1EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr20update_result_normalItNS_12ColumnVectorILNS_13PrimitiveTypeE5EEELb1EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr20update_result_normalItNS_12ColumnVectorILNS_13PrimitiveTypeE6EEELb1EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr20update_result_normalItNS_12ColumnVectorILNS_13PrimitiveTypeE7EEELb1EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr20update_result_normalItNS_12ColumnVectorILNS_13PrimitiveTypeE8EEELb1EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr20update_result_normalItNS_12ColumnVectorILNS_13PrimitiveTypeE9EEELb1EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr20update_result_normalItNS_13ColumnDecimalILNS_13PrimitiveTypeE28EEELb1EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr20update_result_normalItNS_13ColumnDecimalILNS_13PrimitiveTypeE29EEELb1EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr20update_result_normalItNS_13ColumnDecimalILNS_13PrimitiveTypeE35EEELb1EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr20update_result_normalItNS_13ColumnDecimalILNS_13PrimitiveTypeE30EEELb1EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr20update_result_normalItNS_13ColumnDecimalILNS_13PrimitiveTypeE20EEELb1EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr20update_result_normalItNS_9ColumnStrIjEELb1EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS5_EEPKT_RSt6vectorINS6_13immutable_ptrIS5_EESaISF_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr20update_result_normalItNS_9ColumnStrIjEELb0EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS5_EEPKT_RSt6vectorINS6_13immutable_ptrIS5_EESaISF_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr20update_result_normalItNS_12ColumnVectorILNS_13PrimitiveTypeE11EEELb1EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr20update_result_normalItNS_12ColumnVectorILNS_13PrimitiveTypeE12EEELb1EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr20update_result_normalItNS_12ColumnVectorILNS_13PrimitiveTypeE25EEELb1EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr20update_result_normalItNS_12ColumnVectorILNS_13PrimitiveTypeE26EEELb1EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr20update_result_normalItNS_12ColumnVectorILNS_13PrimitiveTypeE43EEELb1EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr20update_result_normalItNS_12ColumnVectorILNS_13PrimitiveTypeE42EEELb1EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr20update_result_normalItNS_12ColumnVectorILNS_13PrimitiveTypeE37EEELb1EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr20update_result_normalItNS_12ColumnVectorILNS_13PrimitiveTypeE37EEELb0EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr20update_result_normalItNS_12ColumnVectorILNS_13PrimitiveTypeE36EEELb1EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr20update_result_normalItNS_12ColumnVectorILNS_13PrimitiveTypeE36EEELb0EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr20update_result_normalItNS_11ColumnArrayELb1EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS4_EEPKT_RSt6vectorINS5_13immutable_ptrIS4_EESaISE_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr20update_result_normalItNS_11ColumnArrayELb0EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS4_EEPKT_RSt6vectorINS5_13immutable_ptrIS4_EESaISE_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr20update_result_normalItNS_9ColumnMapELb1EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS4_EEPKT_RSt6vectorINS5_13immutable_ptrIS4_EESaISE_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr20update_result_normalItNS_9ColumnMapELb0EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS4_EEPKT_RSt6vectorINS5_13immutable_ptrIS4_EESaISE_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr20update_result_normalItNS_12ColumnStructELb1EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS4_EEPKT_RSt6vectorINS5_13immutable_ptrIS4_EESaISE_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr20update_result_normalItNS_12ColumnStructELb0EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS4_EEPKT_RSt6vectorINS5_13immutable_ptrIS4_EESaISE_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr20update_result_normalItNS_17ColumnComplexTypeILNS_13PrimitiveTypeE22EEELb1EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr20update_result_normalItNS_17ColumnComplexTypeILNS_13PrimitiveTypeE22EEELb0EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr20update_result_normalItNS_17ColumnComplexTypeILNS_13PrimitiveTypeE19EEELb1EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr20update_result_normalItNS_17ColumnComplexTypeILNS_13PrimitiveTypeE19EEELb0EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr20update_result_normalItNS_17ColumnComplexTypeILNS_13PrimitiveTypeE24EEELb1EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr20update_result_normalItNS_17ColumnComplexTypeILNS_13PrimitiveTypeE24EEELb0EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr20update_result_normalItNS_15ColumnVariantV2ELb1EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS4_EEPKT_RSt6vectorINS5_13immutable_ptrIS4_EESaISE_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr20update_result_normalItNS_15ColumnVariantV2ELb0EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS4_EEPKT_RSt6vectorINS5_13immutable_ptrIS4_EESaISE_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr20update_result_normalItNS_13ColumnVariantELb1EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS4_EEPKT_RSt6vectorINS5_13immutable_ptrIS4_EESaISE_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr20update_result_normalItNS_13ColumnVariantELb0EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS4_EEPKT_RSt6vectorINS5_13immutable_ptrIS4_EESaISE_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr20update_result_normalIhNS_12ColumnVectorILNS_13PrimitiveTypeE2EEELb1EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
_ZNK5doris9VCaseExpr20update_result_normalIhNS_12ColumnVectorILNS_13PrimitiveTypeE3EEELb1EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Line
Count
Source
176
4
                              std::vector<ColumnPtr>& then_columns, size_t rows_count) const {
177
4
        std::vector<ColumnPtr> raw_then_columns(then_columns.size());
178
4
        std::vector<uint8_t> is_consts(then_columns.size());
179
4
        std::vector<uint8_t> is_nullable(then_columns.size());
180
13
        for (size_t i = 0; i < then_columns.size(); i++) {
181
9
            if (!then_columns[i]) {
182
3
                continue;
183
3
            }
184
6
            std::tie(raw_then_columns[i], is_consts[i]) = unpack_if_const(then_columns[i]);
185
6
            is_nullable[i] = is_column_nullable(*raw_then_columns[i]);
186
6
        }
187
188
4
        auto* raw_result_column = result_column_ptr.get();
189
10
        for (int row_idx = 0; row_idx < rows_count; row_idx++) {
190
6
            if (!_has_else_expr && !then_idx[row_idx]) {
191
0
                assert_cast<ColumnNullable*, TypeCheckOnRelease::DISABLE>(raw_result_column)
192
0
                        ->insert_default();
193
0
                continue;
194
0
            }
195
6
            size_t target = is_consts[then_idx[row_idx]] ? 0 : row_idx;
196
6
            if constexpr (then_null) {
197
6
                auto* nullable = assert_cast<ColumnNullable*, TypeCheckOnRelease::DISABLE>(
198
6
                        result_column_ptr.get());
199
6
                if (is_nullable[then_idx[row_idx]]) {
200
1
                    nullable->insert_from_with_type<ColumnType>(
201
1
                            *raw_then_columns[then_idx[row_idx]], target);
202
5
                } else {
203
5
                    auto* nested = assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(
204
5
                            nullable->get_nested_column_ptr().get());
205
5
                    nested->insert_from(*raw_then_columns[then_idx[row_idx]], target);
206
5
                    nullable->push_false_to_nullmap(1);
207
5
                }
208
            } else {
209
                assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(result_column_ptr.get())
210
                        ->insert_from(*raw_then_columns[then_idx[row_idx]], target);
211
            }
212
6
        }
213
4
    }
Unexecuted instantiation: _ZNK5doris9VCaseExpr20update_result_normalIhNS_12ColumnVectorILNS_13PrimitiveTypeE4EEELb1EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
_ZNK5doris9VCaseExpr20update_result_normalIhNS_12ColumnVectorILNS_13PrimitiveTypeE5EEELb1EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Line
Count
Source
176
38
                              std::vector<ColumnPtr>& then_columns, size_t rows_count) const {
177
38
        std::vector<ColumnPtr> raw_then_columns(then_columns.size());
178
38
        std::vector<uint8_t> is_consts(then_columns.size());
179
38
        std::vector<uint8_t> is_nullable(then_columns.size());
180
101
        for (size_t i = 0; i < then_columns.size(); i++) {
181
63
            if (!then_columns[i]) {
182
0
                continue;
183
0
            }
184
63
            std::tie(raw_then_columns[i], is_consts[i]) = unpack_if_const(then_columns[i]);
185
63
            is_nullable[i] = is_column_nullable(*raw_then_columns[i]);
186
63
        }
187
188
38
        auto* raw_result_column = result_column_ptr.get();
189
90
        for (int row_idx = 0; row_idx < rows_count; row_idx++) {
190
52
            if (!_has_else_expr && !then_idx[row_idx]) {
191
0
                assert_cast<ColumnNullable*, TypeCheckOnRelease::DISABLE>(raw_result_column)
192
0
                        ->insert_default();
193
0
                continue;
194
0
            }
195
52
            size_t target = is_consts[then_idx[row_idx]] ? 0 : row_idx;
196
52
            if constexpr (then_null) {
197
52
                auto* nullable = assert_cast<ColumnNullable*, TypeCheckOnRelease::DISABLE>(
198
52
                        result_column_ptr.get());
199
52
                if (is_nullable[then_idx[row_idx]]) {
200
52
                    nullable->insert_from_with_type<ColumnType>(
201
52
                            *raw_then_columns[then_idx[row_idx]], target);
202
52
                } else {
203
0
                    auto* nested = assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(
204
0
                            nullable->get_nested_column_ptr().get());
205
0
                    nested->insert_from(*raw_then_columns[then_idx[row_idx]], target);
206
0
                    nullable->push_false_to_nullmap(1);
207
0
                }
208
            } else {
209
                assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(result_column_ptr.get())
210
                        ->insert_from(*raw_then_columns[then_idx[row_idx]], target);
211
            }
212
52
        }
213
38
    }
_ZNK5doris9VCaseExpr20update_result_normalIhNS_12ColumnVectorILNS_13PrimitiveTypeE6EEELb1EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Line
Count
Source
176
12
                              std::vector<ColumnPtr>& then_columns, size_t rows_count) const {
177
12
        std::vector<ColumnPtr> raw_then_columns(then_columns.size());
178
12
        std::vector<uint8_t> is_consts(then_columns.size());
179
12
        std::vector<uint8_t> is_nullable(then_columns.size());
180
33
        for (size_t i = 0; i < then_columns.size(); i++) {
181
21
            if (!then_columns[i]) {
182
0
                continue;
183
0
            }
184
21
            std::tie(raw_then_columns[i], is_consts[i]) = unpack_if_const(then_columns[i]);
185
21
            is_nullable[i] = is_column_nullable(*raw_then_columns[i]);
186
21
        }
187
188
12
        auto* raw_result_column = result_column_ptr.get();
189
31
        for (int row_idx = 0; row_idx < rows_count; row_idx++) {
190
19
            if (!_has_else_expr && !then_idx[row_idx]) {
191
0
                assert_cast<ColumnNullable*, TypeCheckOnRelease::DISABLE>(raw_result_column)
192
0
                        ->insert_default();
193
0
                continue;
194
0
            }
195
19
            size_t target = is_consts[then_idx[row_idx]] ? 0 : row_idx;
196
19
            if constexpr (then_null) {
197
19
                auto* nullable = assert_cast<ColumnNullable*, TypeCheckOnRelease::DISABLE>(
198
19
                        result_column_ptr.get());
199
19
                if (is_nullable[then_idx[row_idx]]) {
200
19
                    nullable->insert_from_with_type<ColumnType>(
201
19
                            *raw_then_columns[then_idx[row_idx]], target);
202
19
                } else {
203
0
                    auto* nested = assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(
204
0
                            nullable->get_nested_column_ptr().get());
205
0
                    nested->insert_from(*raw_then_columns[then_idx[row_idx]], target);
206
0
                    nullable->push_false_to_nullmap(1);
207
0
                }
208
            } else {
209
                assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(result_column_ptr.get())
210
                        ->insert_from(*raw_then_columns[then_idx[row_idx]], target);
211
            }
212
19
        }
213
12
    }
Unexecuted instantiation: _ZNK5doris9VCaseExpr20update_result_normalIhNS_12ColumnVectorILNS_13PrimitiveTypeE7EEELb1EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr20update_result_normalIhNS_12ColumnVectorILNS_13PrimitiveTypeE8EEELb1EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
_ZNK5doris9VCaseExpr20update_result_normalIhNS_12ColumnVectorILNS_13PrimitiveTypeE9EEELb1EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Line
Count
Source
176
3
                              std::vector<ColumnPtr>& then_columns, size_t rows_count) const {
177
3
        std::vector<ColumnPtr> raw_then_columns(then_columns.size());
178
3
        std::vector<uint8_t> is_consts(then_columns.size());
179
3
        std::vector<uint8_t> is_nullable(then_columns.size());
180
11
        for (size_t i = 0; i < then_columns.size(); i++) {
181
8
            if (!then_columns[i]) {
182
0
                continue;
183
0
            }
184
8
            std::tie(raw_then_columns[i], is_consts[i]) = unpack_if_const(then_columns[i]);
185
8
            is_nullable[i] = is_column_nullable(*raw_then_columns[i]);
186
8
        }
187
188
3
        auto* raw_result_column = result_column_ptr.get();
189
13
        for (int row_idx = 0; row_idx < rows_count; row_idx++) {
190
10
            if (!_has_else_expr && !then_idx[row_idx]) {
191
0
                assert_cast<ColumnNullable*, TypeCheckOnRelease::DISABLE>(raw_result_column)
192
0
                        ->insert_default();
193
0
                continue;
194
0
            }
195
10
            size_t target = is_consts[then_idx[row_idx]] ? 0 : row_idx;
196
10
            if constexpr (then_null) {
197
10
                auto* nullable = assert_cast<ColumnNullable*, TypeCheckOnRelease::DISABLE>(
198
10
                        result_column_ptr.get());
199
10
                if (is_nullable[then_idx[row_idx]]) {
200
7
                    nullable->insert_from_with_type<ColumnType>(
201
7
                            *raw_then_columns[then_idx[row_idx]], target);
202
7
                } else {
203
3
                    auto* nested = assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(
204
3
                            nullable->get_nested_column_ptr().get());
205
3
                    nested->insert_from(*raw_then_columns[then_idx[row_idx]], target);
206
3
                    nullable->push_false_to_nullmap(1);
207
3
                }
208
            } else {
209
                assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(result_column_ptr.get())
210
                        ->insert_from(*raw_then_columns[then_idx[row_idx]], target);
211
            }
212
10
        }
213
3
    }
Unexecuted instantiation: _ZNK5doris9VCaseExpr20update_result_normalIhNS_13ColumnDecimalILNS_13PrimitiveTypeE28EEELb1EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
_ZNK5doris9VCaseExpr20update_result_normalIhNS_13ColumnDecimalILNS_13PrimitiveTypeE29EEELb1EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Line
Count
Source
176
1
                              std::vector<ColumnPtr>& then_columns, size_t rows_count) const {
177
1
        std::vector<ColumnPtr> raw_then_columns(then_columns.size());
178
1
        std::vector<uint8_t> is_consts(then_columns.size());
179
1
        std::vector<uint8_t> is_nullable(then_columns.size());
180
3
        for (size_t i = 0; i < then_columns.size(); i++) {
181
2
            if (!then_columns[i]) {
182
0
                continue;
183
0
            }
184
2
            std::tie(raw_then_columns[i], is_consts[i]) = unpack_if_const(then_columns[i]);
185
2
            is_nullable[i] = is_column_nullable(*raw_then_columns[i]);
186
2
        }
187
188
1
        auto* raw_result_column = result_column_ptr.get();
189
2
        for (int row_idx = 0; row_idx < rows_count; row_idx++) {
190
1
            if (!_has_else_expr && !then_idx[row_idx]) {
191
0
                assert_cast<ColumnNullable*, TypeCheckOnRelease::DISABLE>(raw_result_column)
192
0
                        ->insert_default();
193
0
                continue;
194
0
            }
195
1
            size_t target = is_consts[then_idx[row_idx]] ? 0 : row_idx;
196
1
            if constexpr (then_null) {
197
1
                auto* nullable = assert_cast<ColumnNullable*, TypeCheckOnRelease::DISABLE>(
198
1
                        result_column_ptr.get());
199
1
                if (is_nullable[then_idx[row_idx]]) {
200
1
                    nullable->insert_from_with_type<ColumnType>(
201
1
                            *raw_then_columns[then_idx[row_idx]], target);
202
1
                } else {
203
0
                    auto* nested = assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(
204
0
                            nullable->get_nested_column_ptr().get());
205
0
                    nested->insert_from(*raw_then_columns[then_idx[row_idx]], target);
206
0
                    nullable->push_false_to_nullmap(1);
207
0
                }
208
            } else {
209
                assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(result_column_ptr.get())
210
                        ->insert_from(*raw_then_columns[then_idx[row_idx]], target);
211
            }
212
1
        }
213
1
    }
_ZNK5doris9VCaseExpr20update_result_normalIhNS_13ColumnDecimalILNS_13PrimitiveTypeE35EEELb1EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Line
Count
Source
176
2
                              std::vector<ColumnPtr>& then_columns, size_t rows_count) const {
177
2
        std::vector<ColumnPtr> raw_then_columns(then_columns.size());
178
2
        std::vector<uint8_t> is_consts(then_columns.size());
179
2
        std::vector<uint8_t> is_nullable(then_columns.size());
180
8
        for (size_t i = 0; i < then_columns.size(); i++) {
181
6
            if (!then_columns[i]) {
182
0
                continue;
183
0
            }
184
6
            std::tie(raw_then_columns[i], is_consts[i]) = unpack_if_const(then_columns[i]);
185
6
            is_nullable[i] = is_column_nullable(*raw_then_columns[i]);
186
6
        }
187
188
2
        auto* raw_result_column = result_column_ptr.get();
189
6
        for (int row_idx = 0; row_idx < rows_count; row_idx++) {
190
4
            if (!_has_else_expr && !then_idx[row_idx]) {
191
0
                assert_cast<ColumnNullable*, TypeCheckOnRelease::DISABLE>(raw_result_column)
192
0
                        ->insert_default();
193
0
                continue;
194
0
            }
195
4
            size_t target = is_consts[then_idx[row_idx]] ? 0 : row_idx;
196
4
            if constexpr (then_null) {
197
4
                auto* nullable = assert_cast<ColumnNullable*, TypeCheckOnRelease::DISABLE>(
198
4
                        result_column_ptr.get());
199
4
                if (is_nullable[then_idx[row_idx]]) {
200
4
                    nullable->insert_from_with_type<ColumnType>(
201
4
                            *raw_then_columns[then_idx[row_idx]], target);
202
4
                } else {
203
0
                    auto* nested = assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(
204
0
                            nullable->get_nested_column_ptr().get());
205
0
                    nested->insert_from(*raw_then_columns[then_idx[row_idx]], target);
206
0
                    nullable->push_false_to_nullmap(1);
207
0
                }
208
            } else {
209
                assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(result_column_ptr.get())
210
                        ->insert_from(*raw_then_columns[then_idx[row_idx]], target);
211
            }
212
4
        }
213
2
    }
_ZNK5doris9VCaseExpr20update_result_normalIhNS_13ColumnDecimalILNS_13PrimitiveTypeE30EEELb1EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Line
Count
Source
176
1
                              std::vector<ColumnPtr>& then_columns, size_t rows_count) const {
177
1
        std::vector<ColumnPtr> raw_then_columns(then_columns.size());
178
1
        std::vector<uint8_t> is_consts(then_columns.size());
179
1
        std::vector<uint8_t> is_nullable(then_columns.size());
180
3
        for (size_t i = 0; i < then_columns.size(); i++) {
181
2
            if (!then_columns[i]) {
182
0
                continue;
183
0
            }
184
2
            std::tie(raw_then_columns[i], is_consts[i]) = unpack_if_const(then_columns[i]);
185
2
            is_nullable[i] = is_column_nullable(*raw_then_columns[i]);
186
2
        }
187
188
1
        auto* raw_result_column = result_column_ptr.get();
189
2
        for (int row_idx = 0; row_idx < rows_count; row_idx++) {
190
1
            if (!_has_else_expr && !then_idx[row_idx]) {
191
0
                assert_cast<ColumnNullable*, TypeCheckOnRelease::DISABLE>(raw_result_column)
192
0
                        ->insert_default();
193
0
                continue;
194
0
            }
195
1
            size_t target = is_consts[then_idx[row_idx]] ? 0 : row_idx;
196
1
            if constexpr (then_null) {
197
1
                auto* nullable = assert_cast<ColumnNullable*, TypeCheckOnRelease::DISABLE>(
198
1
                        result_column_ptr.get());
199
1
                if (is_nullable[then_idx[row_idx]]) {
200
1
                    nullable->insert_from_with_type<ColumnType>(
201
1
                            *raw_then_columns[then_idx[row_idx]], target);
202
1
                } else {
203
0
                    auto* nested = assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(
204
0
                            nullable->get_nested_column_ptr().get());
205
0
                    nested->insert_from(*raw_then_columns[then_idx[row_idx]], target);
206
0
                    nullable->push_false_to_nullmap(1);
207
0
                }
208
            } else {
209
                assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(result_column_ptr.get())
210
                        ->insert_from(*raw_then_columns[then_idx[row_idx]], target);
211
            }
212
1
        }
213
1
    }
Unexecuted instantiation: _ZNK5doris9VCaseExpr20update_result_normalIhNS_13ColumnDecimalILNS_13PrimitiveTypeE20EEELb1EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
_ZNK5doris9VCaseExpr20update_result_normalIhNS_9ColumnStrIjEELb1EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS5_EEPKT_RSt6vectorINS6_13immutable_ptrIS5_EESaISF_EEm
Line
Count
Source
176
149
                              std::vector<ColumnPtr>& then_columns, size_t rows_count) const {
177
149
        std::vector<ColumnPtr> raw_then_columns(then_columns.size());
178
149
        std::vector<uint8_t> is_consts(then_columns.size());
179
149
        std::vector<uint8_t> is_nullable(then_columns.size());
180
1.21k
        for (size_t i = 0; i < then_columns.size(); i++) {
181
1.06k
            if (!then_columns[i]) {
182
23
                continue;
183
23
            }
184
1.03k
            std::tie(raw_then_columns[i], is_consts[i]) = unpack_if_const(then_columns[i]);
185
1.03k
            is_nullable[i] = is_column_nullable(*raw_then_columns[i]);
186
1.03k
        }
187
188
149
        auto* raw_result_column = result_column_ptr.get();
189
4.19k
        for (int row_idx = 0; row_idx < rows_count; row_idx++) {
190
4.05k
            if (!_has_else_expr && !then_idx[row_idx]) {
191
11
                assert_cast<ColumnNullable*, TypeCheckOnRelease::DISABLE>(raw_result_column)
192
11
                        ->insert_default();
193
11
                continue;
194
11
            }
195
4.03k
            size_t target = is_consts[then_idx[row_idx]] ? 0 : row_idx;
196
4.03k
            if constexpr (then_null) {
197
4.03k
                auto* nullable = assert_cast<ColumnNullable*, TypeCheckOnRelease::DISABLE>(
198
4.03k
                        result_column_ptr.get());
199
4.03k
                if (is_nullable[then_idx[row_idx]]) {
200
308
                    nullable->insert_from_with_type<ColumnType>(
201
308
                            *raw_then_columns[then_idx[row_idx]], target);
202
3.73k
                } else {
203
3.73k
                    auto* nested = assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(
204
3.73k
                            nullable->get_nested_column_ptr().get());
205
3.73k
                    nested->insert_from(*raw_then_columns[then_idx[row_idx]], target);
206
3.73k
                    nullable->push_false_to_nullmap(1);
207
3.73k
                }
208
            } else {
209
                assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(result_column_ptr.get())
210
                        ->insert_from(*raw_then_columns[then_idx[row_idx]], target);
211
            }
212
4.03k
        }
213
149
    }
_ZNK5doris9VCaseExpr20update_result_normalIhNS_9ColumnStrIjEELb0EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS5_EEPKT_RSt6vectorINS6_13immutable_ptrIS5_EESaISF_EEm
Line
Count
Source
176
58
                              std::vector<ColumnPtr>& then_columns, size_t rows_count) const {
177
58
        std::vector<ColumnPtr> raw_then_columns(then_columns.size());
178
58
        std::vector<uint8_t> is_consts(then_columns.size());
179
58
        std::vector<uint8_t> is_nullable(then_columns.size());
180
190
        for (size_t i = 0; i < then_columns.size(); i++) {
181
132
            if (!then_columns[i]) {
182
0
                continue;
183
0
            }
184
132
            std::tie(raw_then_columns[i], is_consts[i]) = unpack_if_const(then_columns[i]);
185
132
            is_nullable[i] = is_column_nullable(*raw_then_columns[i]);
186
132
        }
187
188
58
        auto* raw_result_column = result_column_ptr.get();
189
230
        for (int row_idx = 0; row_idx < rows_count; row_idx++) {
190
172
            if (!_has_else_expr && !then_idx[row_idx]) {
191
0
                assert_cast<ColumnNullable*, TypeCheckOnRelease::DISABLE>(raw_result_column)
192
0
                        ->insert_default();
193
0
                continue;
194
0
            }
195
172
            size_t target = is_consts[then_idx[row_idx]] ? 0 : row_idx;
196
            if constexpr (then_null) {
197
                auto* nullable = assert_cast<ColumnNullable*, TypeCheckOnRelease::DISABLE>(
198
                        result_column_ptr.get());
199
                if (is_nullable[then_idx[row_idx]]) {
200
                    nullable->insert_from_with_type<ColumnType>(
201
                            *raw_then_columns[then_idx[row_idx]], target);
202
                } else {
203
                    auto* nested = assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(
204
                            nullable->get_nested_column_ptr().get());
205
                    nested->insert_from(*raw_then_columns[then_idx[row_idx]], target);
206
                    nullable->push_false_to_nullmap(1);
207
                }
208
172
            } else {
209
172
                assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(result_column_ptr.get())
210
172
                        ->insert_from(*raw_then_columns[then_idx[row_idx]], target);
211
172
            }
212
172
        }
213
58
    }
Unexecuted instantiation: _ZNK5doris9VCaseExpr20update_result_normalIhNS_12ColumnVectorILNS_13PrimitiveTypeE11EEELb1EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr20update_result_normalIhNS_12ColumnVectorILNS_13PrimitiveTypeE12EEELb1EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr20update_result_normalIhNS_12ColumnVectorILNS_13PrimitiveTypeE25EEELb1EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr20update_result_normalIhNS_12ColumnVectorILNS_13PrimitiveTypeE26EEELb1EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
_ZNK5doris9VCaseExpr20update_result_normalIhNS_12ColumnVectorILNS_13PrimitiveTypeE43EEELb1EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Line
Count
Source
176
3
                              std::vector<ColumnPtr>& then_columns, size_t rows_count) const {
177
3
        std::vector<ColumnPtr> raw_then_columns(then_columns.size());
178
3
        std::vector<uint8_t> is_consts(then_columns.size());
179
3
        std::vector<uint8_t> is_nullable(then_columns.size());
180
14
        for (size_t i = 0; i < then_columns.size(); i++) {
181
11
            if (!then_columns[i]) {
182
0
                continue;
183
0
            }
184
11
            std::tie(raw_then_columns[i], is_consts[i]) = unpack_if_const(then_columns[i]);
185
11
            is_nullable[i] = is_column_nullable(*raw_then_columns[i]);
186
11
        }
187
188
3
        auto* raw_result_column = result_column_ptr.get();
189
16
        for (int row_idx = 0; row_idx < rows_count; row_idx++) {
190
13
            if (!_has_else_expr && !then_idx[row_idx]) {
191
0
                assert_cast<ColumnNullable*, TypeCheckOnRelease::DISABLE>(raw_result_column)
192
0
                        ->insert_default();
193
0
                continue;
194
0
            }
195
13
            size_t target = is_consts[then_idx[row_idx]] ? 0 : row_idx;
196
13
            if constexpr (then_null) {
197
13
                auto* nullable = assert_cast<ColumnNullable*, TypeCheckOnRelease::DISABLE>(
198
13
                        result_column_ptr.get());
199
13
                if (is_nullable[then_idx[row_idx]]) {
200
12
                    nullable->insert_from_with_type<ColumnType>(
201
12
                            *raw_then_columns[then_idx[row_idx]], target);
202
12
                } else {
203
1
                    auto* nested = assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(
204
1
                            nullable->get_nested_column_ptr().get());
205
1
                    nested->insert_from(*raw_then_columns[then_idx[row_idx]], target);
206
1
                    nullable->push_false_to_nullmap(1);
207
1
                }
208
            } else {
209
                assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(result_column_ptr.get())
210
                        ->insert_from(*raw_then_columns[then_idx[row_idx]], target);
211
            }
212
13
        }
213
3
    }
Unexecuted instantiation: _ZNK5doris9VCaseExpr20update_result_normalIhNS_12ColumnVectorILNS_13PrimitiveTypeE42EEELb1EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr20update_result_normalIhNS_12ColumnVectorILNS_13PrimitiveTypeE37EEELb1EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr20update_result_normalIhNS_12ColumnVectorILNS_13PrimitiveTypeE37EEELb0EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr20update_result_normalIhNS_12ColumnVectorILNS_13PrimitiveTypeE36EEELb1EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr20update_result_normalIhNS_12ColumnVectorILNS_13PrimitiveTypeE36EEELb0EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
_ZNK5doris9VCaseExpr20update_result_normalIhNS_11ColumnArrayELb1EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS4_EEPKT_RSt6vectorINS5_13immutable_ptrIS4_EESaISE_EEm
Line
Count
Source
176
1
                              std::vector<ColumnPtr>& then_columns, size_t rows_count) const {
177
1
        std::vector<ColumnPtr> raw_then_columns(then_columns.size());
178
1
        std::vector<uint8_t> is_consts(then_columns.size());
179
1
        std::vector<uint8_t> is_nullable(then_columns.size());
180
4
        for (size_t i = 0; i < then_columns.size(); i++) {
181
3
            if (!then_columns[i]) {
182
0
                continue;
183
0
            }
184
3
            std::tie(raw_then_columns[i], is_consts[i]) = unpack_if_const(then_columns[i]);
185
3
            is_nullable[i] = is_column_nullable(*raw_then_columns[i]);
186
3
        }
187
188
1
        auto* raw_result_column = result_column_ptr.get();
189
4
        for (int row_idx = 0; row_idx < rows_count; row_idx++) {
190
3
            if (!_has_else_expr && !then_idx[row_idx]) {
191
0
                assert_cast<ColumnNullable*, TypeCheckOnRelease::DISABLE>(raw_result_column)
192
0
                        ->insert_default();
193
0
                continue;
194
0
            }
195
3
            size_t target = is_consts[then_idx[row_idx]] ? 0 : row_idx;
196
3
            if constexpr (then_null) {
197
3
                auto* nullable = assert_cast<ColumnNullable*, TypeCheckOnRelease::DISABLE>(
198
3
                        result_column_ptr.get());
199
3
                if (is_nullable[then_idx[row_idx]]) {
200
1
                    nullable->insert_from_with_type<ColumnType>(
201
1
                            *raw_then_columns[then_idx[row_idx]], target);
202
2
                } else {
203
2
                    auto* nested = assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(
204
2
                            nullable->get_nested_column_ptr().get());
205
2
                    nested->insert_from(*raw_then_columns[then_idx[row_idx]], target);
206
2
                    nullable->push_false_to_nullmap(1);
207
2
                }
208
            } else {
209
                assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(result_column_ptr.get())
210
                        ->insert_from(*raw_then_columns[then_idx[row_idx]], target);
211
            }
212
3
        }
213
1
    }
Unexecuted instantiation: _ZNK5doris9VCaseExpr20update_result_normalIhNS_11ColumnArrayELb0EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS4_EEPKT_RSt6vectorINS5_13immutable_ptrIS4_EESaISE_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr20update_result_normalIhNS_9ColumnMapELb1EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS4_EEPKT_RSt6vectorINS5_13immutable_ptrIS4_EESaISE_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr20update_result_normalIhNS_9ColumnMapELb0EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS4_EEPKT_RSt6vectorINS5_13immutable_ptrIS4_EESaISE_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr20update_result_normalIhNS_12ColumnStructELb1EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS4_EEPKT_RSt6vectorINS5_13immutable_ptrIS4_EESaISE_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr20update_result_normalIhNS_12ColumnStructELb0EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS4_EEPKT_RSt6vectorINS5_13immutable_ptrIS4_EESaISE_EEm
_ZNK5doris9VCaseExpr20update_result_normalIhNS_17ColumnComplexTypeILNS_13PrimitiveTypeE22EEELb1EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Line
Count
Source
176
10
                              std::vector<ColumnPtr>& then_columns, size_t rows_count) const {
177
10
        std::vector<ColumnPtr> raw_then_columns(then_columns.size());
178
10
        std::vector<uint8_t> is_consts(then_columns.size());
179
10
        std::vector<uint8_t> is_nullable(then_columns.size());
180
28
        for (size_t i = 0; i < then_columns.size(); i++) {
181
18
            if (!then_columns[i]) {
182
0
                continue;
183
0
            }
184
18
            std::tie(raw_then_columns[i], is_consts[i]) = unpack_if_const(then_columns[i]);
185
18
            is_nullable[i] = is_column_nullable(*raw_then_columns[i]);
186
18
        }
187
188
10
        auto* raw_result_column = result_column_ptr.get();
189
22
        for (int row_idx = 0; row_idx < rows_count; row_idx++) {
190
12
            if (!_has_else_expr && !then_idx[row_idx]) {
191
0
                assert_cast<ColumnNullable*, TypeCheckOnRelease::DISABLE>(raw_result_column)
192
0
                        ->insert_default();
193
0
                continue;
194
0
            }
195
12
            size_t target = is_consts[then_idx[row_idx]] ? 0 : row_idx;
196
12
            if constexpr (then_null) {
197
12
                auto* nullable = assert_cast<ColumnNullable*, TypeCheckOnRelease::DISABLE>(
198
12
                        result_column_ptr.get());
199
12
                if (is_nullable[then_idx[row_idx]]) {
200
2
                    nullable->insert_from_with_type<ColumnType>(
201
2
                            *raw_then_columns[then_idx[row_idx]], target);
202
10
                } else {
203
10
                    auto* nested = assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(
204
10
                            nullable->get_nested_column_ptr().get());
205
10
                    nested->insert_from(*raw_then_columns[then_idx[row_idx]], target);
206
10
                    nullable->push_false_to_nullmap(1);
207
10
                }
208
            } else {
209
                assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(result_column_ptr.get())
210
                        ->insert_from(*raw_then_columns[then_idx[row_idx]], target);
211
            }
212
12
        }
213
10
    }
Unexecuted instantiation: _ZNK5doris9VCaseExpr20update_result_normalIhNS_17ColumnComplexTypeILNS_13PrimitiveTypeE22EEELb0EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr20update_result_normalIhNS_17ColumnComplexTypeILNS_13PrimitiveTypeE19EEELb1EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr20update_result_normalIhNS_17ColumnComplexTypeILNS_13PrimitiveTypeE19EEELb0EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr20update_result_normalIhNS_17ColumnComplexTypeILNS_13PrimitiveTypeE24EEELb1EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr20update_result_normalIhNS_17ColumnComplexTypeILNS_13PrimitiveTypeE24EEELb0EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr20update_result_normalIhNS_15ColumnVariantV2ELb1EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS4_EEPKT_RSt6vectorINS5_13immutable_ptrIS4_EESaISE_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr20update_result_normalIhNS_15ColumnVariantV2ELb0EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS4_EEPKT_RSt6vectorINS5_13immutable_ptrIS4_EESaISE_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr20update_result_normalIhNS_13ColumnVariantELb1EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS4_EEPKT_RSt6vectorINS5_13immutable_ptrIS4_EESaISE_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr20update_result_normalIhNS_13ColumnVariantELb0EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS4_EEPKT_RSt6vectorINS5_13immutable_ptrIS4_EESaISE_EEm
214
215
    template <typename IndexType, typename ColumnType>
216
    void update_result_auto_simd(MutableColumnPtr& result_column_ptr,
217
                                 const IndexType* __restrict then_idx,
218
1.79k
                                 std::vector<ColumnPtr>& then_columns, size_t rows_count) const {
219
2.72k
        for (auto& then_ptr : then_columns) {
220
2.72k
            then_ptr = then_ptr->convert_to_full_column_if_const();
221
2.72k
        }
222
223
1.79k
        result_column_ptr->resize(rows_count);
224
1.79k
        auto* __restrict result_raw_data =
225
1.79k
                assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(result_column_ptr.get())
226
1.79k
                        ->get_data()
227
1.79k
                        .data();
228
229
        // set default value
230
3.78k
        for (int i = 0; i < rows_count; i++) {
231
            if constexpr (std::is_same_v<ColumnType, ColumnDate> ||
232
                          std::is_same_v<ColumnType, ColumnDateTime> ||
233
                          std::is_same_v<ColumnType, ColumnDateV2> ||
234
                          std::is_same_v<ColumnType, ColumnDateTimeV2> ||
235
                          std::is_same_v<ColumnType, ColumnTimeStampNs> ||
236
0
                          std::is_same_v<ColumnType, ColumnTimeStampTz>) {
237
0
                result_raw_data[i] = ColumnType::default_value();
238
1.99k
            } else {
239
1.99k
                result_raw_data[i] = {};
240
1.99k
            }
241
1.99k
        }
242
243
4.51k
        for (IndexType i = 0; i < then_columns.size(); i++) {
244
2.72k
            if (!then_columns[i]) {
245
0
                continue;
246
0
            }
247
2.72k
            const auto* __restrict column_raw_data =
248
2.72k
                    assert_cast<const ColumnType*, TypeCheckOnRelease::DISABLE>(
249
2.72k
                            then_columns[i].get())
250
2.72k
                            ->get_data()
251
2.72k
                            .data();
252
            if constexpr (std::is_same_v<ColumnType, ColumnDate> ||
253
                          std::is_same_v<ColumnType, ColumnDateTime> ||
254
                          std::is_same_v<ColumnType, ColumnDateV2> ||
255
                          std::is_same_v<ColumnType, ColumnDateTimeV2> ||
256
                          std::is_same_v<ColumnType, ColumnTimeStampNs> ||
257
0
                          std::is_same_v<ColumnType, ColumnTimeStampTz>) {
258
0
                for (int row_idx = 0; row_idx < rows_count; row_idx++) {
259
0
                    result_raw_data[row_idx] = (then_idx[row_idx] == i) ? column_raw_data[row_idx]
260
0
                                                                        : result_raw_data[row_idx];
261
0
                }
262
2.72k
            } else {
263
5.85k
                for (int row_idx = 0; row_idx < rows_count; row_idx++) {
264
3.12k
                    result_raw_data[row_idx] +=
265
3.12k
                            typename ColumnType::value_type(then_idx[row_idx] == i) *
266
3.12k
                            column_raw_data[row_idx];
267
3.12k
                }
268
2.72k
            }
269
2.72k
        }
270
1.79k
    }
Unexecuted instantiation: _ZNK5doris9VCaseExpr23update_result_auto_simdItNS_12ColumnVectorILNS_13PrimitiveTypeE2EEEEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr23update_result_auto_simdItNS_12ColumnVectorILNS_13PrimitiveTypeE3EEEEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr23update_result_auto_simdItNS_12ColumnVectorILNS_13PrimitiveTypeE4EEEEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr23update_result_auto_simdItNS_12ColumnVectorILNS_13PrimitiveTypeE5EEEEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr23update_result_auto_simdItNS_12ColumnVectorILNS_13PrimitiveTypeE6EEEEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr23update_result_auto_simdItNS_12ColumnVectorILNS_13PrimitiveTypeE7EEEEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr23update_result_auto_simdItNS_12ColumnVectorILNS_13PrimitiveTypeE8EEEEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr23update_result_auto_simdItNS_12ColumnVectorILNS_13PrimitiveTypeE9EEEEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr23update_result_auto_simdItNS_13ColumnDecimalILNS_13PrimitiveTypeE28EEEEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr23update_result_auto_simdItNS_13ColumnDecimalILNS_13PrimitiveTypeE29EEEEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr23update_result_auto_simdItNS_13ColumnDecimalILNS_13PrimitiveTypeE35EEEEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr23update_result_auto_simdItNS_13ColumnDecimalILNS_13PrimitiveTypeE30EEEEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr23update_result_auto_simdItNS_13ColumnDecimalILNS_13PrimitiveTypeE20EEEEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr23update_result_auto_simdItNS_12ColumnVectorILNS_13PrimitiveTypeE11EEEEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr23update_result_auto_simdItNS_12ColumnVectorILNS_13PrimitiveTypeE12EEEEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr23update_result_auto_simdItNS_12ColumnVectorILNS_13PrimitiveTypeE25EEEEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr23update_result_auto_simdItNS_12ColumnVectorILNS_13PrimitiveTypeE26EEEEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr23update_result_auto_simdItNS_12ColumnVectorILNS_13PrimitiveTypeE43EEEEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr23update_result_auto_simdItNS_12ColumnVectorILNS_13PrimitiveTypeE42EEEEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr23update_result_auto_simdIhNS_12ColumnVectorILNS_13PrimitiveTypeE2EEEEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
_ZNK5doris9VCaseExpr23update_result_auto_simdIhNS_12ColumnVectorILNS_13PrimitiveTypeE3EEEEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Line
Count
Source
218
1.67k
                                 std::vector<ColumnPtr>& then_columns, size_t rows_count) const {
219
2.53k
        for (auto& then_ptr : then_columns) {
220
2.53k
            then_ptr = then_ptr->convert_to_full_column_if_const();
221
2.53k
        }
222
223
1.67k
        result_column_ptr->resize(rows_count);
224
1.67k
        auto* __restrict result_raw_data =
225
1.67k
                assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(result_column_ptr.get())
226
1.67k
                        ->get_data()
227
1.67k
                        .data();
228
229
        // set default value
230
3.35k
        for (int i = 0; i < rows_count; i++) {
231
            if constexpr (std::is_same_v<ColumnType, ColumnDate> ||
232
                          std::is_same_v<ColumnType, ColumnDateTime> ||
233
                          std::is_same_v<ColumnType, ColumnDateV2> ||
234
                          std::is_same_v<ColumnType, ColumnDateTimeV2> ||
235
                          std::is_same_v<ColumnType, ColumnTimeStampNs> ||
236
                          std::is_same_v<ColumnType, ColumnTimeStampTz>) {
237
                result_raw_data[i] = ColumnType::default_value();
238
1.68k
            } else {
239
1.68k
                result_raw_data[i] = {};
240
1.68k
            }
241
1.68k
        }
242
243
4.20k
        for (IndexType i = 0; i < then_columns.size(); i++) {
244
2.53k
            if (!then_columns[i]) {
245
0
                continue;
246
0
            }
247
2.53k
            const auto* __restrict column_raw_data =
248
2.53k
                    assert_cast<const ColumnType*, TypeCheckOnRelease::DISABLE>(
249
2.53k
                            then_columns[i].get())
250
2.53k
                            ->get_data()
251
2.53k
                            .data();
252
            if constexpr (std::is_same_v<ColumnType, ColumnDate> ||
253
                          std::is_same_v<ColumnType, ColumnDateTime> ||
254
                          std::is_same_v<ColumnType, ColumnDateV2> ||
255
                          std::is_same_v<ColumnType, ColumnDateTimeV2> ||
256
                          std::is_same_v<ColumnType, ColumnTimeStampNs> ||
257
                          std::is_same_v<ColumnType, ColumnTimeStampTz>) {
258
                for (int row_idx = 0; row_idx < rows_count; row_idx++) {
259
                    result_raw_data[row_idx] = (then_idx[row_idx] == i) ? column_raw_data[row_idx]
260
                                                                        : result_raw_data[row_idx];
261
                }
262
2.53k
            } else {
263
5.10k
                for (int row_idx = 0; row_idx < rows_count; row_idx++) {
264
2.56k
                    result_raw_data[row_idx] +=
265
2.56k
                            typename ColumnType::value_type(then_idx[row_idx] == i) *
266
2.56k
                            column_raw_data[row_idx];
267
2.56k
                }
268
2.53k
            }
269
2.53k
        }
270
1.67k
    }
Unexecuted instantiation: _ZNK5doris9VCaseExpr23update_result_auto_simdIhNS_12ColumnVectorILNS_13PrimitiveTypeE4EEEEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr23update_result_auto_simdIhNS_12ColumnVectorILNS_13PrimitiveTypeE5EEEEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
_ZNK5doris9VCaseExpr23update_result_auto_simdIhNS_12ColumnVectorILNS_13PrimitiveTypeE6EEEEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Line
Count
Source
218
122
                                 std::vector<ColumnPtr>& then_columns, size_t rows_count) const {
219
189
        for (auto& then_ptr : then_columns) {
220
189
            then_ptr = then_ptr->convert_to_full_column_if_const();
221
189
        }
222
223
122
        result_column_ptr->resize(rows_count);
224
122
        auto* __restrict result_raw_data =
225
122
                assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(result_column_ptr.get())
226
122
                        ->get_data()
227
122
                        .data();
228
229
        // set default value
230
431
        for (int i = 0; i < rows_count; i++) {
231
            if constexpr (std::is_same_v<ColumnType, ColumnDate> ||
232
                          std::is_same_v<ColumnType, ColumnDateTime> ||
233
                          std::is_same_v<ColumnType, ColumnDateV2> ||
234
                          std::is_same_v<ColumnType, ColumnDateTimeV2> ||
235
                          std::is_same_v<ColumnType, ColumnTimeStampNs> ||
236
                          std::is_same_v<ColumnType, ColumnTimeStampTz>) {
237
                result_raw_data[i] = ColumnType::default_value();
238
309
            } else {
239
309
                result_raw_data[i] = {};
240
309
            }
241
309
        }
242
243
311
        for (IndexType i = 0; i < then_columns.size(); i++) {
244
189
            if (!then_columns[i]) {
245
0
                continue;
246
0
            }
247
189
            const auto* __restrict column_raw_data =
248
189
                    assert_cast<const ColumnType*, TypeCheckOnRelease::DISABLE>(
249
189
                            then_columns[i].get())
250
189
                            ->get_data()
251
189
                            .data();
252
            if constexpr (std::is_same_v<ColumnType, ColumnDate> ||
253
                          std::is_same_v<ColumnType, ColumnDateTime> ||
254
                          std::is_same_v<ColumnType, ColumnDateV2> ||
255
                          std::is_same_v<ColumnType, ColumnDateTimeV2> ||
256
                          std::is_same_v<ColumnType, ColumnTimeStampNs> ||
257
                          std::is_same_v<ColumnType, ColumnTimeStampTz>) {
258
                for (int row_idx = 0; row_idx < rows_count; row_idx++) {
259
                    result_raw_data[row_idx] = (then_idx[row_idx] == i) ? column_raw_data[row_idx]
260
                                                                        : result_raw_data[row_idx];
261
                }
262
189
            } else {
263
750
                for (int row_idx = 0; row_idx < rows_count; row_idx++) {
264
561
                    result_raw_data[row_idx] +=
265
561
                            typename ColumnType::value_type(then_idx[row_idx] == i) *
266
561
                            column_raw_data[row_idx];
267
561
                }
268
189
            }
269
189
        }
270
122
    }
Unexecuted instantiation: _ZNK5doris9VCaseExpr23update_result_auto_simdIhNS_12ColumnVectorILNS_13PrimitiveTypeE7EEEEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr23update_result_auto_simdIhNS_12ColumnVectorILNS_13PrimitiveTypeE8EEEEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr23update_result_auto_simdIhNS_12ColumnVectorILNS_13PrimitiveTypeE9EEEEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr23update_result_auto_simdIhNS_13ColumnDecimalILNS_13PrimitiveTypeE28EEEEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr23update_result_auto_simdIhNS_13ColumnDecimalILNS_13PrimitiveTypeE29EEEEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr23update_result_auto_simdIhNS_13ColumnDecimalILNS_13PrimitiveTypeE35EEEEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr23update_result_auto_simdIhNS_13ColumnDecimalILNS_13PrimitiveTypeE30EEEEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr23update_result_auto_simdIhNS_13ColumnDecimalILNS_13PrimitiveTypeE20EEEEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr23update_result_auto_simdIhNS_12ColumnVectorILNS_13PrimitiveTypeE11EEEEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr23update_result_auto_simdIhNS_12ColumnVectorILNS_13PrimitiveTypeE12EEEEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr23update_result_auto_simdIhNS_12ColumnVectorILNS_13PrimitiveTypeE25EEEEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr23update_result_auto_simdIhNS_12ColumnVectorILNS_13PrimitiveTypeE26EEEEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr23update_result_auto_simdIhNS_12ColumnVectorILNS_13PrimitiveTypeE43EEEEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr23update_result_auto_simdIhNS_12ColumnVectorILNS_13PrimitiveTypeE42EEEEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
271
272
    template <typename IndexType>
273
    ColumnPtr _execute_impl(const std::vector<ColumnPtr>& when_columns,
274
2.07k
                            std::vector<ColumnPtr>& then_columns, size_t rows_count) const {
275
2.07k
        std::vector<IndexType> then_idx(rows_count, 0);
276
2.07k
        IndexType* __restrict then_idx_ptr = then_idx.data();
277
4.02k
        for (IndexType i = 0; i < when_columns.size(); i++) {
278
1.98k
            IndexType column_idx = i + 1;
279
1.98k
            auto [raw_when_column, is_consts] = unpack_if_const(when_columns[i]);
280
281
1.98k
            if (is_consts) {
282
30
                if (raw_when_column->get_bool(0)) {
283
993
                    for (int row_idx = 0; row_idx < rows_count; row_idx++) {
284
963
                        then_idx_ptr[row_idx] |= (!then_idx_ptr[row_idx]) * column_idx;
285
963
                    }
286
30
                    break;
287
30
                }
288
0
                continue;
289
30
            }
290
291
1.95k
            if (is_column_nullable(*raw_when_column)) {
292
1.51k
                const auto* column_nullable_ptr =
293
1.51k
                        assert_cast<const ColumnNullable*, TypeCheckOnRelease::DISABLE>(
294
1.51k
                                raw_when_column.get());
295
1.51k
                const auto* __restrict cond_raw_data =
296
1.51k
                        assert_cast<const ColumnUInt8*, TypeCheckOnRelease::DISABLE>(
297
1.51k
                                column_nullable_ptr->get_nested_column_ptr().get())
298
1.51k
                                ->get_data()
299
1.51k
                                .data();
300
1.51k
                if (!column_nullable_ptr->has_null()) {
301
29.4k
                    for (int row_idx = 0; row_idx < rows_count; row_idx++) {
302
27.9k
                        then_idx_ptr[row_idx] |=
303
27.9k
                                (!then_idx_ptr[row_idx]) * cond_raw_data[row_idx] * column_idx;
304
27.9k
                    }
305
1.46k
                    continue;
306
1.46k
                }
307
49
                const auto* __restrict cond_raw_nullmap =
308
49
                        column_nullable_ptr->get_null_map_column_ptr()->get_data().data();
309
263
                for (int row_idx = 0; row_idx < rows_count; row_idx++) {
310
214
                    then_idx_ptr[row_idx] |= (!then_idx_ptr[row_idx] * cond_raw_data[row_idx] *
311
214
                                              !cond_raw_nullmap[row_idx]) *
312
214
                                             column_idx;
313
214
                }
314
435
            } else {
315
435
                const auto* __restrict cond_raw_data =
316
435
                        assert_cast<const ColumnUInt8*, TypeCheckOnRelease::DISABLE>(
317
435
                                raw_when_column.get())
318
435
                                ->get_data()
319
435
                                .data();
320
962
                for (int row_idx = 0; row_idx < rows_count; row_idx++) {
321
527
                    then_idx_ptr[row_idx] |=
322
527
                            (!then_idx_ptr[row_idx]) * cond_raw_data[row_idx] * column_idx;
323
527
                }
324
435
            }
325
1.95k
        }
326
327
2.07k
        return _execute_update_result<IndexType>(then_idx_ptr, then_columns, rows_count);
328
2.07k
    }
Unexecuted instantiation: _ZNK5doris9VCaseExpr13_execute_implItEENS_3COWINS_7IColumnEE13immutable_ptrIS3_EERKSt6vectorIS6_SaIS6_EERS9_m
_ZNK5doris9VCaseExpr13_execute_implIhEENS_3COWINS_7IColumnEE13immutable_ptrIS3_EERKSt6vectorIS6_SaIS6_EERS9_m
Line
Count
Source
274
2.07k
                            std::vector<ColumnPtr>& then_columns, size_t rows_count) const {
275
2.07k
        std::vector<IndexType> then_idx(rows_count, 0);
276
2.07k
        IndexType* __restrict then_idx_ptr = then_idx.data();
277
4.02k
        for (IndexType i = 0; i < when_columns.size(); i++) {
278
1.98k
            IndexType column_idx = i + 1;
279
1.98k
            auto [raw_when_column, is_consts] = unpack_if_const(when_columns[i]);
280
281
1.98k
            if (is_consts) {
282
30
                if (raw_when_column->get_bool(0)) {
283
993
                    for (int row_idx = 0; row_idx < rows_count; row_idx++) {
284
963
                        then_idx_ptr[row_idx] |= (!then_idx_ptr[row_idx]) * column_idx;
285
963
                    }
286
30
                    break;
287
30
                }
288
0
                continue;
289
30
            }
290
291
1.95k
            if (is_column_nullable(*raw_when_column)) {
292
1.51k
                const auto* column_nullable_ptr =
293
1.51k
                        assert_cast<const ColumnNullable*, TypeCheckOnRelease::DISABLE>(
294
1.51k
                                raw_when_column.get());
295
1.51k
                const auto* __restrict cond_raw_data =
296
1.51k
                        assert_cast<const ColumnUInt8*, TypeCheckOnRelease::DISABLE>(
297
1.51k
                                column_nullable_ptr->get_nested_column_ptr().get())
298
1.51k
                                ->get_data()
299
1.51k
                                .data();
300
1.51k
                if (!column_nullable_ptr->has_null()) {
301
29.4k
                    for (int row_idx = 0; row_idx < rows_count; row_idx++) {
302
27.9k
                        then_idx_ptr[row_idx] |=
303
27.9k
                                (!then_idx_ptr[row_idx]) * cond_raw_data[row_idx] * column_idx;
304
27.9k
                    }
305
1.46k
                    continue;
306
1.46k
                }
307
49
                const auto* __restrict cond_raw_nullmap =
308
49
                        column_nullable_ptr->get_null_map_column_ptr()->get_data().data();
309
263
                for (int row_idx = 0; row_idx < rows_count; row_idx++) {
310
214
                    then_idx_ptr[row_idx] |= (!then_idx_ptr[row_idx] * cond_raw_data[row_idx] *
311
214
                                              !cond_raw_nullmap[row_idx]) *
312
214
                                             column_idx;
313
214
                }
314
435
            } else {
315
435
                const auto* __restrict cond_raw_data =
316
435
                        assert_cast<const ColumnUInt8*, TypeCheckOnRelease::DISABLE>(
317
435
                                raw_when_column.get())
318
435
                                ->get_data()
319
435
                                .data();
320
962
                for (int row_idx = 0; row_idx < rows_count; row_idx++) {
321
527
                    then_idx_ptr[row_idx] |=
322
527
                            (!then_idx_ptr[row_idx]) * cond_raw_data[row_idx] * column_idx;
323
527
                }
324
435
            }
325
1.95k
        }
326
327
2.07k
        return _execute_update_result<IndexType>(then_idx_ptr, then_columns, rows_count);
328
2.07k
    }
329
330
    bool _has_else_expr;
331
332
    inline static const std::string FUNCTION_NAME = "case";
333
    inline static const std::string EXPR_NAME = "vcase expr";
334
};
335
} // namespace doris