Coverage Report

Created: 2026-09-09 03:51

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
290
                                          size_t rows_count) const {
83
290
        auto result_column_ptr = data_type()->create_column();
84
290
        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
76
                      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
76
            if (data_type()->is_nullable()) {
99
32
                update_result_normal<IndexType, ColumnType, true>(result_column_ptr, then_idx,
100
32
                                                                  then_columns, rows_count);
101
44
            } else {
102
44
                update_result_normal<IndexType, ColumnType, false>(result_column_ptr, then_idx,
103
44
                                                                   then_columns, rows_count);
104
44
            }
105
214
        } else if (data_type()->is_nullable()) {
106
            // result_column and all then_column is nullable.
107
41
            update_result_normal<IndexType, ColumnType, true>(result_column_ptr, then_idx,
108
41
                                                              then_columns, rows_count);
109
173
        } else {
110
173
            update_result_auto_simd<IndexType, ColumnType>(result_column_ptr, then_idx,
111
173
                                                           then_columns, rows_count);
112
173
        }
113
290
        return result_column_ptr;
114
290
    }
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_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
11
                                          size_t rows_count) const {
83
11
        auto result_column_ptr = data_type()->create_column();
84
11
        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
11
        } 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
9
        } else {
110
9
            update_result_auto_simd<IndexType, ColumnType>(result_column_ptr, then_idx,
111
9
                                                           then_columns, rows_count);
112
9
        }
113
11
        return result_column_ptr;
114
11
    }
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
34
                                          size_t rows_count) const {
83
34
        auto result_column_ptr = data_type()->create_column();
84
34
        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
34
        } else if (data_type()->is_nullable()) {
106
            // result_column and all then_column is nullable.
107
34
            update_result_normal<IndexType, ColumnType, true>(result_column_ptr, then_idx,
108
34
                                                              then_columns, rows_count);
109
34
        } else {
110
0
            update_result_auto_simd<IndexType, ColumnType>(result_column_ptr, then_idx,
111
0
                                                           then_columns, rows_count);
112
0
        }
113
34
        return result_column_ptr;
114
34
    }
_ZNK5doris9VCaseExpr27_execute_update_result_implIhNS_12ColumnVectorILNS_13PrimitiveTypeE6EEEEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EEPKT_RSt6vectorIS9_SaIS9_EEm
Line
Count
Source
82
94
                                          size_t rows_count) const {
83
94
        auto result_column_ptr = data_type()->create_column();
84
94
        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
94
        } else if (data_type()->is_nullable()) {
106
            // result_column and all then_column is nullable.
107
0
            update_result_normal<IndexType, ColumnType, true>(result_column_ptr, then_idx,
108
0
                                                              then_columns, rows_count);
109
94
        } else {
110
94
            update_result_auto_simd<IndexType, ColumnType>(result_column_ptr, then_idx,
111
94
                                                           then_columns, rows_count);
112
94
        }
113
94
        return result_column_ptr;
114
94
    }
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
68
                                          size_t rows_count) const {
83
68
        auto result_column_ptr = data_type()->create_column();
84
68
        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
68
        } else if (data_type()->is_nullable()) {
106
            // result_column and all then_column is nullable.
107
0
            update_result_normal<IndexType, ColumnType, true>(result_column_ptr, then_idx,
108
0
                                                              then_columns, rows_count);
109
68
        } else {
110
68
            update_result_auto_simd<IndexType, ColumnType>(result_column_ptr, then_idx,
111
68
                                                           then_columns, rows_count);
112
68
        }
113
68
        return result_column_ptr;
114
68
    }
_ZNK5doris9VCaseExpr27_execute_update_result_implIhNS_13ColumnDecimalILNS_13PrimitiveTypeE35EEEEENS_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_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
71
                                          size_t rows_count) const {
83
71
        auto result_column_ptr = data_type()->create_column();
84
71
        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
71
                      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
71
            if (data_type()->is_nullable()) {
99
27
                update_result_normal<IndexType, ColumnType, true>(result_column_ptr, then_idx,
100
27
                                                                  then_columns, rows_count);
101
44
            } else {
102
44
                update_result_normal<IndexType, ColumnType, false>(result_column_ptr, then_idx,
103
44
                                                                   then_columns, rows_count);
104
44
            }
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
71
        return result_column_ptr;
114
71
    }
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
_ZNK5doris9VCaseExpr27_execute_update_result_implIhNS_12ColumnVectorILNS_13PrimitiveTypeE25EEEEENS_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
0
            update_result_normal<IndexType, ColumnType, true>(result_column_ptr, then_idx,
108
0
                                                              then_columns, rows_count);
109
2
        } else {
110
2
            update_result_auto_simd<IndexType, ColumnType>(result_column_ptr, then_idx,
111
2
                                                           then_columns, rows_count);
112
2
        }
113
2
        return result_column_ptr;
114
2
    }
Unexecuted instantiation: _ZNK5doris9VCaseExpr27_execute_update_result_implIhNS_12ColumnVectorILNS_13PrimitiveTypeE26EEEEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EEPKT_RSt6vectorIS9_SaIS9_EEm
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
4
                                          size_t rows_count) const {
83
4
        auto result_column_ptr = data_type()->create_column();
84
4
        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
4
                      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
4
            if (data_type()->is_nullable()) {
99
4
                update_result_normal<IndexType, ColumnType, true>(result_column_ptr, then_idx,
100
4
                                                                  then_columns, rows_count);
101
4
            } 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
4
        return result_column_ptr;
114
4
    }
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
292
                                     size_t rows_count) const {
120
292
#define CASE_TYPE(ptype, coltype) \
121
292
    case PrimitiveType::ptype:    \
122
291
        return _execute_update_result_impl<IndexType, coltype>(then_idx, then_columns, rows_count);
123
124
292
        switch (data_type()->get_primitive_type()) {
125
0
            CASE_TYPE(TYPE_BOOLEAN, ColumnUInt8)
126
11
            CASE_TYPE(TYPE_TINYINT, ColumnInt8)
127
0
            CASE_TYPE(TYPE_SMALLINT, ColumnInt16)
128
34
            CASE_TYPE(TYPE_INT, ColumnInt32)
129
94
            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
68
            CASE_TYPE(TYPE_DECIMAL64, ColumnDecimal64)
135
1
            CASE_TYPE(TYPE_DECIMAL256, ColumnDecimal256)
136
1
            CASE_TYPE(TYPE_DECIMAL128I, ColumnDecimal128V3)
137
0
            CASE_TYPE(TYPE_DECIMALV2, ColumnDecimal128V2)
138
0
            CASE_TYPE(TYPE_STRING, ColumnString)
139
0
            CASE_TYPE(TYPE_CHAR, ColumnString)
140
72
            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
2
            CASE_TYPE(TYPE_DATEV2, ColumnDateV2)
145
0
            CASE_TYPE(TYPE_DATETIMEV2, ColumnDateTimeV2)
146
0
            CASE_TYPE(TYPE_TIMESTAMPTZ, ColumnTimeStampTz)
147
0
            CASE_TYPE(TYPE_IPV6, ColumnIPv6)
148
0
            CASE_TYPE(TYPE_IPV4, ColumnIPv4)
149
1
            CASE_TYPE(TYPE_ARRAY, ColumnArray)
150
0
            CASE_TYPE(TYPE_MAP, ColumnMap)
151
0
            CASE_TYPE(TYPE_STRUCT, ColumnStruct)
152
4
            CASE_TYPE(TYPE_BITMAP, ColumnBitmap)
153
0
            CASE_TYPE(TYPE_HLL, ColumnHLL)
154
0
            CASE_TYPE(TYPE_QUANTILE_STATE, ColumnQuantileState)
155
0
        case PrimitiveType::TYPE_VARIANT: {
156
0
            const IDataType* variant_type = remove_nullable(data_type()).get();
157
0
            if (dynamic_cast<const DataTypeVariantV2*>(variant_type) != nullptr) {
158
0
                return _execute_update_result_impl<IndexType, ColumnVariantV2>(
159
0
                        then_idx, then_columns, rows_count);
160
0
            }
161
0
            DORIS_CHECK(dynamic_cast<const DataTypeVariant*>(variant_type) != nullptr);
162
0
            return _execute_update_result_impl<IndexType, ColumnVariant>(then_idx, then_columns,
163
0
                                                                         rows_count);
164
0
        }
165
0
        default:
166
0
            throw Exception(ErrorCode::NOT_IMPLEMENTED_ERROR, "argument_type {} not supported",
167
0
                            data_type()->get_name());
168
292
        }
169
292
#undef CASE_TYPE
170
292
    }
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
292
                                     size_t rows_count) const {
120
292
#define CASE_TYPE(ptype, coltype) \
121
292
    case PrimitiveType::ptype:    \
122
292
        return _execute_update_result_impl<IndexType, coltype>(then_idx, then_columns, rows_count);
123
124
292
        switch (data_type()->get_primitive_type()) {
125
0
            CASE_TYPE(TYPE_BOOLEAN, ColumnUInt8)
126
11
            CASE_TYPE(TYPE_TINYINT, ColumnInt8)
127
0
            CASE_TYPE(TYPE_SMALLINT, ColumnInt16)
128
34
            CASE_TYPE(TYPE_INT, ColumnInt32)
129
94
            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
68
            CASE_TYPE(TYPE_DECIMAL64, ColumnDecimal64)
135
1
            CASE_TYPE(TYPE_DECIMAL256, ColumnDecimal256)
136
1
            CASE_TYPE(TYPE_DECIMAL128I, ColumnDecimal128V3)
137
0
            CASE_TYPE(TYPE_DECIMALV2, ColumnDecimal128V2)
138
0
            CASE_TYPE(TYPE_STRING, ColumnString)
139
0
            CASE_TYPE(TYPE_CHAR, ColumnString)
140
72
            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
2
            CASE_TYPE(TYPE_DATEV2, ColumnDateV2)
145
0
            CASE_TYPE(TYPE_DATETIMEV2, ColumnDateTimeV2)
146
0
            CASE_TYPE(TYPE_TIMESTAMPTZ, ColumnTimeStampTz)
147
0
            CASE_TYPE(TYPE_IPV6, ColumnIPv6)
148
0
            CASE_TYPE(TYPE_IPV4, ColumnIPv4)
149
1
            CASE_TYPE(TYPE_ARRAY, ColumnArray)
150
0
            CASE_TYPE(TYPE_MAP, ColumnMap)
151
0
            CASE_TYPE(TYPE_STRUCT, ColumnStruct)
152
4
            CASE_TYPE(TYPE_BITMAP, ColumnBitmap)
153
0
            CASE_TYPE(TYPE_HLL, ColumnHLL)
154
0
            CASE_TYPE(TYPE_QUANTILE_STATE, ColumnQuantileState)
155
0
        case PrimitiveType::TYPE_VARIANT: {
156
0
            const IDataType* variant_type = remove_nullable(data_type()).get();
157
0
            if (dynamic_cast<const DataTypeVariantV2*>(variant_type) != nullptr) {
158
0
                return _execute_update_result_impl<IndexType, ColumnVariantV2>(
159
0
                        then_idx, then_columns, rows_count);
160
0
            }
161
0
            DORIS_CHECK(dynamic_cast<const DataTypeVariant*>(variant_type) != nullptr);
162
0
            return _execute_update_result_impl<IndexType, ColumnVariant>(then_idx, then_columns,
163
0
                                                                         rows_count);
164
0
        }
165
0
        default:
166
0
            throw Exception(ErrorCode::NOT_IMPLEMENTED_ERROR, "argument_type {} not supported",
167
0
                            data_type()->get_name());
168
292
        }
169
292
#undef CASE_TYPE
170
292
    }
171
172
    template <typename IndexType, typename ColumnType, bool then_null>
173
    void update_result_normal(MutableColumnPtr& result_column_ptr,
174
                              const IndexType* __restrict then_idx,
175
119
                              std::vector<ColumnPtr>& then_columns, size_t rows_count) const {
176
119
        std::vector<ColumnPtr> raw_then_columns(then_columns.size());
177
119
        std::vector<uint8_t> is_consts(then_columns.size());
178
119
        std::vector<uint8_t> is_nullable(then_columns.size());
179
375
        for (size_t i = 0; i < then_columns.size(); i++) {
180
256
            if (!then_columns[i]) {
181
28
                continue;
182
28
            }
183
228
            std::tie(raw_then_columns[i], is_consts[i]) = unpack_if_const(then_columns[i]);
184
228
            is_nullable[i] = is_column_nullable(*raw_then_columns[i]);
185
228
        }
186
187
119
        auto* raw_result_column = result_column_ptr.get();
188
407
        for (int row_idx = 0; row_idx < rows_count; row_idx++) {
189
288
            if (!_has_else_expr && !then_idx[row_idx]) {
190
11
                assert_cast<ColumnNullable*, TypeCheckOnRelease::DISABLE>(raw_result_column)
191
11
                        ->insert_default();
192
11
                continue;
193
11
            }
194
277
            size_t target = is_consts[then_idx[row_idx]] ? 0 : row_idx;
195
277
            if constexpr (then_null) {
196
143
                auto* nullable = assert_cast<ColumnNullable*, TypeCheckOnRelease::DISABLE>(
197
143
                        result_column_ptr.get());
198
143
                if (is_nullable[then_idx[row_idx]]) {
199
59
                    nullable->insert_from_with_type<ColumnType>(
200
59
                            *raw_then_columns[then_idx[row_idx]], target);
201
84
                } else {
202
84
                    auto* nested = assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(
203
84
                            nullable->get_nested_column_ptr().get());
204
84
                    nested->insert_from(*raw_then_columns[then_idx[row_idx]], target);
205
84
                    nullable->push_false_to_nullmap(1);
206
84
                }
207
143
            } else {
208
134
                assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(result_column_ptr.get())
209
134
                        ->insert_from(*raw_then_columns[then_idx[row_idx]], target);
210
134
            }
211
277
        }
212
119
    }
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_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
175
2
                              std::vector<ColumnPtr>& then_columns, size_t rows_count) const {
176
2
        std::vector<ColumnPtr> raw_then_columns(then_columns.size());
177
2
        std::vector<uint8_t> is_consts(then_columns.size());
178
2
        std::vector<uint8_t> is_nullable(then_columns.size());
179
6
        for (size_t i = 0; i < then_columns.size(); i++) {
180
4
            if (!then_columns[i]) {
181
2
                continue;
182
2
            }
183
2
            std::tie(raw_then_columns[i], is_consts[i]) = unpack_if_const(then_columns[i]);
184
2
            is_nullable[i] = is_column_nullable(*raw_then_columns[i]);
185
2
        }
186
187
2
        auto* raw_result_column = result_column_ptr.get();
188
5
        for (int row_idx = 0; row_idx < rows_count; row_idx++) {
189
3
            if (!_has_else_expr && !then_idx[row_idx]) {
190
0
                assert_cast<ColumnNullable*, TypeCheckOnRelease::DISABLE>(raw_result_column)
191
0
                        ->insert_default();
192
0
                continue;
193
0
            }
194
3
            size_t target = is_consts[then_idx[row_idx]] ? 0 : row_idx;
195
3
            if constexpr (then_null) {
196
3
                auto* nullable = assert_cast<ColumnNullable*, TypeCheckOnRelease::DISABLE>(
197
3
                        result_column_ptr.get());
198
3
                if (is_nullable[then_idx[row_idx]]) {
199
0
                    nullable->insert_from_with_type<ColumnType>(
200
0
                            *raw_then_columns[then_idx[row_idx]], target);
201
3
                } else {
202
3
                    auto* nested = assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(
203
3
                            nullable->get_nested_column_ptr().get());
204
3
                    nested->insert_from(*raw_then_columns[then_idx[row_idx]], target);
205
3
                    nullable->push_false_to_nullmap(1);
206
3
                }
207
            } else {
208
                assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(result_column_ptr.get())
209
                        ->insert_from(*raw_then_columns[then_idx[row_idx]], target);
210
            }
211
3
        }
212
2
    }
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
175
34
                              std::vector<ColumnPtr>& then_columns, size_t rows_count) const {
176
34
        std::vector<ColumnPtr> raw_then_columns(then_columns.size());
177
34
        std::vector<uint8_t> is_consts(then_columns.size());
178
34
        std::vector<uint8_t> is_nullable(then_columns.size());
179
89
        for (size_t i = 0; i < then_columns.size(); i++) {
180
55
            if (!then_columns[i]) {
181
0
                continue;
182
0
            }
183
55
            std::tie(raw_then_columns[i], is_consts[i]) = unpack_if_const(then_columns[i]);
184
55
            is_nullable[i] = is_column_nullable(*raw_then_columns[i]);
185
55
        }
186
187
34
        auto* raw_result_column = result_column_ptr.get();
188
78
        for (int row_idx = 0; row_idx < rows_count; row_idx++) {
189
44
            if (!_has_else_expr && !then_idx[row_idx]) {
190
0
                assert_cast<ColumnNullable*, TypeCheckOnRelease::DISABLE>(raw_result_column)
191
0
                        ->insert_default();
192
0
                continue;
193
0
            }
194
44
            size_t target = is_consts[then_idx[row_idx]] ? 0 : row_idx;
195
44
            if constexpr (then_null) {
196
44
                auto* nullable = assert_cast<ColumnNullable*, TypeCheckOnRelease::DISABLE>(
197
44
                        result_column_ptr.get());
198
44
                if (is_nullable[then_idx[row_idx]]) {
199
44
                    nullable->insert_from_with_type<ColumnType>(
200
44
                            *raw_then_columns[then_idx[row_idx]], target);
201
44
                } else {
202
0
                    auto* nested = assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(
203
0
                            nullable->get_nested_column_ptr().get());
204
0
                    nested->insert_from(*raw_then_columns[then_idx[row_idx]], target);
205
0
                    nullable->push_false_to_nullmap(1);
206
0
                }
207
            } else {
208
                assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(result_column_ptr.get())
209
                        ->insert_from(*raw_then_columns[then_idx[row_idx]], target);
210
            }
211
44
        }
212
34
    }
Unexecuted instantiation: _ZNK5doris9VCaseExpr20update_result_normalIhNS_12ColumnVectorILNS_13PrimitiveTypeE6EEELb1EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
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
175
3
                              std::vector<ColumnPtr>& then_columns, size_t rows_count) const {
176
3
        std::vector<ColumnPtr> raw_then_columns(then_columns.size());
177
3
        std::vector<uint8_t> is_consts(then_columns.size());
178
3
        std::vector<uint8_t> is_nullable(then_columns.size());
179
11
        for (size_t i = 0; i < then_columns.size(); i++) {
180
8
            if (!then_columns[i]) {
181
0
                continue;
182
0
            }
183
8
            std::tie(raw_then_columns[i], is_consts[i]) = unpack_if_const(then_columns[i]);
184
8
            is_nullable[i] = is_column_nullable(*raw_then_columns[i]);
185
8
        }
186
187
3
        auto* raw_result_column = result_column_ptr.get();
188
13
        for (int row_idx = 0; row_idx < rows_count; row_idx++) {
189
10
            if (!_has_else_expr && !then_idx[row_idx]) {
190
0
                assert_cast<ColumnNullable*, TypeCheckOnRelease::DISABLE>(raw_result_column)
191
0
                        ->insert_default();
192
0
                continue;
193
0
            }
194
10
            size_t target = is_consts[then_idx[row_idx]] ? 0 : row_idx;
195
10
            if constexpr (then_null) {
196
10
                auto* nullable = assert_cast<ColumnNullable*, TypeCheckOnRelease::DISABLE>(
197
10
                        result_column_ptr.get());
198
10
                if (is_nullable[then_idx[row_idx]]) {
199
7
                    nullable->insert_from_with_type<ColumnType>(
200
7
                            *raw_then_columns[then_idx[row_idx]], target);
201
7
                } else {
202
3
                    auto* nested = assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(
203
3
                            nullable->get_nested_column_ptr().get());
204
3
                    nested->insert_from(*raw_then_columns[then_idx[row_idx]], target);
205
3
                    nullable->push_false_to_nullmap(1);
206
3
                }
207
            } else {
208
                assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(result_column_ptr.get())
209
                        ->insert_from(*raw_then_columns[then_idx[row_idx]], target);
210
            }
211
10
        }
212
3
    }
Unexecuted instantiation: _ZNK5doris9VCaseExpr20update_result_normalIhNS_13ColumnDecimalILNS_13PrimitiveTypeE28EEELb1EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr20update_result_normalIhNS_13ColumnDecimalILNS_13PrimitiveTypeE29EEELb1EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
_ZNK5doris9VCaseExpr20update_result_normalIhNS_13ColumnDecimalILNS_13PrimitiveTypeE35EEELb1EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Line
Count
Source
175
1
                              std::vector<ColumnPtr>& then_columns, size_t rows_count) const {
176
1
        std::vector<ColumnPtr> raw_then_columns(then_columns.size());
177
1
        std::vector<uint8_t> is_consts(then_columns.size());
178
1
        std::vector<uint8_t> is_nullable(then_columns.size());
179
3
        for (size_t i = 0; i < then_columns.size(); i++) {
180
2
            if (!then_columns[i]) {
181
0
                continue;
182
0
            }
183
2
            std::tie(raw_then_columns[i], is_consts[i]) = unpack_if_const(then_columns[i]);
184
2
            is_nullable[i] = is_column_nullable(*raw_then_columns[i]);
185
2
        }
186
187
1
        auto* raw_result_column = result_column_ptr.get();
188
2
        for (int row_idx = 0; row_idx < rows_count; row_idx++) {
189
1
            if (!_has_else_expr && !then_idx[row_idx]) {
190
0
                assert_cast<ColumnNullable*, TypeCheckOnRelease::DISABLE>(raw_result_column)
191
0
                        ->insert_default();
192
0
                continue;
193
0
            }
194
1
            size_t target = is_consts[then_idx[row_idx]] ? 0 : row_idx;
195
1
            if constexpr (then_null) {
196
1
                auto* nullable = assert_cast<ColumnNullable*, TypeCheckOnRelease::DISABLE>(
197
1
                        result_column_ptr.get());
198
1
                if (is_nullable[then_idx[row_idx]]) {
199
1
                    nullable->insert_from_with_type<ColumnType>(
200
1
                            *raw_then_columns[then_idx[row_idx]], target);
201
1
                } else {
202
0
                    auto* nested = assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(
203
0
                            nullable->get_nested_column_ptr().get());
204
0
                    nested->insert_from(*raw_then_columns[then_idx[row_idx]], target);
205
0
                    nullable->push_false_to_nullmap(1);
206
0
                }
207
            } else {
208
                assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(result_column_ptr.get())
209
                        ->insert_from(*raw_then_columns[then_idx[row_idx]], target);
210
            }
211
1
        }
212
1
    }
_ZNK5doris9VCaseExpr20update_result_normalIhNS_13ColumnDecimalILNS_13PrimitiveTypeE30EEELb1EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Line
Count
Source
175
1
                              std::vector<ColumnPtr>& then_columns, size_t rows_count) const {
176
1
        std::vector<ColumnPtr> raw_then_columns(then_columns.size());
177
1
        std::vector<uint8_t> is_consts(then_columns.size());
178
1
        std::vector<uint8_t> is_nullable(then_columns.size());
179
3
        for (size_t i = 0; i < then_columns.size(); i++) {
180
2
            if (!then_columns[i]) {
181
0
                continue;
182
0
            }
183
2
            std::tie(raw_then_columns[i], is_consts[i]) = unpack_if_const(then_columns[i]);
184
2
            is_nullable[i] = is_column_nullable(*raw_then_columns[i]);
185
2
        }
186
187
1
        auto* raw_result_column = result_column_ptr.get();
188
2
        for (int row_idx = 0; row_idx < rows_count; row_idx++) {
189
1
            if (!_has_else_expr && !then_idx[row_idx]) {
190
0
                assert_cast<ColumnNullable*, TypeCheckOnRelease::DISABLE>(raw_result_column)
191
0
                        ->insert_default();
192
0
                continue;
193
0
            }
194
1
            size_t target = is_consts[then_idx[row_idx]] ? 0 : row_idx;
195
1
            if constexpr (then_null) {
196
1
                auto* nullable = assert_cast<ColumnNullable*, TypeCheckOnRelease::DISABLE>(
197
1
                        result_column_ptr.get());
198
1
                if (is_nullable[then_idx[row_idx]]) {
199
1
                    nullable->insert_from_with_type<ColumnType>(
200
1
                            *raw_then_columns[then_idx[row_idx]], target);
201
1
                } else {
202
0
                    auto* nested = assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(
203
0
                            nullable->get_nested_column_ptr().get());
204
0
                    nested->insert_from(*raw_then_columns[then_idx[row_idx]], target);
205
0
                    nullable->push_false_to_nullmap(1);
206
0
                }
207
            } else {
208
                assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(result_column_ptr.get())
209
                        ->insert_from(*raw_then_columns[then_idx[row_idx]], target);
210
            }
211
1
        }
212
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
175
27
                              std::vector<ColumnPtr>& then_columns, size_t rows_count) const {
176
27
        std::vector<ColumnPtr> raw_then_columns(then_columns.size());
177
27
        std::vector<uint8_t> is_consts(then_columns.size());
178
27
        std::vector<uint8_t> is_nullable(then_columns.size());
179
92
        for (size_t i = 0; i < then_columns.size(); i++) {
180
65
            if (!then_columns[i]) {
181
26
                continue;
182
26
            }
183
39
            std::tie(raw_then_columns[i], is_consts[i]) = unpack_if_const(then_columns[i]);
184
39
            is_nullable[i] = is_column_nullable(*raw_then_columns[i]);
185
39
        }
186
187
27
        auto* raw_result_column = result_column_ptr.get();
188
115
        for (int row_idx = 0; row_idx < rows_count; row_idx++) {
189
88
            if (!_has_else_expr && !then_idx[row_idx]) {
190
11
                assert_cast<ColumnNullable*, TypeCheckOnRelease::DISABLE>(raw_result_column)
191
11
                        ->insert_default();
192
11
                continue;
193
11
            }
194
77
            size_t target = is_consts[then_idx[row_idx]] ? 0 : row_idx;
195
77
            if constexpr (then_null) {
196
77
                auto* nullable = assert_cast<ColumnNullable*, TypeCheckOnRelease::DISABLE>(
197
77
                        result_column_ptr.get());
198
77
                if (is_nullable[then_idx[row_idx]]) {
199
3
                    nullable->insert_from_with_type<ColumnType>(
200
3
                            *raw_then_columns[then_idx[row_idx]], target);
201
74
                } else {
202
74
                    auto* nested = assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(
203
74
                            nullable->get_nested_column_ptr().get());
204
74
                    nested->insert_from(*raw_then_columns[then_idx[row_idx]], target);
205
74
                    nullable->push_false_to_nullmap(1);
206
74
                }
207
            } else {
208
                assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(result_column_ptr.get())
209
                        ->insert_from(*raw_then_columns[then_idx[row_idx]], target);
210
            }
211
77
        }
212
27
    }
_ZNK5doris9VCaseExpr20update_result_normalIhNS_9ColumnStrIjEELb0EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS5_EEPKT_RSt6vectorINS6_13immutable_ptrIS5_EESaISF_EEm
Line
Count
Source
175
46
                              std::vector<ColumnPtr>& then_columns, size_t rows_count) const {
176
46
        std::vector<ColumnPtr> raw_then_columns(then_columns.size());
177
46
        std::vector<uint8_t> is_consts(then_columns.size());
178
46
        std::vector<uint8_t> is_nullable(then_columns.size());
179
157
        for (size_t i = 0; i < then_columns.size(); i++) {
180
111
            if (!then_columns[i]) {
181
0
                continue;
182
0
            }
183
111
            std::tie(raw_then_columns[i], is_consts[i]) = unpack_if_const(then_columns[i]);
184
111
            is_nullable[i] = is_column_nullable(*raw_then_columns[i]);
185
111
        }
186
187
46
        auto* raw_result_column = result_column_ptr.get();
188
180
        for (int row_idx = 0; row_idx < rows_count; row_idx++) {
189
134
            if (!_has_else_expr && !then_idx[row_idx]) {
190
0
                assert_cast<ColumnNullable*, TypeCheckOnRelease::DISABLE>(raw_result_column)
191
0
                        ->insert_default();
192
0
                continue;
193
0
            }
194
134
            size_t target = is_consts[then_idx[row_idx]] ? 0 : row_idx;
195
            if constexpr (then_null) {
196
                auto* nullable = assert_cast<ColumnNullable*, TypeCheckOnRelease::DISABLE>(
197
                        result_column_ptr.get());
198
                if (is_nullable[then_idx[row_idx]]) {
199
                    nullable->insert_from_with_type<ColumnType>(
200
                            *raw_then_columns[then_idx[row_idx]], target);
201
                } else {
202
                    auto* nested = assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(
203
                            nullable->get_nested_column_ptr().get());
204
                    nested->insert_from(*raw_then_columns[then_idx[row_idx]], target);
205
                    nullable->push_false_to_nullmap(1);
206
                }
207
134
            } else {
208
134
                assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(result_column_ptr.get())
209
134
                        ->insert_from(*raw_then_columns[then_idx[row_idx]], target);
210
134
            }
211
134
        }
212
46
    }
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
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
175
1
                              std::vector<ColumnPtr>& then_columns, size_t rows_count) const {
176
1
        std::vector<ColumnPtr> raw_then_columns(then_columns.size());
177
1
        std::vector<uint8_t> is_consts(then_columns.size());
178
1
        std::vector<uint8_t> is_nullable(then_columns.size());
179
4
        for (size_t i = 0; i < then_columns.size(); i++) {
180
3
            if (!then_columns[i]) {
181
0
                continue;
182
0
            }
183
3
            std::tie(raw_then_columns[i], is_consts[i]) = unpack_if_const(then_columns[i]);
184
3
            is_nullable[i] = is_column_nullable(*raw_then_columns[i]);
185
3
        }
186
187
1
        auto* raw_result_column = result_column_ptr.get();
188
4
        for (int row_idx = 0; row_idx < rows_count; row_idx++) {
189
3
            if (!_has_else_expr && !then_idx[row_idx]) {
190
0
                assert_cast<ColumnNullable*, TypeCheckOnRelease::DISABLE>(raw_result_column)
191
0
                        ->insert_default();
192
0
                continue;
193
0
            }
194
3
            size_t target = is_consts[then_idx[row_idx]] ? 0 : row_idx;
195
3
            if constexpr (then_null) {
196
3
                auto* nullable = assert_cast<ColumnNullable*, TypeCheckOnRelease::DISABLE>(
197
3
                        result_column_ptr.get());
198
3
                if (is_nullable[then_idx[row_idx]]) {
199
1
                    nullable->insert_from_with_type<ColumnType>(
200
1
                            *raw_then_columns[then_idx[row_idx]], target);
201
2
                } else {
202
2
                    auto* nested = assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(
203
2
                            nullable->get_nested_column_ptr().get());
204
2
                    nested->insert_from(*raw_then_columns[then_idx[row_idx]], target);
205
2
                    nullable->push_false_to_nullmap(1);
206
2
                }
207
            } else {
208
                assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(result_column_ptr.get())
209
                        ->insert_from(*raw_then_columns[then_idx[row_idx]], target);
210
            }
211
3
        }
212
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
175
4
                              std::vector<ColumnPtr>& then_columns, size_t rows_count) const {
176
4
        std::vector<ColumnPtr> raw_then_columns(then_columns.size());
177
4
        std::vector<uint8_t> is_consts(then_columns.size());
178
4
        std::vector<uint8_t> is_nullable(then_columns.size());
179
10
        for (size_t i = 0; i < then_columns.size(); i++) {
180
6
            if (!then_columns[i]) {
181
0
                continue;
182
0
            }
183
6
            std::tie(raw_then_columns[i], is_consts[i]) = unpack_if_const(then_columns[i]);
184
6
            is_nullable[i] = is_column_nullable(*raw_then_columns[i]);
185
6
        }
186
187
4
        auto* raw_result_column = result_column_ptr.get();
188
8
        for (int row_idx = 0; row_idx < rows_count; row_idx++) {
189
4
            if (!_has_else_expr && !then_idx[row_idx]) {
190
0
                assert_cast<ColumnNullable*, TypeCheckOnRelease::DISABLE>(raw_result_column)
191
0
                        ->insert_default();
192
0
                continue;
193
0
            }
194
4
            size_t target = is_consts[then_idx[row_idx]] ? 0 : row_idx;
195
4
            if constexpr (then_null) {
196
4
                auto* nullable = assert_cast<ColumnNullable*, TypeCheckOnRelease::DISABLE>(
197
4
                        result_column_ptr.get());
198
4
                if (is_nullable[then_idx[row_idx]]) {
199
2
                    nullable->insert_from_with_type<ColumnType>(
200
2
                            *raw_then_columns[then_idx[row_idx]], target);
201
2
                } else {
202
2
                    auto* nested = assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(
203
2
                            nullable->get_nested_column_ptr().get());
204
2
                    nested->insert_from(*raw_then_columns[then_idx[row_idx]], target);
205
2
                    nullable->push_false_to_nullmap(1);
206
2
                }
207
            } else {
208
                assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(result_column_ptr.get())
209
                        ->insert_from(*raw_then_columns[then_idx[row_idx]], target);
210
            }
211
4
        }
212
4
    }
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
213
214
    template <typename IndexType, typename ColumnType>
215
    void update_result_auto_simd(MutableColumnPtr& result_column_ptr,
216
                                 const IndexType* __restrict then_idx,
217
173
                                 std::vector<ColumnPtr>& then_columns, size_t rows_count) const {
218
279
        for (auto& then_ptr : then_columns) {
219
279
            then_ptr = then_ptr->convert_to_full_column_if_const();
220
279
        }
221
222
173
        result_column_ptr->resize(rows_count);
223
173
        auto* __restrict result_raw_data =
224
173
                assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(result_column_ptr.get())
225
173
                        ->get_data()
226
173
                        .data();
227
228
        // set default value
229
554
        for (int i = 0; i < rows_count; i++) {
230
            if constexpr (std::is_same_v<ColumnType, ColumnDate> ||
231
                          std::is_same_v<ColumnType, ColumnDateTime> ||
232
                          std::is_same_v<ColumnType, ColumnDateV2> ||
233
                          std::is_same_v<ColumnType, ColumnDateTimeV2> ||
234
10
                          std::is_same_v<ColumnType, ColumnTimeStampTz>) {
235
10
                result_raw_data[i] = ColumnType::default_value();
236
371
            } else {
237
371
                result_raw_data[i] = {};
238
371
            }
239
381
        }
240
241
452
        for (IndexType i = 0; i < then_columns.size(); i++) {
242
279
            if (!then_columns[i]) {
243
0
                continue;
244
0
            }
245
279
            const auto* __restrict column_raw_data =
246
279
                    assert_cast<const ColumnType*, TypeCheckOnRelease::DISABLE>(
247
279
                            then_columns[i].get())
248
279
                            ->get_data()
249
279
                            .data();
250
            if constexpr (std::is_same_v<ColumnType, ColumnDate> ||
251
                          std::is_same_v<ColumnType, ColumnDateTime> ||
252
                          std::is_same_v<ColumnType, ColumnDateV2> ||
253
                          std::is_same_v<ColumnType, ColumnDateTimeV2> ||
254
6
                          std::is_same_v<ColumnType, ColumnTimeStampTz>) {
255
36
                for (int row_idx = 0; row_idx < rows_count; row_idx++) {
256
30
                    result_raw_data[row_idx] = (then_idx[row_idx] == i) ? column_raw_data[row_idx]
257
30
                                                                        : result_raw_data[row_idx];
258
30
                }
259
273
            } else {
260
865
                for (int row_idx = 0; row_idx < rows_count; row_idx++) {
261
592
                    result_raw_data[row_idx] +=
262
592
                            typename ColumnType::value_type(then_idx[row_idx] == i) *
263
592
                            column_raw_data[row_idx];
264
592
                }
265
273
            }
266
279
        }
267
173
    }
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_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
217
9
                                 std::vector<ColumnPtr>& then_columns, size_t rows_count) const {
218
13
        for (auto& then_ptr : then_columns) {
219
13
            then_ptr = then_ptr->convert_to_full_column_if_const();
220
13
        }
221
222
9
        result_column_ptr->resize(rows_count);
223
9
        auto* __restrict result_raw_data =
224
9
                assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(result_column_ptr.get())
225
9
                        ->get_data()
226
9
                        .data();
227
228
        // set default value
229
24
        for (int i = 0; i < rows_count; i++) {
230
            if constexpr (std::is_same_v<ColumnType, ColumnDate> ||
231
                          std::is_same_v<ColumnType, ColumnDateTime> ||
232
                          std::is_same_v<ColumnType, ColumnDateV2> ||
233
                          std::is_same_v<ColumnType, ColumnDateTimeV2> ||
234
                          std::is_same_v<ColumnType, ColumnTimeStampTz>) {
235
                result_raw_data[i] = ColumnType::default_value();
236
15
            } else {
237
15
                result_raw_data[i] = {};
238
15
            }
239
15
        }
240
241
22
        for (IndexType i = 0; i < then_columns.size(); i++) {
242
13
            if (!then_columns[i]) {
243
0
                continue;
244
0
            }
245
13
            const auto* __restrict column_raw_data =
246
13
                    assert_cast<const ColumnType*, TypeCheckOnRelease::DISABLE>(
247
13
                            then_columns[i].get())
248
13
                            ->get_data()
249
13
                            .data();
250
            if constexpr (std::is_same_v<ColumnType, ColumnDate> ||
251
                          std::is_same_v<ColumnType, ColumnDateTime> ||
252
                          std::is_same_v<ColumnType, ColumnDateV2> ||
253
                          std::is_same_v<ColumnType, ColumnDateTimeV2> ||
254
                          std::is_same_v<ColumnType, ColumnTimeStampTz>) {
255
                for (int row_idx = 0; row_idx < rows_count; row_idx++) {
256
                    result_raw_data[row_idx] = (then_idx[row_idx] == i) ? column_raw_data[row_idx]
257
                                                                        : result_raw_data[row_idx];
258
                }
259
13
            } else {
260
35
                for (int row_idx = 0; row_idx < rows_count; row_idx++) {
261
22
                    result_raw_data[row_idx] +=
262
22
                            typename ColumnType::value_type(then_idx[row_idx] == i) *
263
22
                            column_raw_data[row_idx];
264
22
                }
265
13
            }
266
13
        }
267
9
    }
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
217
94
                                 std::vector<ColumnPtr>& then_columns, size_t rows_count) const {
218
96
        for (auto& then_ptr : then_columns) {
219
96
            then_ptr = then_ptr->convert_to_full_column_if_const();
220
96
        }
221
222
94
        result_column_ptr->resize(rows_count);
223
94
        auto* __restrict result_raw_data =
224
94
                assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(result_column_ptr.get())
225
94
                        ->get_data()
226
94
                        .data();
227
228
        // set default value
229
334
        for (int i = 0; i < rows_count; i++) {
230
            if constexpr (std::is_same_v<ColumnType, ColumnDate> ||
231
                          std::is_same_v<ColumnType, ColumnDateTime> ||
232
                          std::is_same_v<ColumnType, ColumnDateV2> ||
233
                          std::is_same_v<ColumnType, ColumnDateTimeV2> ||
234
                          std::is_same_v<ColumnType, ColumnTimeStampTz>) {
235
                result_raw_data[i] = ColumnType::default_value();
236
240
            } else {
237
240
                result_raw_data[i] = {};
238
240
            }
239
240
        }
240
241
190
        for (IndexType i = 0; i < then_columns.size(); i++) {
242
96
            if (!then_columns[i]) {
243
0
                continue;
244
0
            }
245
96
            const auto* __restrict column_raw_data =
246
96
                    assert_cast<const ColumnType*, TypeCheckOnRelease::DISABLE>(
247
96
                            then_columns[i].get())
248
96
                            ->get_data()
249
96
                            .data();
250
            if constexpr (std::is_same_v<ColumnType, ColumnDate> ||
251
                          std::is_same_v<ColumnType, ColumnDateTime> ||
252
                          std::is_same_v<ColumnType, ColumnDateV2> ||
253
                          std::is_same_v<ColumnType, ColumnDateTimeV2> ||
254
                          std::is_same_v<ColumnType, ColumnTimeStampTz>) {
255
                for (int row_idx = 0; row_idx < rows_count; row_idx++) {
256
                    result_raw_data[row_idx] = (then_idx[row_idx] == i) ? column_raw_data[row_idx]
257
                                                                        : result_raw_data[row_idx];
258
                }
259
96
            } else {
260
362
                for (int row_idx = 0; row_idx < rows_count; row_idx++) {
261
266
                    result_raw_data[row_idx] +=
262
266
                            typename ColumnType::value_type(then_idx[row_idx] == i) *
263
266
                            column_raw_data[row_idx];
264
266
                }
265
96
            }
266
96
        }
267
94
    }
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
_ZNK5doris9VCaseExpr23update_result_auto_simdIhNS_13ColumnDecimalILNS_13PrimitiveTypeE29EEEEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Line
Count
Source
217
68
                                 std::vector<ColumnPtr>& then_columns, size_t rows_count) const {
218
164
        for (auto& then_ptr : then_columns) {
219
164
            then_ptr = then_ptr->convert_to_full_column_if_const();
220
164
        }
221
222
68
        result_column_ptr->resize(rows_count);
223
68
        auto* __restrict result_raw_data =
224
68
                assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(result_column_ptr.get())
225
68
                        ->get_data()
226
68
                        .data();
227
228
        // set default value
229
184
        for (int i = 0; i < rows_count; i++) {
230
            if constexpr (std::is_same_v<ColumnType, ColumnDate> ||
231
                          std::is_same_v<ColumnType, ColumnDateTime> ||
232
                          std::is_same_v<ColumnType, ColumnDateV2> ||
233
                          std::is_same_v<ColumnType, ColumnDateTimeV2> ||
234
                          std::is_same_v<ColumnType, ColumnTimeStampTz>) {
235
                result_raw_data[i] = ColumnType::default_value();
236
116
            } else {
237
116
                result_raw_data[i] = {};
238
116
            }
239
116
        }
240
241
232
        for (IndexType i = 0; i < then_columns.size(); i++) {
242
164
            if (!then_columns[i]) {
243
0
                continue;
244
0
            }
245
164
            const auto* __restrict column_raw_data =
246
164
                    assert_cast<const ColumnType*, TypeCheckOnRelease::DISABLE>(
247
164
                            then_columns[i].get())
248
164
                            ->get_data()
249
164
                            .data();
250
            if constexpr (std::is_same_v<ColumnType, ColumnDate> ||
251
                          std::is_same_v<ColumnType, ColumnDateTime> ||
252
                          std::is_same_v<ColumnType, ColumnDateV2> ||
253
                          std::is_same_v<ColumnType, ColumnDateTimeV2> ||
254
                          std::is_same_v<ColumnType, ColumnTimeStampTz>) {
255
                for (int row_idx = 0; row_idx < rows_count; row_idx++) {
256
                    result_raw_data[row_idx] = (then_idx[row_idx] == i) ? column_raw_data[row_idx]
257
                                                                        : result_raw_data[row_idx];
258
                }
259
164
            } else {
260
468
                for (int row_idx = 0; row_idx < rows_count; row_idx++) {
261
304
                    result_raw_data[row_idx] +=
262
304
                            typename ColumnType::value_type(then_idx[row_idx] == i) *
263
304
                            column_raw_data[row_idx];
264
304
                }
265
164
            }
266
164
        }
267
68
    }
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
_ZNK5doris9VCaseExpr23update_result_auto_simdIhNS_12ColumnVectorILNS_13PrimitiveTypeE25EEEEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Line
Count
Source
217
2
                                 std::vector<ColumnPtr>& then_columns, size_t rows_count) const {
218
6
        for (auto& then_ptr : then_columns) {
219
6
            then_ptr = then_ptr->convert_to_full_column_if_const();
220
6
        }
221
222
2
        result_column_ptr->resize(rows_count);
223
2
        auto* __restrict result_raw_data =
224
2
                assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(result_column_ptr.get())
225
2
                        ->get_data()
226
2
                        .data();
227
228
        // set default value
229
12
        for (int i = 0; i < rows_count; i++) {
230
            if constexpr (std::is_same_v<ColumnType, ColumnDate> ||
231
                          std::is_same_v<ColumnType, ColumnDateTime> ||
232
                          std::is_same_v<ColumnType, ColumnDateV2> ||
233
                          std::is_same_v<ColumnType, ColumnDateTimeV2> ||
234
10
                          std::is_same_v<ColumnType, ColumnTimeStampTz>) {
235
10
                result_raw_data[i] = ColumnType::default_value();
236
            } else {
237
                result_raw_data[i] = {};
238
            }
239
10
        }
240
241
8
        for (IndexType i = 0; i < then_columns.size(); i++) {
242
6
            if (!then_columns[i]) {
243
0
                continue;
244
0
            }
245
6
            const auto* __restrict column_raw_data =
246
6
                    assert_cast<const ColumnType*, TypeCheckOnRelease::DISABLE>(
247
6
                            then_columns[i].get())
248
6
                            ->get_data()
249
6
                            .data();
250
            if constexpr (std::is_same_v<ColumnType, ColumnDate> ||
251
                          std::is_same_v<ColumnType, ColumnDateTime> ||
252
                          std::is_same_v<ColumnType, ColumnDateV2> ||
253
                          std::is_same_v<ColumnType, ColumnDateTimeV2> ||
254
6
                          std::is_same_v<ColumnType, ColumnTimeStampTz>) {
255
36
                for (int row_idx = 0; row_idx < rows_count; row_idx++) {
256
30
                    result_raw_data[row_idx] = (then_idx[row_idx] == i) ? column_raw_data[row_idx]
257
30
                                                                        : result_raw_data[row_idx];
258
30
                }
259
            } else {
260
                for (int row_idx = 0; row_idx < rows_count; row_idx++) {
261
                    result_raw_data[row_idx] +=
262
                            typename ColumnType::value_type(then_idx[row_idx] == i) *
263
                            column_raw_data[row_idx];
264
                }
265
            }
266
6
        }
267
2
    }
Unexecuted instantiation: _ZNK5doris9VCaseExpr23update_result_auto_simdIhNS_12ColumnVectorILNS_13PrimitiveTypeE26EEEEEvRNS_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
268
269
    template <typename IndexType>
270
    ColumnPtr _execute_impl(const std::vector<ColumnPtr>& when_columns,
271
292
                            std::vector<ColumnPtr>& then_columns, size_t rows_count) const {
272
292
        std::vector<IndexType> then_idx(rows_count, 0);
273
292
        IndexType* __restrict then_idx_ptr = then_idx.data();
274
534
        for (IndexType i = 0; i < when_columns.size(); i++) {
275
242
            IndexType column_idx = i + 1;
276
242
            auto [raw_when_column, is_consts] = unpack_if_const(when_columns[i]);
277
278
242
            if (is_consts) {
279
0
                if (raw_when_column->get_bool(0)) {
280
0
                    for (int row_idx = 0; row_idx < rows_count; row_idx++) {
281
0
                        then_idx_ptr[row_idx] |= (!then_idx_ptr[row_idx]) * column_idx;
282
0
                    }
283
0
                    break;
284
0
                }
285
0
                continue;
286
0
            }
287
288
242
            if (is_column_nullable(*raw_when_column)) {
289
156
                const auto* column_nullable_ptr =
290
156
                        assert_cast<const ColumnNullable*, TypeCheckOnRelease::DISABLE>(
291
156
                                raw_when_column.get());
292
156
                const auto* __restrict cond_raw_data =
293
156
                        assert_cast<const ColumnUInt8*, TypeCheckOnRelease::DISABLE>(
294
156
                                column_nullable_ptr->get_nested_column_ptr().get())
295
156
                                ->get_data()
296
156
                                .data();
297
156
                if (!column_nullable_ptr->has_null()) {
298
392
                    for (int row_idx = 0; row_idx < rows_count; row_idx++) {
299
281
                        then_idx_ptr[row_idx] |=
300
281
                                (!then_idx_ptr[row_idx]) * cond_raw_data[row_idx] * column_idx;
301
281
                    }
302
111
                    continue;
303
111
                }
304
45
                const auto* __restrict cond_raw_nullmap =
305
45
                        column_nullable_ptr->get_null_map_column_ptr()->get_data().data();
306
220
                for (int row_idx = 0; row_idx < rows_count; row_idx++) {
307
175
                    then_idx_ptr[row_idx] |= (!then_idx_ptr[row_idx] * cond_raw_data[row_idx] *
308
175
                                              !cond_raw_nullmap[row_idx]) *
309
175
                                             column_idx;
310
175
                }
311
86
            } else {
312
86
                const auto* __restrict cond_raw_data =
313
86
                        assert_cast<const ColumnUInt8*, TypeCheckOnRelease::DISABLE>(
314
86
                                raw_when_column.get())
315
86
                                ->get_data()
316
86
                                .data();
317
288
                for (int row_idx = 0; row_idx < rows_count; row_idx++) {
318
202
                    then_idx_ptr[row_idx] |=
319
202
                            (!then_idx_ptr[row_idx]) * cond_raw_data[row_idx] * column_idx;
320
202
                }
321
86
            }
322
242
        }
323
324
292
        return _execute_update_result<IndexType>(then_idx_ptr, then_columns, rows_count);
325
292
    }
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
271
292
                            std::vector<ColumnPtr>& then_columns, size_t rows_count) const {
272
292
        std::vector<IndexType> then_idx(rows_count, 0);
273
292
        IndexType* __restrict then_idx_ptr = then_idx.data();
274
534
        for (IndexType i = 0; i < when_columns.size(); i++) {
275
242
            IndexType column_idx = i + 1;
276
242
            auto [raw_when_column, is_consts] = unpack_if_const(when_columns[i]);
277
278
242
            if (is_consts) {
279
0
                if (raw_when_column->get_bool(0)) {
280
0
                    for (int row_idx = 0; row_idx < rows_count; row_idx++) {
281
0
                        then_idx_ptr[row_idx] |= (!then_idx_ptr[row_idx]) * column_idx;
282
0
                    }
283
0
                    break;
284
0
                }
285
0
                continue;
286
0
            }
287
288
242
            if (is_column_nullable(*raw_when_column)) {
289
156
                const auto* column_nullable_ptr =
290
156
                        assert_cast<const ColumnNullable*, TypeCheckOnRelease::DISABLE>(
291
156
                                raw_when_column.get());
292
156
                const auto* __restrict cond_raw_data =
293
156
                        assert_cast<const ColumnUInt8*, TypeCheckOnRelease::DISABLE>(
294
156
                                column_nullable_ptr->get_nested_column_ptr().get())
295
156
                                ->get_data()
296
156
                                .data();
297
156
                if (!column_nullable_ptr->has_null()) {
298
392
                    for (int row_idx = 0; row_idx < rows_count; row_idx++) {
299
281
                        then_idx_ptr[row_idx] |=
300
281
                                (!then_idx_ptr[row_idx]) * cond_raw_data[row_idx] * column_idx;
301
281
                    }
302
111
                    continue;
303
111
                }
304
45
                const auto* __restrict cond_raw_nullmap =
305
45
                        column_nullable_ptr->get_null_map_column_ptr()->get_data().data();
306
220
                for (int row_idx = 0; row_idx < rows_count; row_idx++) {
307
175
                    then_idx_ptr[row_idx] |= (!then_idx_ptr[row_idx] * cond_raw_data[row_idx] *
308
175
                                              !cond_raw_nullmap[row_idx]) *
309
175
                                             column_idx;
310
175
                }
311
86
            } else {
312
86
                const auto* __restrict cond_raw_data =
313
86
                        assert_cast<const ColumnUInt8*, TypeCheckOnRelease::DISABLE>(
314
86
                                raw_when_column.get())
315
86
                                ->get_data()
316
86
                                .data();
317
288
                for (int row_idx = 0; row_idx < rows_count; row_idx++) {
318
202
                    then_idx_ptr[row_idx] |=
319
202
                            (!then_idx_ptr[row_idx]) * cond_raw_data[row_idx] * column_idx;
320
202
                }
321
86
            }
322
242
        }
323
324
292
        return _execute_update_result<IndexType>(then_idx_ptr, then_columns, rows_count);
325
292
    }
326
327
    bool _has_else_expr;
328
329
    inline static const std::string FUNCTION_NAME = "case";
330
    inline static const std::string EXPR_NAME = "vcase expr";
331
};
332
} // namespace doris