Coverage Report

Created: 2026-07-24 05:11

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/data_type/define_primitive_type.h"
33
#include "core/data_type/primitive_type.h"
34
#include "exprs/function/function.h"
35
#include "exprs/function_context.h"
36
#include "exprs/vexpr.h"
37
38
namespace doris {
39
class RowDescriptor;
40
class RuntimeState;
41
class TExprNode;
42
43
class Block;
44
} // namespace doris
45
46
namespace doris {
47
48
class VCaseExpr final : public VExpr {
49
    ENABLE_FACTORY_CREATOR(VCaseExpr);
50
51
public:
52
    VCaseExpr(const TExprNode& node);
53
    ~VCaseExpr() override = default;
54
    Status execute_column_impl(VExprContext* context, const Block* block, const Selector* selector,
55
                               size_t count, ColumnPtr& result_column) const override;
56
    Status prepare(RuntimeState* state, const RowDescriptor& desc, VExprContext* context) override;
57
    Status open(RuntimeState* state, VExprContext* context,
58
                FunctionContext::FunctionStateScope scope) override;
59
    void close(VExprContext* context, FunctionContext::FunctionStateScope scope) override;
60
    const std::string& expr_name() const override;
61
    std::string debug_string() const override;
62
0
    bool has_else_expr() const { return _has_else_expr; }
63
1
    Status clone_node(VExprSPtr* cloned_expr) const override {
64
1
        DORIS_CHECK(cloned_expr != nullptr);
65
1
        auto node = clone_texpr_node();
66
1
        TCaseExpr case_node;
67
1
        case_node.__set_has_case_expr(false);
68
1
        case_node.__set_has_else_expr(_has_else_expr);
69
1
        node.__set_case_expr(case_node);
70
1
        *cloned_expr = VCaseExpr::create_shared(node);
71
1
        return Status::OK();
72
1
    }
73
74
private:
75
    template <typename IndexType, typename ColumnType>
76
    ColumnPtr _execute_update_result_impl(const IndexType* then_idx,
77
                                          std::vector<ColumnPtr>& then_columns,
78
451
                                          size_t rows_count) const {
79
451
        auto result_column_ptr = data_type()->create_column();
80
451
        result_column_ptr->reserve(rows_count);
81
        if constexpr (std::is_same_v<ColumnType, ColumnString> ||
82
                      std::is_same_v<ColumnType, ColumnBitmap> ||
83
                      std::is_same_v<ColumnType, ColumnArray> ||
84
                      std::is_same_v<ColumnType, ColumnMap> ||
85
                      std::is_same_v<ColumnType, ColumnStruct> ||
86
                      std::is_same_v<ColumnType, ColumnVariant> ||
87
                      std::is_same_v<ColumnType, ColumnHLL> ||
88
                      std::is_same_v<ColumnType, ColumnQuantileState> ||
89
                      std::is_same_v<ColumnType, ColumnIPv4> ||
90
202
                      std::is_same_v<ColumnType, ColumnIPv6>) {
91
            // result_column and all then_column is not nullable.
92
            // can't simd when type is string.
93
202
            if (data_type()->is_nullable()) {
94
121
                update_result_normal<IndexType, ColumnType, true>(result_column_ptr, then_idx,
95
121
                                                                  then_columns, rows_count);
96
121
            } else {
97
81
                update_result_normal<IndexType, ColumnType, false>(result_column_ptr, then_idx,
98
81
                                                                   then_columns, rows_count);
99
81
            }
100
249
        } else if (data_type()->is_nullable()) {
101
            // result_column and all then_column is nullable.
102
17
            update_result_normal<IndexType, ColumnType, true>(result_column_ptr, then_idx,
103
17
                                                              then_columns, rows_count);
104
232
        } else {
105
232
            update_result_auto_simd<IndexType, ColumnType>(result_column_ptr, then_idx,
106
232
                                                           then_columns, rows_count);
107
232
        }
108
451
        return result_column_ptr;
109
451
    }
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_13ColumnVariantEEENS_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_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
78
17
                                          size_t rows_count) const {
79
17
        auto result_column_ptr = data_type()->create_column();
80
17
        result_column_ptr->reserve(rows_count);
81
        if constexpr (std::is_same_v<ColumnType, ColumnString> ||
82
                      std::is_same_v<ColumnType, ColumnBitmap> ||
83
                      std::is_same_v<ColumnType, ColumnArray> ||
84
                      std::is_same_v<ColumnType, ColumnMap> ||
85
                      std::is_same_v<ColumnType, ColumnStruct> ||
86
                      std::is_same_v<ColumnType, ColumnVariant> ||
87
                      std::is_same_v<ColumnType, ColumnHLL> ||
88
                      std::is_same_v<ColumnType, ColumnQuantileState> ||
89
                      std::is_same_v<ColumnType, ColumnIPv4> ||
90
                      std::is_same_v<ColumnType, ColumnIPv6>) {
91
            // result_column and all then_column is not nullable.
92
            // can't simd when type is string.
93
            if (data_type()->is_nullable()) {
94
                update_result_normal<IndexType, ColumnType, true>(result_column_ptr, then_idx,
95
                                                                  then_columns, rows_count);
96
            } else {
97
                update_result_normal<IndexType, ColumnType, false>(result_column_ptr, then_idx,
98
                                                                   then_columns, rows_count);
99
            }
100
17
        } else if (data_type()->is_nullable()) {
101
            // result_column and all then_column is nullable.
102
2
            update_result_normal<IndexType, ColumnType, true>(result_column_ptr, then_idx,
103
2
                                                              then_columns, rows_count);
104
15
        } else {
105
15
            update_result_auto_simd<IndexType, ColumnType>(result_column_ptr, then_idx,
106
15
                                                           then_columns, rows_count);
107
15
        }
108
17
        return result_column_ptr;
109
17
    }
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
78
10
                                          size_t rows_count) const {
79
10
        auto result_column_ptr = data_type()->create_column();
80
10
        result_column_ptr->reserve(rows_count);
81
        if constexpr (std::is_same_v<ColumnType, ColumnString> ||
82
                      std::is_same_v<ColumnType, ColumnBitmap> ||
83
                      std::is_same_v<ColumnType, ColumnArray> ||
84
                      std::is_same_v<ColumnType, ColumnMap> ||
85
                      std::is_same_v<ColumnType, ColumnStruct> ||
86
                      std::is_same_v<ColumnType, ColumnVariant> ||
87
                      std::is_same_v<ColumnType, ColumnHLL> ||
88
                      std::is_same_v<ColumnType, ColumnQuantileState> ||
89
                      std::is_same_v<ColumnType, ColumnIPv4> ||
90
                      std::is_same_v<ColumnType, ColumnIPv6>) {
91
            // result_column and all then_column is not nullable.
92
            // can't simd when type is string.
93
            if (data_type()->is_nullable()) {
94
                update_result_normal<IndexType, ColumnType, true>(result_column_ptr, then_idx,
95
                                                                  then_columns, rows_count);
96
            } else {
97
                update_result_normal<IndexType, ColumnType, false>(result_column_ptr, then_idx,
98
                                                                   then_columns, rows_count);
99
            }
100
10
        } else if (data_type()->is_nullable()) {
101
            // result_column and all then_column is nullable.
102
10
            update_result_normal<IndexType, ColumnType, true>(result_column_ptr, then_idx,
103
10
                                                              then_columns, rows_count);
104
10
        } else {
105
0
            update_result_auto_simd<IndexType, ColumnType>(result_column_ptr, then_idx,
106
0
                                                           then_columns, rows_count);
107
0
        }
108
10
        return result_column_ptr;
109
10
    }
_ZNK5doris9VCaseExpr27_execute_update_result_implIhNS_12ColumnVectorILNS_13PrimitiveTypeE6EEEEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EEPKT_RSt6vectorIS9_SaIS9_EEm
Line
Count
Source
78
147
                                          size_t rows_count) const {
79
147
        auto result_column_ptr = data_type()->create_column();
80
147
        result_column_ptr->reserve(rows_count);
81
        if constexpr (std::is_same_v<ColumnType, ColumnString> ||
82
                      std::is_same_v<ColumnType, ColumnBitmap> ||
83
                      std::is_same_v<ColumnType, ColumnArray> ||
84
                      std::is_same_v<ColumnType, ColumnMap> ||
85
                      std::is_same_v<ColumnType, ColumnStruct> ||
86
                      std::is_same_v<ColumnType, ColumnVariant> ||
87
                      std::is_same_v<ColumnType, ColumnHLL> ||
88
                      std::is_same_v<ColumnType, ColumnQuantileState> ||
89
                      std::is_same_v<ColumnType, ColumnIPv4> ||
90
                      std::is_same_v<ColumnType, ColumnIPv6>) {
91
            // result_column and all then_column is not nullable.
92
            // can't simd when type is string.
93
            if (data_type()->is_nullable()) {
94
                update_result_normal<IndexType, ColumnType, true>(result_column_ptr, then_idx,
95
                                                                  then_columns, rows_count);
96
            } else {
97
                update_result_normal<IndexType, ColumnType, false>(result_column_ptr, then_idx,
98
                                                                   then_columns, rows_count);
99
            }
100
147
        } else if (data_type()->is_nullable()) {
101
            // result_column and all then_column is nullable.
102
0
            update_result_normal<IndexType, ColumnType, true>(result_column_ptr, then_idx,
103
0
                                                              then_columns, rows_count);
104
147
        } else {
105
147
            update_result_auto_simd<IndexType, ColumnType>(result_column_ptr, then_idx,
106
147
                                                           then_columns, rows_count);
107
147
        }
108
147
        return result_column_ptr;
109
147
    }
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
78
3
                                          size_t rows_count) const {
79
3
        auto result_column_ptr = data_type()->create_column();
80
3
        result_column_ptr->reserve(rows_count);
81
        if constexpr (std::is_same_v<ColumnType, ColumnString> ||
82
                      std::is_same_v<ColumnType, ColumnBitmap> ||
83
                      std::is_same_v<ColumnType, ColumnArray> ||
84
                      std::is_same_v<ColumnType, ColumnMap> ||
85
                      std::is_same_v<ColumnType, ColumnStruct> ||
86
                      std::is_same_v<ColumnType, ColumnVariant> ||
87
                      std::is_same_v<ColumnType, ColumnHLL> ||
88
                      std::is_same_v<ColumnType, ColumnQuantileState> ||
89
                      std::is_same_v<ColumnType, ColumnIPv4> ||
90
                      std::is_same_v<ColumnType, ColumnIPv6>) {
91
            // result_column and all then_column is not nullable.
92
            // can't simd when type is string.
93
            if (data_type()->is_nullable()) {
94
                update_result_normal<IndexType, ColumnType, true>(result_column_ptr, then_idx,
95
                                                                  then_columns, rows_count);
96
            } else {
97
                update_result_normal<IndexType, ColumnType, false>(result_column_ptr, then_idx,
98
                                                                   then_columns, rows_count);
99
            }
100
3
        } else if (data_type()->is_nullable()) {
101
            // result_column and all then_column is nullable.
102
3
            update_result_normal<IndexType, ColumnType, true>(result_column_ptr, then_idx,
103
3
                                                              then_columns, rows_count);
104
3
        } else {
105
0
            update_result_auto_simd<IndexType, ColumnType>(result_column_ptr, then_idx,
106
0
                                                           then_columns, rows_count);
107
0
        }
108
3
        return result_column_ptr;
109
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
78
68
                                          size_t rows_count) const {
79
68
        auto result_column_ptr = data_type()->create_column();
80
68
        result_column_ptr->reserve(rows_count);
81
        if constexpr (std::is_same_v<ColumnType, ColumnString> ||
82
                      std::is_same_v<ColumnType, ColumnBitmap> ||
83
                      std::is_same_v<ColumnType, ColumnArray> ||
84
                      std::is_same_v<ColumnType, ColumnMap> ||
85
                      std::is_same_v<ColumnType, ColumnStruct> ||
86
                      std::is_same_v<ColumnType, ColumnVariant> ||
87
                      std::is_same_v<ColumnType, ColumnHLL> ||
88
                      std::is_same_v<ColumnType, ColumnQuantileState> ||
89
                      std::is_same_v<ColumnType, ColumnIPv4> ||
90
                      std::is_same_v<ColumnType, ColumnIPv6>) {
91
            // result_column and all then_column is not nullable.
92
            // can't simd when type is string.
93
            if (data_type()->is_nullable()) {
94
                update_result_normal<IndexType, ColumnType, true>(result_column_ptr, then_idx,
95
                                                                  then_columns, rows_count);
96
            } else {
97
                update_result_normal<IndexType, ColumnType, false>(result_column_ptr, then_idx,
98
                                                                   then_columns, rows_count);
99
            }
100
68
        } else if (data_type()->is_nullable()) {
101
            // result_column and all then_column is nullable.
102
0
            update_result_normal<IndexType, ColumnType, true>(result_column_ptr, then_idx,
103
0
                                                              then_columns, rows_count);
104
68
        } else {
105
68
            update_result_auto_simd<IndexType, ColumnType>(result_column_ptr, then_idx,
106
68
                                                           then_columns, rows_count);
107
68
        }
108
68
        return result_column_ptr;
109
68
    }
_ZNK5doris9VCaseExpr27_execute_update_result_implIhNS_13ColumnDecimalILNS_13PrimitiveTypeE35EEEEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EEPKT_RSt6vectorIS9_SaIS9_EEm
Line
Count
Source
78
1
                                          size_t rows_count) const {
79
1
        auto result_column_ptr = data_type()->create_column();
80
1
        result_column_ptr->reserve(rows_count);
81
        if constexpr (std::is_same_v<ColumnType, ColumnString> ||
82
                      std::is_same_v<ColumnType, ColumnBitmap> ||
83
                      std::is_same_v<ColumnType, ColumnArray> ||
84
                      std::is_same_v<ColumnType, ColumnMap> ||
85
                      std::is_same_v<ColumnType, ColumnStruct> ||
86
                      std::is_same_v<ColumnType, ColumnVariant> ||
87
                      std::is_same_v<ColumnType, ColumnHLL> ||
88
                      std::is_same_v<ColumnType, ColumnQuantileState> ||
89
                      std::is_same_v<ColumnType, ColumnIPv4> ||
90
                      std::is_same_v<ColumnType, ColumnIPv6>) {
91
            // result_column and all then_column is not nullable.
92
            // can't simd when type is string.
93
            if (data_type()->is_nullable()) {
94
                update_result_normal<IndexType, ColumnType, true>(result_column_ptr, then_idx,
95
                                                                  then_columns, rows_count);
96
            } else {
97
                update_result_normal<IndexType, ColumnType, false>(result_column_ptr, then_idx,
98
                                                                   then_columns, rows_count);
99
            }
100
1
        } else if (data_type()->is_nullable()) {
101
            // result_column and all then_column is nullable.
102
1
            update_result_normal<IndexType, ColumnType, true>(result_column_ptr, then_idx,
103
1
                                                              then_columns, rows_count);
104
1
        } else {
105
0
            update_result_auto_simd<IndexType, ColumnType>(result_column_ptr, then_idx,
106
0
                                                           then_columns, rows_count);
107
0
        }
108
1
        return result_column_ptr;
109
1
    }
_ZNK5doris9VCaseExpr27_execute_update_result_implIhNS_13ColumnDecimalILNS_13PrimitiveTypeE30EEEEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EEPKT_RSt6vectorIS9_SaIS9_EEm
Line
Count
Source
78
1
                                          size_t rows_count) const {
79
1
        auto result_column_ptr = data_type()->create_column();
80
1
        result_column_ptr->reserve(rows_count);
81
        if constexpr (std::is_same_v<ColumnType, ColumnString> ||
82
                      std::is_same_v<ColumnType, ColumnBitmap> ||
83
                      std::is_same_v<ColumnType, ColumnArray> ||
84
                      std::is_same_v<ColumnType, ColumnMap> ||
85
                      std::is_same_v<ColumnType, ColumnStruct> ||
86
                      std::is_same_v<ColumnType, ColumnVariant> ||
87
                      std::is_same_v<ColumnType, ColumnHLL> ||
88
                      std::is_same_v<ColumnType, ColumnQuantileState> ||
89
                      std::is_same_v<ColumnType, ColumnIPv4> ||
90
                      std::is_same_v<ColumnType, ColumnIPv6>) {
91
            // result_column and all then_column is not nullable.
92
            // can't simd when type is string.
93
            if (data_type()->is_nullable()) {
94
                update_result_normal<IndexType, ColumnType, true>(result_column_ptr, then_idx,
95
                                                                  then_columns, rows_count);
96
            } else {
97
                update_result_normal<IndexType, ColumnType, false>(result_column_ptr, then_idx,
98
                                                                   then_columns, rows_count);
99
            }
100
1
        } else if (data_type()->is_nullable()) {
101
            // result_column and all then_column is nullable.
102
1
            update_result_normal<IndexType, ColumnType, true>(result_column_ptr, then_idx,
103
1
                                                              then_columns, rows_count);
104
1
        } else {
105
0
            update_result_auto_simd<IndexType, ColumnType>(result_column_ptr, then_idx,
106
0
                                                           then_columns, rows_count);
107
0
        }
108
1
        return result_column_ptr;
109
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
78
202
                                          size_t rows_count) const {
79
202
        auto result_column_ptr = data_type()->create_column();
80
202
        result_column_ptr->reserve(rows_count);
81
        if constexpr (std::is_same_v<ColumnType, ColumnString> ||
82
                      std::is_same_v<ColumnType, ColumnBitmap> ||
83
                      std::is_same_v<ColumnType, ColumnArray> ||
84
                      std::is_same_v<ColumnType, ColumnMap> ||
85
                      std::is_same_v<ColumnType, ColumnStruct> ||
86
                      std::is_same_v<ColumnType, ColumnVariant> ||
87
                      std::is_same_v<ColumnType, ColumnHLL> ||
88
                      std::is_same_v<ColumnType, ColumnQuantileState> ||
89
                      std::is_same_v<ColumnType, ColumnIPv4> ||
90
202
                      std::is_same_v<ColumnType, ColumnIPv6>) {
91
            // result_column and all then_column is not nullable.
92
            // can't simd when type is string.
93
202
            if (data_type()->is_nullable()) {
94
121
                update_result_normal<IndexType, ColumnType, true>(result_column_ptr, then_idx,
95
121
                                                                  then_columns, rows_count);
96
121
            } else {
97
81
                update_result_normal<IndexType, ColumnType, false>(result_column_ptr, then_idx,
98
81
                                                                   then_columns, rows_count);
99
81
            }
100
        } else if (data_type()->is_nullable()) {
101
            // result_column and all then_column is nullable.
102
            update_result_normal<IndexType, ColumnType, true>(result_column_ptr, then_idx,
103
                                                              then_columns, rows_count);
104
        } else {
105
            update_result_auto_simd<IndexType, ColumnType>(result_column_ptr, then_idx,
106
                                                           then_columns, rows_count);
107
        }
108
202
        return result_column_ptr;
109
202
    }
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
78
2
                                          size_t rows_count) const {
79
2
        auto result_column_ptr = data_type()->create_column();
80
2
        result_column_ptr->reserve(rows_count);
81
        if constexpr (std::is_same_v<ColumnType, ColumnString> ||
82
                      std::is_same_v<ColumnType, ColumnBitmap> ||
83
                      std::is_same_v<ColumnType, ColumnArray> ||
84
                      std::is_same_v<ColumnType, ColumnMap> ||
85
                      std::is_same_v<ColumnType, ColumnStruct> ||
86
                      std::is_same_v<ColumnType, ColumnVariant> ||
87
                      std::is_same_v<ColumnType, ColumnHLL> ||
88
                      std::is_same_v<ColumnType, ColumnQuantileState> ||
89
                      std::is_same_v<ColumnType, ColumnIPv4> ||
90
                      std::is_same_v<ColumnType, ColumnIPv6>) {
91
            // result_column and all then_column is not nullable.
92
            // can't simd when type is string.
93
            if (data_type()->is_nullable()) {
94
                update_result_normal<IndexType, ColumnType, true>(result_column_ptr, then_idx,
95
                                                                  then_columns, rows_count);
96
            } else {
97
                update_result_normal<IndexType, ColumnType, false>(result_column_ptr, then_idx,
98
                                                                   then_columns, rows_count);
99
            }
100
2
        } else if (data_type()->is_nullable()) {
101
            // result_column and all then_column is nullable.
102
0
            update_result_normal<IndexType, ColumnType, true>(result_column_ptr, then_idx,
103
0
                                                              then_columns, rows_count);
104
2
        } else {
105
2
            update_result_auto_simd<IndexType, ColumnType>(result_column_ptr, then_idx,
106
2
                                                           then_columns, rows_count);
107
2
        }
108
2
        return result_column_ptr;
109
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
Unexecuted instantiation: _ZNK5doris9VCaseExpr27_execute_update_result_implIhNS_11ColumnArrayEEENS_3COWINS_7IColumnEE13immutable_ptrIS4_EEPKT_RSt6vectorIS7_SaIS7_EEm
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
Unexecuted instantiation: _ZNK5doris9VCaseExpr27_execute_update_result_implIhNS_13ColumnVariantEEENS_3COWINS_7IColumnEE13immutable_ptrIS4_EEPKT_RSt6vectorIS7_SaIS7_EEm
Unexecuted instantiation: _ZNK5doris9VCaseExpr27_execute_update_result_implIhNS_17ColumnComplexTypeILNS_13PrimitiveTypeE22EEEEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EEPKT_RSt6vectorIS9_SaIS9_EEm
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
110
111
    template <typename IndexType>
112
    ColumnPtr _execute_update_result(const IndexType* then_idx,
113
                                     std::vector<ColumnPtr>& then_columns,
114
451
                                     size_t rows_count) const {
115
451
#define CASE_TYPE(ptype, coltype) \
116
451
    case PrimitiveType::ptype:    \
117
451
        return _execute_update_result_impl<IndexType, coltype>(then_idx, then_columns, rows_count);
118
119
451
        switch (data_type()->get_primitive_type()) {
120
0
            CASE_TYPE(TYPE_BOOLEAN, ColumnUInt8)
121
17
            CASE_TYPE(TYPE_TINYINT, ColumnInt8)
122
0
            CASE_TYPE(TYPE_SMALLINT, ColumnInt16)
123
10
            CASE_TYPE(TYPE_INT, ColumnInt32)
124
147
            CASE_TYPE(TYPE_BIGINT, ColumnInt64)
125
0
            CASE_TYPE(TYPE_LARGEINT, ColumnInt128)
126
0
            CASE_TYPE(TYPE_FLOAT, ColumnFloat32)
127
3
            CASE_TYPE(TYPE_DOUBLE, ColumnFloat64)
128
0
            CASE_TYPE(TYPE_DECIMAL32, ColumnDecimal32)
129
68
            CASE_TYPE(TYPE_DECIMAL64, ColumnDecimal64)
130
1
            CASE_TYPE(TYPE_DECIMAL256, ColumnDecimal256)
131
1
            CASE_TYPE(TYPE_DECIMAL128I, ColumnDecimal128V3)
132
0
            CASE_TYPE(TYPE_DECIMALV2, ColumnDecimal128V2)
133
2
            CASE_TYPE(TYPE_STRING, ColumnString)
134
0
            CASE_TYPE(TYPE_CHAR, ColumnString)
135
200
            CASE_TYPE(TYPE_VARCHAR, ColumnString)
136
0
            CASE_TYPE(TYPE_JSONB, ColumnString)
137
0
            CASE_TYPE(TYPE_DATE, ColumnDate)
138
0
            CASE_TYPE(TYPE_DATETIME, ColumnDateTime)
139
2
            CASE_TYPE(TYPE_DATEV2, ColumnDateV2)
140
0
            CASE_TYPE(TYPE_DATETIMEV2, ColumnDateTimeV2)
141
0
            CASE_TYPE(TYPE_TIMESTAMPTZ, ColumnTimeStampTz)
142
0
            CASE_TYPE(TYPE_IPV6, ColumnIPv6)
143
0
            CASE_TYPE(TYPE_IPV4, ColumnIPv4)
144
0
            CASE_TYPE(TYPE_ARRAY, ColumnArray)
145
0
            CASE_TYPE(TYPE_MAP, ColumnMap)
146
0
            CASE_TYPE(TYPE_STRUCT, ColumnStruct)
147
0
            CASE_TYPE(TYPE_VARIANT, ColumnVariant)
148
0
            CASE_TYPE(TYPE_BITMAP, ColumnBitmap)
149
0
            CASE_TYPE(TYPE_HLL, ColumnHLL)
150
0
            CASE_TYPE(TYPE_QUANTILE_STATE, ColumnQuantileState)
151
0
        default:
152
0
            throw Exception(ErrorCode::NOT_IMPLEMENTED_ERROR, "argument_type {} not supported",
153
0
                            data_type()->get_name());
154
451
        }
155
451
#undef CASE_TYPE
156
451
    }
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
114
451
                                     size_t rows_count) const {
115
451
#define CASE_TYPE(ptype, coltype) \
116
451
    case PrimitiveType::ptype:    \
117
451
        return _execute_update_result_impl<IndexType, coltype>(then_idx, then_columns, rows_count);
118
119
451
        switch (data_type()->get_primitive_type()) {
120
0
            CASE_TYPE(TYPE_BOOLEAN, ColumnUInt8)
121
17
            CASE_TYPE(TYPE_TINYINT, ColumnInt8)
122
0
            CASE_TYPE(TYPE_SMALLINT, ColumnInt16)
123
10
            CASE_TYPE(TYPE_INT, ColumnInt32)
124
147
            CASE_TYPE(TYPE_BIGINT, ColumnInt64)
125
0
            CASE_TYPE(TYPE_LARGEINT, ColumnInt128)
126
0
            CASE_TYPE(TYPE_FLOAT, ColumnFloat32)
127
3
            CASE_TYPE(TYPE_DOUBLE, ColumnFloat64)
128
0
            CASE_TYPE(TYPE_DECIMAL32, ColumnDecimal32)
129
68
            CASE_TYPE(TYPE_DECIMAL64, ColumnDecimal64)
130
1
            CASE_TYPE(TYPE_DECIMAL256, ColumnDecimal256)
131
1
            CASE_TYPE(TYPE_DECIMAL128I, ColumnDecimal128V3)
132
0
            CASE_TYPE(TYPE_DECIMALV2, ColumnDecimal128V2)
133
2
            CASE_TYPE(TYPE_STRING, ColumnString)
134
0
            CASE_TYPE(TYPE_CHAR, ColumnString)
135
200
            CASE_TYPE(TYPE_VARCHAR, ColumnString)
136
0
            CASE_TYPE(TYPE_JSONB, ColumnString)
137
0
            CASE_TYPE(TYPE_DATE, ColumnDate)
138
0
            CASE_TYPE(TYPE_DATETIME, ColumnDateTime)
139
2
            CASE_TYPE(TYPE_DATEV2, ColumnDateV2)
140
0
            CASE_TYPE(TYPE_DATETIMEV2, ColumnDateTimeV2)
141
0
            CASE_TYPE(TYPE_TIMESTAMPTZ, ColumnTimeStampTz)
142
0
            CASE_TYPE(TYPE_IPV6, ColumnIPv6)
143
0
            CASE_TYPE(TYPE_IPV4, ColumnIPv4)
144
0
            CASE_TYPE(TYPE_ARRAY, ColumnArray)
145
0
            CASE_TYPE(TYPE_MAP, ColumnMap)
146
0
            CASE_TYPE(TYPE_STRUCT, ColumnStruct)
147
0
            CASE_TYPE(TYPE_VARIANT, ColumnVariant)
148
0
            CASE_TYPE(TYPE_BITMAP, ColumnBitmap)
149
0
            CASE_TYPE(TYPE_HLL, ColumnHLL)
150
0
            CASE_TYPE(TYPE_QUANTILE_STATE, ColumnQuantileState)
151
0
        default:
152
0
            throw Exception(ErrorCode::NOT_IMPLEMENTED_ERROR, "argument_type {} not supported",
153
0
                            data_type()->get_name());
154
451
        }
155
451
#undef CASE_TYPE
156
451
    }
157
158
    template <typename IndexType, typename ColumnType, bool then_null>
159
    void update_result_normal(MutableColumnPtr& result_column_ptr,
160
                              const IndexType* __restrict then_idx,
161
219
                              std::vector<ColumnPtr>& then_columns, size_t rows_count) const {
162
219
        std::vector<ColumnPtr> raw_then_columns(then_columns.size());
163
219
        std::vector<uint8_t> is_consts(then_columns.size());
164
219
        std::vector<uint8_t> is_nullable(then_columns.size());
165
1.43k
        for (size_t i = 0; i < then_columns.size(); i++) {
166
1.21k
            if (!then_columns[i]) {
167
27
                continue;
168
27
            }
169
1.18k
            std::tie(raw_then_columns[i], is_consts[i]) = unpack_if_const(then_columns[i]);
170
1.18k
            is_nullable[i] = is_column_nullable(*raw_then_columns[i]);
171
1.18k
        }
172
173
219
        auto* raw_result_column = result_column_ptr.get();
174
3.60k
        for (int row_idx = 0; row_idx < rows_count; row_idx++) {
175
3.38k
            if (!_has_else_expr && !then_idx[row_idx]) {
176
11
                assert_cast<ColumnNullable*, TypeCheckOnRelease::DISABLE>(raw_result_column)
177
11
                        ->insert_default();
178
11
                continue;
179
11
            }
180
3.37k
            size_t target = is_consts[then_idx[row_idx]] ? 0 : row_idx;
181
3.37k
            if constexpr (then_null) {
182
3.11k
                auto* nullable = assert_cast<ColumnNullable*, TypeCheckOnRelease::DISABLE>(
183
3.11k
                        result_column_ptr.get());
184
3.11k
                if (is_nullable[then_idx[row_idx]]) {
185
337
                    nullable->insert_from_with_type<ColumnType>(
186
337
                            *raw_then_columns[then_idx[row_idx]], target);
187
2.77k
                } else {
188
2.77k
                    auto* nested = assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(
189
2.77k
                            nullable->get_nested_column_ptr().get());
190
2.77k
                    nested->insert_from(*raw_then_columns[then_idx[row_idx]], target);
191
2.77k
                    nullable->push_false_to_nullmap(1);
192
2.77k
                }
193
3.11k
            } else {
194
259
                assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(result_column_ptr.get())
195
259
                        ->insert_from(*raw_then_columns[then_idx[row_idx]], target);
196
259
            }
197
3.37k
        }
198
219
    }
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_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_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_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
161
2
                              std::vector<ColumnPtr>& then_columns, size_t rows_count) const {
162
2
        std::vector<ColumnPtr> raw_then_columns(then_columns.size());
163
2
        std::vector<uint8_t> is_consts(then_columns.size());
164
2
        std::vector<uint8_t> is_nullable(then_columns.size());
165
6
        for (size_t i = 0; i < then_columns.size(); i++) {
166
4
            if (!then_columns[i]) {
167
2
                continue;
168
2
            }
169
2
            std::tie(raw_then_columns[i], is_consts[i]) = unpack_if_const(then_columns[i]);
170
2
            is_nullable[i] = is_column_nullable(*raw_then_columns[i]);
171
2
        }
172
173
2
        auto* raw_result_column = result_column_ptr.get();
174
5
        for (int row_idx = 0; row_idx < rows_count; row_idx++) {
175
3
            if (!_has_else_expr && !then_idx[row_idx]) {
176
0
                assert_cast<ColumnNullable*, TypeCheckOnRelease::DISABLE>(raw_result_column)
177
0
                        ->insert_default();
178
0
                continue;
179
0
            }
180
3
            size_t target = is_consts[then_idx[row_idx]] ? 0 : row_idx;
181
3
            if constexpr (then_null) {
182
3
                auto* nullable = assert_cast<ColumnNullable*, TypeCheckOnRelease::DISABLE>(
183
3
                        result_column_ptr.get());
184
3
                if (is_nullable[then_idx[row_idx]]) {
185
0
                    nullable->insert_from_with_type<ColumnType>(
186
0
                            *raw_then_columns[then_idx[row_idx]], target);
187
3
                } else {
188
3
                    auto* nested = assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(
189
3
                            nullable->get_nested_column_ptr().get());
190
3
                    nested->insert_from(*raw_then_columns[then_idx[row_idx]], target);
191
3
                    nullable->push_false_to_nullmap(1);
192
3
                }
193
            } else {
194
                assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(result_column_ptr.get())
195
                        ->insert_from(*raw_then_columns[then_idx[row_idx]], target);
196
            }
197
3
        }
198
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
161
10
                              std::vector<ColumnPtr>& then_columns, size_t rows_count) const {
162
10
        std::vector<ColumnPtr> raw_then_columns(then_columns.size());
163
10
        std::vector<uint8_t> is_consts(then_columns.size());
164
10
        std::vector<uint8_t> is_nullable(then_columns.size());
165
21
        for (size_t i = 0; i < then_columns.size(); i++) {
166
11
            if (!then_columns[i]) {
167
0
                continue;
168
0
            }
169
11
            std::tie(raw_then_columns[i], is_consts[i]) = unpack_if_const(then_columns[i]);
170
11
            is_nullable[i] = is_column_nullable(*raw_then_columns[i]);
171
11
        }
172
173
10
        auto* raw_result_column = result_column_ptr.get();
174
30
        for (int row_idx = 0; row_idx < rows_count; row_idx++) {
175
20
            if (!_has_else_expr && !then_idx[row_idx]) {
176
0
                assert_cast<ColumnNullable*, TypeCheckOnRelease::DISABLE>(raw_result_column)
177
0
                        ->insert_default();
178
0
                continue;
179
0
            }
180
20
            size_t target = is_consts[then_idx[row_idx]] ? 0 : row_idx;
181
20
            if constexpr (then_null) {
182
20
                auto* nullable = assert_cast<ColumnNullable*, TypeCheckOnRelease::DISABLE>(
183
20
                        result_column_ptr.get());
184
20
                if (is_nullable[then_idx[row_idx]]) {
185
20
                    nullable->insert_from_with_type<ColumnType>(
186
20
                            *raw_then_columns[then_idx[row_idx]], target);
187
20
                } else {
188
0
                    auto* nested = assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(
189
0
                            nullable->get_nested_column_ptr().get());
190
0
                    nested->insert_from(*raw_then_columns[then_idx[row_idx]], target);
191
0
                    nullable->push_false_to_nullmap(1);
192
0
                }
193
            } else {
194
                assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(result_column_ptr.get())
195
                        ->insert_from(*raw_then_columns[then_idx[row_idx]], target);
196
            }
197
20
        }
198
10
    }
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
161
3
                              std::vector<ColumnPtr>& then_columns, size_t rows_count) const {
162
3
        std::vector<ColumnPtr> raw_then_columns(then_columns.size());
163
3
        std::vector<uint8_t> is_consts(then_columns.size());
164
3
        std::vector<uint8_t> is_nullable(then_columns.size());
165
11
        for (size_t i = 0; i < then_columns.size(); i++) {
166
8
            if (!then_columns[i]) {
167
0
                continue;
168
0
            }
169
8
            std::tie(raw_then_columns[i], is_consts[i]) = unpack_if_const(then_columns[i]);
170
8
            is_nullable[i] = is_column_nullable(*raw_then_columns[i]);
171
8
        }
172
173
3
        auto* raw_result_column = result_column_ptr.get();
174
13
        for (int row_idx = 0; row_idx < rows_count; row_idx++) {
175
10
            if (!_has_else_expr && !then_idx[row_idx]) {
176
0
                assert_cast<ColumnNullable*, TypeCheckOnRelease::DISABLE>(raw_result_column)
177
0
                        ->insert_default();
178
0
                continue;
179
0
            }
180
10
            size_t target = is_consts[then_idx[row_idx]] ? 0 : row_idx;
181
10
            if constexpr (then_null) {
182
10
                auto* nullable = assert_cast<ColumnNullable*, TypeCheckOnRelease::DISABLE>(
183
10
                        result_column_ptr.get());
184
10
                if (is_nullable[then_idx[row_idx]]) {
185
7
                    nullable->insert_from_with_type<ColumnType>(
186
7
                            *raw_then_columns[then_idx[row_idx]], target);
187
7
                } else {
188
3
                    auto* nested = assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(
189
3
                            nullable->get_nested_column_ptr().get());
190
3
                    nested->insert_from(*raw_then_columns[then_idx[row_idx]], target);
191
3
                    nullable->push_false_to_nullmap(1);
192
3
                }
193
            } else {
194
                assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(result_column_ptr.get())
195
                        ->insert_from(*raw_then_columns[then_idx[row_idx]], target);
196
            }
197
10
        }
198
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
161
1
                              std::vector<ColumnPtr>& then_columns, size_t rows_count) const {
162
1
        std::vector<ColumnPtr> raw_then_columns(then_columns.size());
163
1
        std::vector<uint8_t> is_consts(then_columns.size());
164
1
        std::vector<uint8_t> is_nullable(then_columns.size());
165
3
        for (size_t i = 0; i < then_columns.size(); i++) {
166
2
            if (!then_columns[i]) {
167
0
                continue;
168
0
            }
169
2
            std::tie(raw_then_columns[i], is_consts[i]) = unpack_if_const(then_columns[i]);
170
2
            is_nullable[i] = is_column_nullable(*raw_then_columns[i]);
171
2
        }
172
173
1
        auto* raw_result_column = result_column_ptr.get();
174
2
        for (int row_idx = 0; row_idx < rows_count; row_idx++) {
175
1
            if (!_has_else_expr && !then_idx[row_idx]) {
176
0
                assert_cast<ColumnNullable*, TypeCheckOnRelease::DISABLE>(raw_result_column)
177
0
                        ->insert_default();
178
0
                continue;
179
0
            }
180
1
            size_t target = is_consts[then_idx[row_idx]] ? 0 : row_idx;
181
1
            if constexpr (then_null) {
182
1
                auto* nullable = assert_cast<ColumnNullable*, TypeCheckOnRelease::DISABLE>(
183
1
                        result_column_ptr.get());
184
1
                if (is_nullable[then_idx[row_idx]]) {
185
1
                    nullable->insert_from_with_type<ColumnType>(
186
1
                            *raw_then_columns[then_idx[row_idx]], target);
187
1
                } else {
188
0
                    auto* nested = assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(
189
0
                            nullable->get_nested_column_ptr().get());
190
0
                    nested->insert_from(*raw_then_columns[then_idx[row_idx]], target);
191
0
                    nullable->push_false_to_nullmap(1);
192
0
                }
193
            } else {
194
                assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(result_column_ptr.get())
195
                        ->insert_from(*raw_then_columns[then_idx[row_idx]], target);
196
            }
197
1
        }
198
1
    }
_ZNK5doris9VCaseExpr20update_result_normalIhNS_13ColumnDecimalILNS_13PrimitiveTypeE30EEELb1EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Line
Count
Source
161
1
                              std::vector<ColumnPtr>& then_columns, size_t rows_count) const {
162
1
        std::vector<ColumnPtr> raw_then_columns(then_columns.size());
163
1
        std::vector<uint8_t> is_consts(then_columns.size());
164
1
        std::vector<uint8_t> is_nullable(then_columns.size());
165
3
        for (size_t i = 0; i < then_columns.size(); i++) {
166
2
            if (!then_columns[i]) {
167
0
                continue;
168
0
            }
169
2
            std::tie(raw_then_columns[i], is_consts[i]) = unpack_if_const(then_columns[i]);
170
2
            is_nullable[i] = is_column_nullable(*raw_then_columns[i]);
171
2
        }
172
173
1
        auto* raw_result_column = result_column_ptr.get();
174
2
        for (int row_idx = 0; row_idx < rows_count; row_idx++) {
175
1
            if (!_has_else_expr && !then_idx[row_idx]) {
176
0
                assert_cast<ColumnNullable*, TypeCheckOnRelease::DISABLE>(raw_result_column)
177
0
                        ->insert_default();
178
0
                continue;
179
0
            }
180
1
            size_t target = is_consts[then_idx[row_idx]] ? 0 : row_idx;
181
1
            if constexpr (then_null) {
182
1
                auto* nullable = assert_cast<ColumnNullable*, TypeCheckOnRelease::DISABLE>(
183
1
                        result_column_ptr.get());
184
1
                if (is_nullable[then_idx[row_idx]]) {
185
1
                    nullable->insert_from_with_type<ColumnType>(
186
1
                            *raw_then_columns[then_idx[row_idx]], target);
187
1
                } else {
188
0
                    auto* nested = assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(
189
0
                            nullable->get_nested_column_ptr().get());
190
0
                    nested->insert_from(*raw_then_columns[then_idx[row_idx]], target);
191
0
                    nullable->push_false_to_nullmap(1);
192
0
                }
193
            } else {
194
                assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(result_column_ptr.get())
195
                        ->insert_from(*raw_then_columns[then_idx[row_idx]], target);
196
            }
197
1
        }
198
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
161
121
                              std::vector<ColumnPtr>& then_columns, size_t rows_count) const {
162
121
        std::vector<ColumnPtr> raw_then_columns(then_columns.size());
163
121
        std::vector<uint8_t> is_consts(then_columns.size());
164
121
        std::vector<uint8_t> is_nullable(then_columns.size());
165
1.12k
        for (size_t i = 0; i < then_columns.size(); i++) {
166
1.00k
            if (!then_columns[i]) {
167
25
                continue;
168
25
            }
169
979
            std::tie(raw_then_columns[i], is_consts[i]) = unpack_if_const(then_columns[i]);
170
979
            is_nullable[i] = is_column_nullable(*raw_then_columns[i]);
171
979
        }
172
173
121
        auto* raw_result_column = result_column_ptr.get();
174
3.21k
        for (int row_idx = 0; row_idx < rows_count; row_idx++) {
175
3.09k
            if (!_has_else_expr && !then_idx[row_idx]) {
176
11
                assert_cast<ColumnNullable*, TypeCheckOnRelease::DISABLE>(raw_result_column)
177
11
                        ->insert_default();
178
11
                continue;
179
11
            }
180
3.07k
            size_t target = is_consts[then_idx[row_idx]] ? 0 : row_idx;
181
3.07k
            if constexpr (then_null) {
182
3.07k
                auto* nullable = assert_cast<ColumnNullable*, TypeCheckOnRelease::DISABLE>(
183
3.07k
                        result_column_ptr.get());
184
3.07k
                if (is_nullable[then_idx[row_idx]]) {
185
308
                    nullable->insert_from_with_type<ColumnType>(
186
308
                            *raw_then_columns[then_idx[row_idx]], target);
187
2.77k
                } else {
188
2.77k
                    auto* nested = assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(
189
2.77k
                            nullable->get_nested_column_ptr().get());
190
2.77k
                    nested->insert_from(*raw_then_columns[then_idx[row_idx]], target);
191
2.77k
                    nullable->push_false_to_nullmap(1);
192
2.77k
                }
193
            } else {
194
                assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(result_column_ptr.get())
195
                        ->insert_from(*raw_then_columns[then_idx[row_idx]], target);
196
            }
197
3.07k
        }
198
121
    }
_ZNK5doris9VCaseExpr20update_result_normalIhNS_9ColumnStrIjEELb0EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS5_EEPKT_RSt6vectorINS6_13immutable_ptrIS5_EESaISF_EEm
Line
Count
Source
161
81
                              std::vector<ColumnPtr>& then_columns, size_t rows_count) const {
162
81
        std::vector<ColumnPtr> raw_then_columns(then_columns.size());
163
81
        std::vector<uint8_t> is_consts(then_columns.size());
164
81
        std::vector<uint8_t> is_nullable(then_columns.size());
165
264
        for (size_t i = 0; i < then_columns.size(); i++) {
166
183
            if (!then_columns[i]) {
167
0
                continue;
168
0
            }
169
183
            std::tie(raw_then_columns[i], is_consts[i]) = unpack_if_const(then_columns[i]);
170
183
            is_nullable[i] = is_column_nullable(*raw_then_columns[i]);
171
183
        }
172
173
81
        auto* raw_result_column = result_column_ptr.get();
174
340
        for (int row_idx = 0; row_idx < rows_count; row_idx++) {
175
259
            if (!_has_else_expr && !then_idx[row_idx]) {
176
0
                assert_cast<ColumnNullable*, TypeCheckOnRelease::DISABLE>(raw_result_column)
177
0
                        ->insert_default();
178
0
                continue;
179
0
            }
180
259
            size_t target = is_consts[then_idx[row_idx]] ? 0 : row_idx;
181
            if constexpr (then_null) {
182
                auto* nullable = assert_cast<ColumnNullable*, TypeCheckOnRelease::DISABLE>(
183
                        result_column_ptr.get());
184
                if (is_nullable[then_idx[row_idx]]) {
185
                    nullable->insert_from_with_type<ColumnType>(
186
                            *raw_then_columns[then_idx[row_idx]], target);
187
                } else {
188
                    auto* nested = assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(
189
                            nullable->get_nested_column_ptr().get());
190
                    nested->insert_from(*raw_then_columns[then_idx[row_idx]], target);
191
                    nullable->push_false_to_nullmap(1);
192
                }
193
259
            } else {
194
259
                assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(result_column_ptr.get())
195
259
                        ->insert_from(*raw_then_columns[then_idx[row_idx]], target);
196
259
            }
197
259
        }
198
81
    }
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
Unexecuted instantiation: _ZNK5doris9VCaseExpr20update_result_normalIhNS_11ColumnArrayELb1EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS4_EEPKT_RSt6vectorINS5_13immutable_ptrIS4_EESaISE_EEm
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
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
Unexecuted instantiation: _ZNK5doris9VCaseExpr20update_result_normalIhNS_17ColumnComplexTypeILNS_13PrimitiveTypeE22EEELb1EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
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
199
200
    template <typename IndexType, typename ColumnType>
201
    void update_result_auto_simd(MutableColumnPtr& result_column_ptr,
202
                                 const IndexType* __restrict then_idx,
203
232
                                 std::vector<ColumnPtr>& then_columns, size_t rows_count) const {
204
433
        for (auto& then_ptr : then_columns) {
205
433
            then_ptr = then_ptr->convert_to_full_column_if_const();
206
433
        }
207
208
232
        result_column_ptr->resize(rows_count);
209
232
        auto* __restrict result_raw_data =
210
232
                assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(result_column_ptr.get())
211
232
                        ->get_data()
212
232
                        .data();
213
214
        // set default value
215
773
        for (int i = 0; i < rows_count; i++) {
216
            if constexpr (std::is_same_v<ColumnType, ColumnDate> ||
217
                          std::is_same_v<ColumnType, ColumnDateTime> ||
218
                          std::is_same_v<ColumnType, ColumnDateV2> ||
219
                          std::is_same_v<ColumnType, ColumnDateTimeV2> ||
220
10
                          std::is_same_v<ColumnType, ColumnTimeStampTz>) {
221
10
                result_raw_data[i] = ColumnType::default_value();
222
531
            } else {
223
531
                result_raw_data[i] = {};
224
531
            }
225
541
        }
226
227
665
        for (IndexType i = 0; i < then_columns.size(); i++) {
228
433
            if (!then_columns[i]) {
229
0
                continue;
230
0
            }
231
433
            const auto* __restrict column_raw_data =
232
433
                    assert_cast<const ColumnType*, TypeCheckOnRelease::DISABLE>(
233
433
                            then_columns[i].get())
234
433
                            ->get_data()
235
433
                            .data();
236
            if constexpr (std::is_same_v<ColumnType, ColumnDate> ||
237
                          std::is_same_v<ColumnType, ColumnDateTime> ||
238
                          std::is_same_v<ColumnType, ColumnDateV2> ||
239
                          std::is_same_v<ColumnType, ColumnDateTimeV2> ||
240
6
                          std::is_same_v<ColumnType, ColumnTimeStampTz>) {
241
36
                for (int row_idx = 0; row_idx < rows_count; row_idx++) {
242
30
                    result_raw_data[row_idx] = (then_idx[row_idx] == i) ? column_raw_data[row_idx]
243
30
                                                                        : result_raw_data[row_idx];
244
30
                }
245
427
            } else {
246
1.70k
                for (int row_idx = 0; row_idx < rows_count; row_idx++) {
247
1.27k
                    result_raw_data[row_idx] +=
248
1.27k
                            typename ColumnType::value_type(then_idx[row_idx] == i) *
249
1.27k
                            column_raw_data[row_idx];
250
1.27k
                }
251
427
            }
252
433
        }
253
232
    }
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
203
15
                                 std::vector<ColumnPtr>& then_columns, size_t rows_count) const {
204
49
        for (auto& then_ptr : then_columns) {
205
49
            then_ptr = then_ptr->convert_to_full_column_if_const();
206
49
        }
207
208
15
        result_column_ptr->resize(rows_count);
209
15
        auto* __restrict result_raw_data =
210
15
                assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(result_column_ptr.get())
211
15
                        ->get_data()
212
15
                        .data();
213
214
        // set default value
215
123
        for (int i = 0; i < rows_count; i++) {
216
            if constexpr (std::is_same_v<ColumnType, ColumnDate> ||
217
                          std::is_same_v<ColumnType, ColumnDateTime> ||
218
                          std::is_same_v<ColumnType, ColumnDateV2> ||
219
                          std::is_same_v<ColumnType, ColumnDateTimeV2> ||
220
                          std::is_same_v<ColumnType, ColumnTimeStampTz>) {
221
                result_raw_data[i] = ColumnType::default_value();
222
108
            } else {
223
108
                result_raw_data[i] = {};
224
108
            }
225
108
        }
226
227
64
        for (IndexType i = 0; i < then_columns.size(); i++) {
228
49
            if (!then_columns[i]) {
229
0
                continue;
230
0
            }
231
49
            const auto* __restrict column_raw_data =
232
49
                    assert_cast<const ColumnType*, TypeCheckOnRelease::DISABLE>(
233
49
                            then_columns[i].get())
234
49
                            ->get_data()
235
49
                            .data();
236
            if constexpr (std::is_same_v<ColumnType, ColumnDate> ||
237
                          std::is_same_v<ColumnType, ColumnDateTime> ||
238
                          std::is_same_v<ColumnType, ColumnDateV2> ||
239
                          std::is_same_v<ColumnType, ColumnDateTimeV2> ||
240
                          std::is_same_v<ColumnType, ColumnTimeStampTz>) {
241
                for (int row_idx = 0; row_idx < rows_count; row_idx++) {
242
                    result_raw_data[row_idx] = (then_idx[row_idx] == i) ? column_raw_data[row_idx]
243
                                                                        : result_raw_data[row_idx];
244
                }
245
49
            } else {
246
464
                for (int row_idx = 0; row_idx < rows_count; row_idx++) {
247
415
                    result_raw_data[row_idx] +=
248
415
                            typename ColumnType::value_type(then_idx[row_idx] == i) *
249
415
                            column_raw_data[row_idx];
250
415
                }
251
49
            }
252
49
        }
253
15
    }
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
203
147
                                 std::vector<ColumnPtr>& then_columns, size_t rows_count) const {
204
214
        for (auto& then_ptr : then_columns) {
205
214
            then_ptr = then_ptr->convert_to_full_column_if_const();
206
214
        }
207
208
147
        result_column_ptr->resize(rows_count);
209
147
        auto* __restrict result_raw_data =
210
147
                assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(result_column_ptr.get())
211
147
                        ->get_data()
212
147
                        .data();
213
214
        // set default value
215
454
        for (int i = 0; i < rows_count; i++) {
216
            if constexpr (std::is_same_v<ColumnType, ColumnDate> ||
217
                          std::is_same_v<ColumnType, ColumnDateTime> ||
218
                          std::is_same_v<ColumnType, ColumnDateV2> ||
219
                          std::is_same_v<ColumnType, ColumnDateTimeV2> ||
220
                          std::is_same_v<ColumnType, ColumnTimeStampTz>) {
221
                result_raw_data[i] = ColumnType::default_value();
222
307
            } else {
223
307
                result_raw_data[i] = {};
224
307
            }
225
307
        }
226
227
361
        for (IndexType i = 0; i < then_columns.size(); i++) {
228
214
            if (!then_columns[i]) {
229
0
                continue;
230
0
            }
231
214
            const auto* __restrict column_raw_data =
232
214
                    assert_cast<const ColumnType*, TypeCheckOnRelease::DISABLE>(
233
214
                            then_columns[i].get())
234
214
                            ->get_data()
235
214
                            .data();
236
            if constexpr (std::is_same_v<ColumnType, ColumnDate> ||
237
                          std::is_same_v<ColumnType, ColumnDateTime> ||
238
                          std::is_same_v<ColumnType, ColumnDateV2> ||
239
                          std::is_same_v<ColumnType, ColumnDateTimeV2> ||
240
                          std::is_same_v<ColumnType, ColumnTimeStampTz>) {
241
                for (int row_idx = 0; row_idx < rows_count; row_idx++) {
242
                    result_raw_data[row_idx] = (then_idx[row_idx] == i) ? column_raw_data[row_idx]
243
                                                                        : result_raw_data[row_idx];
244
                }
245
214
            } else {
246
773
                for (int row_idx = 0; row_idx < rows_count; row_idx++) {
247
559
                    result_raw_data[row_idx] +=
248
559
                            typename ColumnType::value_type(then_idx[row_idx] == i) *
249
559
                            column_raw_data[row_idx];
250
559
                }
251
214
            }
252
214
        }
253
147
    }
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
203
68
                                 std::vector<ColumnPtr>& then_columns, size_t rows_count) const {
204
164
        for (auto& then_ptr : then_columns) {
205
164
            then_ptr = then_ptr->convert_to_full_column_if_const();
206
164
        }
207
208
68
        result_column_ptr->resize(rows_count);
209
68
        auto* __restrict result_raw_data =
210
68
                assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(result_column_ptr.get())
211
68
                        ->get_data()
212
68
                        .data();
213
214
        // set default value
215
184
        for (int i = 0; i < rows_count; i++) {
216
            if constexpr (std::is_same_v<ColumnType, ColumnDate> ||
217
                          std::is_same_v<ColumnType, ColumnDateTime> ||
218
                          std::is_same_v<ColumnType, ColumnDateV2> ||
219
                          std::is_same_v<ColumnType, ColumnDateTimeV2> ||
220
                          std::is_same_v<ColumnType, ColumnTimeStampTz>) {
221
                result_raw_data[i] = ColumnType::default_value();
222
116
            } else {
223
116
                result_raw_data[i] = {};
224
116
            }
225
116
        }
226
227
232
        for (IndexType i = 0; i < then_columns.size(); i++) {
228
164
            if (!then_columns[i]) {
229
0
                continue;
230
0
            }
231
164
            const auto* __restrict column_raw_data =
232
164
                    assert_cast<const ColumnType*, TypeCheckOnRelease::DISABLE>(
233
164
                            then_columns[i].get())
234
164
                            ->get_data()
235
164
                            .data();
236
            if constexpr (std::is_same_v<ColumnType, ColumnDate> ||
237
                          std::is_same_v<ColumnType, ColumnDateTime> ||
238
                          std::is_same_v<ColumnType, ColumnDateV2> ||
239
                          std::is_same_v<ColumnType, ColumnDateTimeV2> ||
240
                          std::is_same_v<ColumnType, ColumnTimeStampTz>) {
241
                for (int row_idx = 0; row_idx < rows_count; row_idx++) {
242
                    result_raw_data[row_idx] = (then_idx[row_idx] == i) ? column_raw_data[row_idx]
243
                                                                        : result_raw_data[row_idx];
244
                }
245
164
            } else {
246
468
                for (int row_idx = 0; row_idx < rows_count; row_idx++) {
247
304
                    result_raw_data[row_idx] +=
248
304
                            typename ColumnType::value_type(then_idx[row_idx] == i) *
249
304
                            column_raw_data[row_idx];
250
304
                }
251
164
            }
252
164
        }
253
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
203
2
                                 std::vector<ColumnPtr>& then_columns, size_t rows_count) const {
204
6
        for (auto& then_ptr : then_columns) {
205
6
            then_ptr = then_ptr->convert_to_full_column_if_const();
206
6
        }
207
208
2
        result_column_ptr->resize(rows_count);
209
2
        auto* __restrict result_raw_data =
210
2
                assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(result_column_ptr.get())
211
2
                        ->get_data()
212
2
                        .data();
213
214
        // set default value
215
12
        for (int i = 0; i < rows_count; i++) {
216
            if constexpr (std::is_same_v<ColumnType, ColumnDate> ||
217
                          std::is_same_v<ColumnType, ColumnDateTime> ||
218
                          std::is_same_v<ColumnType, ColumnDateV2> ||
219
                          std::is_same_v<ColumnType, ColumnDateTimeV2> ||
220
10
                          std::is_same_v<ColumnType, ColumnTimeStampTz>) {
221
10
                result_raw_data[i] = ColumnType::default_value();
222
            } else {
223
                result_raw_data[i] = {};
224
            }
225
10
        }
226
227
8
        for (IndexType i = 0; i < then_columns.size(); i++) {
228
6
            if (!then_columns[i]) {
229
0
                continue;
230
0
            }
231
6
            const auto* __restrict column_raw_data =
232
6
                    assert_cast<const ColumnType*, TypeCheckOnRelease::DISABLE>(
233
6
                            then_columns[i].get())
234
6
                            ->get_data()
235
6
                            .data();
236
            if constexpr (std::is_same_v<ColumnType, ColumnDate> ||
237
                          std::is_same_v<ColumnType, ColumnDateTime> ||
238
                          std::is_same_v<ColumnType, ColumnDateV2> ||
239
                          std::is_same_v<ColumnType, ColumnDateTimeV2> ||
240
6
                          std::is_same_v<ColumnType, ColumnTimeStampTz>) {
241
36
                for (int row_idx = 0; row_idx < rows_count; row_idx++) {
242
30
                    result_raw_data[row_idx] = (then_idx[row_idx] == i) ? column_raw_data[row_idx]
243
30
                                                                        : result_raw_data[row_idx];
244
30
                }
245
            } else {
246
                for (int row_idx = 0; row_idx < rows_count; row_idx++) {
247
                    result_raw_data[row_idx] +=
248
                            typename ColumnType::value_type(then_idx[row_idx] == i) *
249
                            column_raw_data[row_idx];
250
                }
251
            }
252
6
        }
253
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
254
255
    template <typename IndexType>
256
    ColumnPtr _execute_impl(const std::vector<ColumnPtr>& when_columns,
257
451
                            std::vector<ColumnPtr>& then_columns, size_t rows_count) const {
258
451
        std::vector<IndexType> then_idx(rows_count, 0);
259
451
        IndexType* __restrict then_idx_ptr = then_idx.data();
260
1.65k
        for (IndexType i = 0; i < when_columns.size(); i++) {
261
1.20k
            IndexType column_idx = i + 1;
262
1.20k
            auto [raw_when_column, is_consts] = unpack_if_const(when_columns[i]);
263
264
1.20k
            if (is_consts) {
265
0
                if (raw_when_column->get_bool(0)) {
266
0
                    for (int row_idx = 0; row_idx < rows_count; row_idx++) {
267
0
                        then_idx_ptr[row_idx] |= (!then_idx_ptr[row_idx]) * column_idx;
268
0
                    }
269
0
                    break;
270
0
                }
271
0
                continue;
272
0
            }
273
274
1.20k
            if (is_column_nullable(*raw_when_column)) {
275
1.13k
                const auto* column_nullable_ptr =
276
1.13k
                        assert_cast<const ColumnNullable*, TypeCheckOnRelease::DISABLE>(
277
1.13k
                                raw_when_column.get());
278
1.13k
                const auto* __restrict cond_raw_data =
279
1.13k
                        assert_cast<const ColumnUInt8*, TypeCheckOnRelease::DISABLE>(
280
1.13k
                                column_nullable_ptr->get_nested_column_ptr().get())
281
1.13k
                                ->get_data()
282
1.13k
                                .data();
283
1.13k
                if (!column_nullable_ptr->has_null()) {
284
28.8k
                    for (int row_idx = 0; row_idx < rows_count; row_idx++) {
285
27.7k
                        then_idx_ptr[row_idx] |=
286
27.7k
                                (!then_idx_ptr[row_idx]) * cond_raw_data[row_idx] * column_idx;
287
27.7k
                    }
288
1.05k
                    continue;
289
1.05k
                }
290
76
                const auto* __restrict cond_raw_nullmap =
291
76
                        column_nullable_ptr->get_null_map_column_ptr()->get_data().data();
292
480
                for (int row_idx = 0; row_idx < rows_count; row_idx++) {
293
404
                    then_idx_ptr[row_idx] |= (!then_idx_ptr[row_idx] * cond_raw_data[row_idx] *
294
404
                                              !cond_raw_nullmap[row_idx]) *
295
404
                                             column_idx;
296
404
                }
297
76
            } else {
298
74
                const auto* __restrict cond_raw_data =
299
74
                        assert_cast<const ColumnUInt8*, TypeCheckOnRelease::DISABLE>(
300
74
                                raw_when_column.get())
301
74
                                ->get_data()
302
74
                                .data();
303
286
                for (int row_idx = 0; row_idx < rows_count; row_idx++) {
304
212
                    then_idx_ptr[row_idx] |=
305
212
                            (!then_idx_ptr[row_idx]) * cond_raw_data[row_idx] * column_idx;
306
212
                }
307
74
            }
308
1.20k
        }
309
310
451
        return _execute_update_result<IndexType>(then_idx_ptr, then_columns, rows_count);
311
451
    }
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
257
451
                            std::vector<ColumnPtr>& then_columns, size_t rows_count) const {
258
451
        std::vector<IndexType> then_idx(rows_count, 0);
259
451
        IndexType* __restrict then_idx_ptr = then_idx.data();
260
1.65k
        for (IndexType i = 0; i < when_columns.size(); i++) {
261
1.20k
            IndexType column_idx = i + 1;
262
1.20k
            auto [raw_when_column, is_consts] = unpack_if_const(when_columns[i]);
263
264
1.20k
            if (is_consts) {
265
0
                if (raw_when_column->get_bool(0)) {
266
0
                    for (int row_idx = 0; row_idx < rows_count; row_idx++) {
267
0
                        then_idx_ptr[row_idx] |= (!then_idx_ptr[row_idx]) * column_idx;
268
0
                    }
269
0
                    break;
270
0
                }
271
0
                continue;
272
0
            }
273
274
1.20k
            if (is_column_nullable(*raw_when_column)) {
275
1.13k
                const auto* column_nullable_ptr =
276
1.13k
                        assert_cast<const ColumnNullable*, TypeCheckOnRelease::DISABLE>(
277
1.13k
                                raw_when_column.get());
278
1.13k
                const auto* __restrict cond_raw_data =
279
1.13k
                        assert_cast<const ColumnUInt8*, TypeCheckOnRelease::DISABLE>(
280
1.13k
                                column_nullable_ptr->get_nested_column_ptr().get())
281
1.13k
                                ->get_data()
282
1.13k
                                .data();
283
1.13k
                if (!column_nullable_ptr->has_null()) {
284
28.8k
                    for (int row_idx = 0; row_idx < rows_count; row_idx++) {
285
27.7k
                        then_idx_ptr[row_idx] |=
286
27.7k
                                (!then_idx_ptr[row_idx]) * cond_raw_data[row_idx] * column_idx;
287
27.7k
                    }
288
1.05k
                    continue;
289
1.05k
                }
290
76
                const auto* __restrict cond_raw_nullmap =
291
76
                        column_nullable_ptr->get_null_map_column_ptr()->get_data().data();
292
480
                for (int row_idx = 0; row_idx < rows_count; row_idx++) {
293
404
                    then_idx_ptr[row_idx] |= (!then_idx_ptr[row_idx] * cond_raw_data[row_idx] *
294
404
                                              !cond_raw_nullmap[row_idx]) *
295
404
                                             column_idx;
296
404
                }
297
76
            } else {
298
74
                const auto* __restrict cond_raw_data =
299
74
                        assert_cast<const ColumnUInt8*, TypeCheckOnRelease::DISABLE>(
300
74
                                raw_when_column.get())
301
74
                                ->get_data()
302
74
                                .data();
303
286
                for (int row_idx = 0; row_idx < rows_count; row_idx++) {
304
212
                    then_idx_ptr[row_idx] |=
305
212
                            (!then_idx_ptr[row_idx]) * cond_raw_data[row_idx] * column_idx;
306
212
                }
307
74
            }
308
1.20k
        }
309
310
451
        return _execute_update_result<IndexType>(then_idx_ptr, then_columns, rows_count);
311
451
    }
312
313
    bool _has_else_expr;
314
315
    inline static const std::string FUNCTION_NAME = "case";
316
    inline static const std::string EXPR_NAME = "vcase expr";
317
};
318
} // namespace doris