Coverage Report

Created: 2026-05-28 09:29

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
63
private:
64
    template <typename IndexType, typename ColumnType>
65
    ColumnPtr _execute_update_result_impl(const IndexType* then_idx,
66
                                          std::vector<ColumnPtr>& then_columns,
67
1.93k
                                          size_t rows_count) const {
68
1.93k
        auto result_column_ptr = data_type()->create_column();
69
1.93k
        result_column_ptr->reserve(rows_count);
70
        if constexpr (std::is_same_v<ColumnType, ColumnString> ||
71
                      std::is_same_v<ColumnType, ColumnBitmap> ||
72
                      std::is_same_v<ColumnType, ColumnArray> ||
73
                      std::is_same_v<ColumnType, ColumnMap> ||
74
                      std::is_same_v<ColumnType, ColumnStruct> ||
75
                      std::is_same_v<ColumnType, ColumnVariant> ||
76
                      std::is_same_v<ColumnType, ColumnHLL> ||
77
                      std::is_same_v<ColumnType, ColumnQuantileState> ||
78
                      std::is_same_v<ColumnType, ColumnIPv4> ||
79
105
                      std::is_same_v<ColumnType, ColumnIPv6>) {
80
            // result_column and all then_column is not nullable.
81
            // can't simd when type is string.
82
105
            if (data_type()->is_nullable()) {
83
43
                update_result_normal<IndexType, ColumnType, true>(result_column_ptr, then_idx,
84
43
                                                                  then_columns, rows_count);
85
62
            } else {
86
62
                update_result_normal<IndexType, ColumnType, false>(result_column_ptr, then_idx,
87
62
                                                                   then_columns, rows_count);
88
62
            }
89
1.83k
        } else if (data_type()->is_nullable()) {
90
            // result_column and all then_column is nullable.
91
20
            update_result_normal<IndexType, ColumnType, true>(result_column_ptr, then_idx,
92
20
                                                              then_columns, rows_count);
93
1.81k
        } else {
94
1.81k
            update_result_auto_simd<IndexType, ColumnType>(result_column_ptr, then_idx,
95
1.81k
                                                           then_columns, rows_count);
96
1.81k
        }
97
1.93k
        return result_column_ptr;
98
1.93k
    }
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
67
1.60k
                                          size_t rows_count) const {
68
1.60k
        auto result_column_ptr = data_type()->create_column();
69
1.60k
        result_column_ptr->reserve(rows_count);
70
        if constexpr (std::is_same_v<ColumnType, ColumnString> ||
71
                      std::is_same_v<ColumnType, ColumnBitmap> ||
72
                      std::is_same_v<ColumnType, ColumnArray> ||
73
                      std::is_same_v<ColumnType, ColumnMap> ||
74
                      std::is_same_v<ColumnType, ColumnStruct> ||
75
                      std::is_same_v<ColumnType, ColumnVariant> ||
76
                      std::is_same_v<ColumnType, ColumnHLL> ||
77
                      std::is_same_v<ColumnType, ColumnQuantileState> ||
78
                      std::is_same_v<ColumnType, ColumnIPv4> ||
79
                      std::is_same_v<ColumnType, ColumnIPv6>) {
80
            // result_column and all then_column is not nullable.
81
            // can't simd when type is string.
82
            if (data_type()->is_nullable()) {
83
                update_result_normal<IndexType, ColumnType, true>(result_column_ptr, then_idx,
84
                                                                  then_columns, rows_count);
85
            } else {
86
                update_result_normal<IndexType, ColumnType, false>(result_column_ptr, then_idx,
87
                                                                   then_columns, rows_count);
88
            }
89
1.60k
        } else if (data_type()->is_nullable()) {
90
            // result_column and all then_column is nullable.
91
5
            update_result_normal<IndexType, ColumnType, true>(result_column_ptr, then_idx,
92
5
                                                              then_columns, rows_count);
93
1.59k
        } else {
94
1.59k
            update_result_auto_simd<IndexType, ColumnType>(result_column_ptr, then_idx,
95
1.59k
                                                           then_columns, rows_count);
96
1.59k
        }
97
1.60k
        return result_column_ptr;
98
1.60k
    }
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
67
10
                                          size_t rows_count) const {
68
10
        auto result_column_ptr = data_type()->create_column();
69
10
        result_column_ptr->reserve(rows_count);
70
        if constexpr (std::is_same_v<ColumnType, ColumnString> ||
71
                      std::is_same_v<ColumnType, ColumnBitmap> ||
72
                      std::is_same_v<ColumnType, ColumnArray> ||
73
                      std::is_same_v<ColumnType, ColumnMap> ||
74
                      std::is_same_v<ColumnType, ColumnStruct> ||
75
                      std::is_same_v<ColumnType, ColumnVariant> ||
76
                      std::is_same_v<ColumnType, ColumnHLL> ||
77
                      std::is_same_v<ColumnType, ColumnQuantileState> ||
78
                      std::is_same_v<ColumnType, ColumnIPv4> ||
79
                      std::is_same_v<ColumnType, ColumnIPv6>) {
80
            // result_column and all then_column is not nullable.
81
            // can't simd when type is string.
82
            if (data_type()->is_nullable()) {
83
                update_result_normal<IndexType, ColumnType, true>(result_column_ptr, then_idx,
84
                                                                  then_columns, rows_count);
85
            } else {
86
                update_result_normal<IndexType, ColumnType, false>(result_column_ptr, then_idx,
87
                                                                   then_columns, rows_count);
88
            }
89
10
        } else if (data_type()->is_nullable()) {
90
            // result_column and all then_column is nullable.
91
10
            update_result_normal<IndexType, ColumnType, true>(result_column_ptr, then_idx,
92
10
                                                              then_columns, rows_count);
93
10
        } else {
94
0
            update_result_auto_simd<IndexType, ColumnType>(result_column_ptr, then_idx,
95
0
                                                           then_columns, rows_count);
96
0
        }
97
10
        return result_column_ptr;
98
10
    }
_ZNK5doris9VCaseExpr27_execute_update_result_implIhNS_12ColumnVectorILNS_13PrimitiveTypeE6EEEEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EEPKT_RSt6vectorIS9_SaIS9_EEm
Line
Count
Source
67
146
                                          size_t rows_count) const {
68
146
        auto result_column_ptr = data_type()->create_column();
69
146
        result_column_ptr->reserve(rows_count);
70
        if constexpr (std::is_same_v<ColumnType, ColumnString> ||
71
                      std::is_same_v<ColumnType, ColumnBitmap> ||
72
                      std::is_same_v<ColumnType, ColumnArray> ||
73
                      std::is_same_v<ColumnType, ColumnMap> ||
74
                      std::is_same_v<ColumnType, ColumnStruct> ||
75
                      std::is_same_v<ColumnType, ColumnVariant> ||
76
                      std::is_same_v<ColumnType, ColumnHLL> ||
77
                      std::is_same_v<ColumnType, ColumnQuantileState> ||
78
                      std::is_same_v<ColumnType, ColumnIPv4> ||
79
                      std::is_same_v<ColumnType, ColumnIPv6>) {
80
            // result_column and all then_column is not nullable.
81
            // can't simd when type is string.
82
            if (data_type()->is_nullable()) {
83
                update_result_normal<IndexType, ColumnType, true>(result_column_ptr, then_idx,
84
                                                                  then_columns, rows_count);
85
            } else {
86
                update_result_normal<IndexType, ColumnType, false>(result_column_ptr, then_idx,
87
                                                                   then_columns, rows_count);
88
            }
89
146
        } else if (data_type()->is_nullable()) {
90
            // result_column and all then_column is nullable.
91
0
            update_result_normal<IndexType, ColumnType, true>(result_column_ptr, then_idx,
92
0
                                                              then_columns, rows_count);
93
146
        } else {
94
146
            update_result_auto_simd<IndexType, ColumnType>(result_column_ptr, then_idx,
95
146
                                                           then_columns, rows_count);
96
146
        }
97
146
        return result_column_ptr;
98
146
    }
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
67
3
                                          size_t rows_count) const {
68
3
        auto result_column_ptr = data_type()->create_column();
69
3
        result_column_ptr->reserve(rows_count);
70
        if constexpr (std::is_same_v<ColumnType, ColumnString> ||
71
                      std::is_same_v<ColumnType, ColumnBitmap> ||
72
                      std::is_same_v<ColumnType, ColumnArray> ||
73
                      std::is_same_v<ColumnType, ColumnMap> ||
74
                      std::is_same_v<ColumnType, ColumnStruct> ||
75
                      std::is_same_v<ColumnType, ColumnVariant> ||
76
                      std::is_same_v<ColumnType, ColumnHLL> ||
77
                      std::is_same_v<ColumnType, ColumnQuantileState> ||
78
                      std::is_same_v<ColumnType, ColumnIPv4> ||
79
                      std::is_same_v<ColumnType, ColumnIPv6>) {
80
            // result_column and all then_column is not nullable.
81
            // can't simd when type is string.
82
            if (data_type()->is_nullable()) {
83
                update_result_normal<IndexType, ColumnType, true>(result_column_ptr, then_idx,
84
                                                                  then_columns, rows_count);
85
            } else {
86
                update_result_normal<IndexType, ColumnType, false>(result_column_ptr, then_idx,
87
                                                                   then_columns, rows_count);
88
            }
89
3
        } else if (data_type()->is_nullable()) {
90
            // result_column and all then_column is nullable.
91
3
            update_result_normal<IndexType, ColumnType, true>(result_column_ptr, then_idx,
92
3
                                                              then_columns, rows_count);
93
3
        } else {
94
0
            update_result_auto_simd<IndexType, ColumnType>(result_column_ptr, then_idx,
95
0
                                                           then_columns, rows_count);
96
0
        }
97
3
        return result_column_ptr;
98
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
67
68
                                          size_t rows_count) const {
68
68
        auto result_column_ptr = data_type()->create_column();
69
68
        result_column_ptr->reserve(rows_count);
70
        if constexpr (std::is_same_v<ColumnType, ColumnString> ||
71
                      std::is_same_v<ColumnType, ColumnBitmap> ||
72
                      std::is_same_v<ColumnType, ColumnArray> ||
73
                      std::is_same_v<ColumnType, ColumnMap> ||
74
                      std::is_same_v<ColumnType, ColumnStruct> ||
75
                      std::is_same_v<ColumnType, ColumnVariant> ||
76
                      std::is_same_v<ColumnType, ColumnHLL> ||
77
                      std::is_same_v<ColumnType, ColumnQuantileState> ||
78
                      std::is_same_v<ColumnType, ColumnIPv4> ||
79
                      std::is_same_v<ColumnType, ColumnIPv6>) {
80
            // result_column and all then_column is not nullable.
81
            // can't simd when type is string.
82
            if (data_type()->is_nullable()) {
83
                update_result_normal<IndexType, ColumnType, true>(result_column_ptr, then_idx,
84
                                                                  then_columns, rows_count);
85
            } else {
86
                update_result_normal<IndexType, ColumnType, false>(result_column_ptr, then_idx,
87
                                                                   then_columns, rows_count);
88
            }
89
68
        } else if (data_type()->is_nullable()) {
90
            // result_column and all then_column is nullable.
91
0
            update_result_normal<IndexType, ColumnType, true>(result_column_ptr, then_idx,
92
0
                                                              then_columns, rows_count);
93
68
        } else {
94
68
            update_result_auto_simd<IndexType, ColumnType>(result_column_ptr, then_idx,
95
68
                                                           then_columns, rows_count);
96
68
        }
97
68
        return result_column_ptr;
98
68
    }
_ZNK5doris9VCaseExpr27_execute_update_result_implIhNS_13ColumnDecimalILNS_13PrimitiveTypeE35EEEEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EEPKT_RSt6vectorIS9_SaIS9_EEm
Line
Count
Source
67
1
                                          size_t rows_count) const {
68
1
        auto result_column_ptr = data_type()->create_column();
69
1
        result_column_ptr->reserve(rows_count);
70
        if constexpr (std::is_same_v<ColumnType, ColumnString> ||
71
                      std::is_same_v<ColumnType, ColumnBitmap> ||
72
                      std::is_same_v<ColumnType, ColumnArray> ||
73
                      std::is_same_v<ColumnType, ColumnMap> ||
74
                      std::is_same_v<ColumnType, ColumnStruct> ||
75
                      std::is_same_v<ColumnType, ColumnVariant> ||
76
                      std::is_same_v<ColumnType, ColumnHLL> ||
77
                      std::is_same_v<ColumnType, ColumnQuantileState> ||
78
                      std::is_same_v<ColumnType, ColumnIPv4> ||
79
                      std::is_same_v<ColumnType, ColumnIPv6>) {
80
            // result_column and all then_column is not nullable.
81
            // can't simd when type is string.
82
            if (data_type()->is_nullable()) {
83
                update_result_normal<IndexType, ColumnType, true>(result_column_ptr, then_idx,
84
                                                                  then_columns, rows_count);
85
            } else {
86
                update_result_normal<IndexType, ColumnType, false>(result_column_ptr, then_idx,
87
                                                                   then_columns, rows_count);
88
            }
89
1
        } else if (data_type()->is_nullable()) {
90
            // result_column and all then_column is nullable.
91
1
            update_result_normal<IndexType, ColumnType, true>(result_column_ptr, then_idx,
92
1
                                                              then_columns, rows_count);
93
1
        } else {
94
0
            update_result_auto_simd<IndexType, ColumnType>(result_column_ptr, then_idx,
95
0
                                                           then_columns, rows_count);
96
0
        }
97
1
        return result_column_ptr;
98
1
    }
_ZNK5doris9VCaseExpr27_execute_update_result_implIhNS_13ColumnDecimalILNS_13PrimitiveTypeE30EEEEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EEPKT_RSt6vectorIS9_SaIS9_EEm
Line
Count
Source
67
1
                                          size_t rows_count) const {
68
1
        auto result_column_ptr = data_type()->create_column();
69
1
        result_column_ptr->reserve(rows_count);
70
        if constexpr (std::is_same_v<ColumnType, ColumnString> ||
71
                      std::is_same_v<ColumnType, ColumnBitmap> ||
72
                      std::is_same_v<ColumnType, ColumnArray> ||
73
                      std::is_same_v<ColumnType, ColumnMap> ||
74
                      std::is_same_v<ColumnType, ColumnStruct> ||
75
                      std::is_same_v<ColumnType, ColumnVariant> ||
76
                      std::is_same_v<ColumnType, ColumnHLL> ||
77
                      std::is_same_v<ColumnType, ColumnQuantileState> ||
78
                      std::is_same_v<ColumnType, ColumnIPv4> ||
79
                      std::is_same_v<ColumnType, ColumnIPv6>) {
80
            // result_column and all then_column is not nullable.
81
            // can't simd when type is string.
82
            if (data_type()->is_nullable()) {
83
                update_result_normal<IndexType, ColumnType, true>(result_column_ptr, then_idx,
84
                                                                  then_columns, rows_count);
85
            } else {
86
                update_result_normal<IndexType, ColumnType, false>(result_column_ptr, then_idx,
87
                                                                   then_columns, rows_count);
88
            }
89
1
        } else if (data_type()->is_nullable()) {
90
            // result_column and all then_column is nullable.
91
1
            update_result_normal<IndexType, ColumnType, true>(result_column_ptr, then_idx,
92
1
                                                              then_columns, rows_count);
93
1
        } else {
94
0
            update_result_auto_simd<IndexType, ColumnType>(result_column_ptr, then_idx,
95
0
                                                           then_columns, rows_count);
96
0
        }
97
1
        return result_column_ptr;
98
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
67
105
                                          size_t rows_count) const {
68
105
        auto result_column_ptr = data_type()->create_column();
69
105
        result_column_ptr->reserve(rows_count);
70
        if constexpr (std::is_same_v<ColumnType, ColumnString> ||
71
                      std::is_same_v<ColumnType, ColumnBitmap> ||
72
                      std::is_same_v<ColumnType, ColumnArray> ||
73
                      std::is_same_v<ColumnType, ColumnMap> ||
74
                      std::is_same_v<ColumnType, ColumnStruct> ||
75
                      std::is_same_v<ColumnType, ColumnVariant> ||
76
                      std::is_same_v<ColumnType, ColumnHLL> ||
77
                      std::is_same_v<ColumnType, ColumnQuantileState> ||
78
                      std::is_same_v<ColumnType, ColumnIPv4> ||
79
105
                      std::is_same_v<ColumnType, ColumnIPv6>) {
80
            // result_column and all then_column is not nullable.
81
            // can't simd when type is string.
82
105
            if (data_type()->is_nullable()) {
83
43
                update_result_normal<IndexType, ColumnType, true>(result_column_ptr, then_idx,
84
43
                                                                  then_columns, rows_count);
85
62
            } else {
86
62
                update_result_normal<IndexType, ColumnType, false>(result_column_ptr, then_idx,
87
62
                                                                   then_columns, rows_count);
88
62
            }
89
        } else if (data_type()->is_nullable()) {
90
            // result_column and all then_column is nullable.
91
            update_result_normal<IndexType, ColumnType, true>(result_column_ptr, then_idx,
92
                                                              then_columns, rows_count);
93
        } else {
94
            update_result_auto_simd<IndexType, ColumnType>(result_column_ptr, then_idx,
95
                                                           then_columns, rows_count);
96
        }
97
105
        return result_column_ptr;
98
105
    }
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
67
2
                                          size_t rows_count) const {
68
2
        auto result_column_ptr = data_type()->create_column();
69
2
        result_column_ptr->reserve(rows_count);
70
        if constexpr (std::is_same_v<ColumnType, ColumnString> ||
71
                      std::is_same_v<ColumnType, ColumnBitmap> ||
72
                      std::is_same_v<ColumnType, ColumnArray> ||
73
                      std::is_same_v<ColumnType, ColumnMap> ||
74
                      std::is_same_v<ColumnType, ColumnStruct> ||
75
                      std::is_same_v<ColumnType, ColumnVariant> ||
76
                      std::is_same_v<ColumnType, ColumnHLL> ||
77
                      std::is_same_v<ColumnType, ColumnQuantileState> ||
78
                      std::is_same_v<ColumnType, ColumnIPv4> ||
79
                      std::is_same_v<ColumnType, ColumnIPv6>) {
80
            // result_column and all then_column is not nullable.
81
            // can't simd when type is string.
82
            if (data_type()->is_nullable()) {
83
                update_result_normal<IndexType, ColumnType, true>(result_column_ptr, then_idx,
84
                                                                  then_columns, rows_count);
85
            } else {
86
                update_result_normal<IndexType, ColumnType, false>(result_column_ptr, then_idx,
87
                                                                   then_columns, rows_count);
88
            }
89
2
        } else if (data_type()->is_nullable()) {
90
            // result_column and all then_column is nullable.
91
0
            update_result_normal<IndexType, ColumnType, true>(result_column_ptr, then_idx,
92
0
                                                              then_columns, rows_count);
93
2
        } else {
94
2
            update_result_auto_simd<IndexType, ColumnType>(result_column_ptr, then_idx,
95
2
                                                           then_columns, rows_count);
96
2
        }
97
2
        return result_column_ptr;
98
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
99
100
    template <typename IndexType>
101
    ColumnPtr _execute_update_result(const IndexType* then_idx,
102
                                     std::vector<ColumnPtr>& then_columns,
103
1.93k
                                     size_t rows_count) const {
104
1.93k
#define CASE_TYPE(ptype, coltype) \
105
1.93k
    case PrimitiveType::ptype:    \
106
1.93k
        return _execute_update_result_impl<IndexType, coltype>(then_idx, then_columns, rows_count);
107
108
1.93k
        switch (data_type()->get_primitive_type()) {
109
0
            CASE_TYPE(TYPE_BOOLEAN, ColumnUInt8)
110
1.60k
            CASE_TYPE(TYPE_TINYINT, ColumnInt8)
111
0
            CASE_TYPE(TYPE_SMALLINT, ColumnInt16)
112
10
            CASE_TYPE(TYPE_INT, ColumnInt32)
113
146
            CASE_TYPE(TYPE_BIGINT, ColumnInt64)
114
0
            CASE_TYPE(TYPE_LARGEINT, ColumnInt128)
115
0
            CASE_TYPE(TYPE_FLOAT, ColumnFloat32)
116
3
            CASE_TYPE(TYPE_DOUBLE, ColumnFloat64)
117
0
            CASE_TYPE(TYPE_DECIMAL32, ColumnDecimal32)
118
68
            CASE_TYPE(TYPE_DECIMAL64, ColumnDecimal64)
119
1
            CASE_TYPE(TYPE_DECIMAL256, ColumnDecimal256)
120
1
            CASE_TYPE(TYPE_DECIMAL128I, ColumnDecimal128V3)
121
0
            CASE_TYPE(TYPE_DECIMALV2, ColumnDecimal128V2)
122
2
            CASE_TYPE(TYPE_STRING, ColumnString)
123
0
            CASE_TYPE(TYPE_CHAR, ColumnString)
124
103
            CASE_TYPE(TYPE_VARCHAR, ColumnString)
125
0
            CASE_TYPE(TYPE_JSONB, ColumnString)
126
0
            CASE_TYPE(TYPE_DATE, ColumnDate)
127
0
            CASE_TYPE(TYPE_DATETIME, ColumnDateTime)
128
2
            CASE_TYPE(TYPE_DATEV2, ColumnDateV2)
129
0
            CASE_TYPE(TYPE_DATETIMEV2, ColumnDateTimeV2)
130
0
            CASE_TYPE(TYPE_TIMESTAMPTZ, ColumnTimeStampTz)
131
0
            CASE_TYPE(TYPE_IPV6, ColumnIPv6)
132
0
            CASE_TYPE(TYPE_IPV4, ColumnIPv4)
133
0
            CASE_TYPE(TYPE_ARRAY, ColumnArray)
134
0
            CASE_TYPE(TYPE_MAP, ColumnMap)
135
0
            CASE_TYPE(TYPE_STRUCT, ColumnStruct)
136
0
            CASE_TYPE(TYPE_VARIANT, ColumnVariant)
137
0
            CASE_TYPE(TYPE_BITMAP, ColumnBitmap)
138
0
            CASE_TYPE(TYPE_HLL, ColumnHLL)
139
0
            CASE_TYPE(TYPE_QUANTILE_STATE, ColumnQuantileState)
140
0
        default:
141
0
            throw Exception(ErrorCode::NOT_IMPLEMENTED_ERROR, "argument_type {} not supported",
142
0
                            data_type()->get_name());
143
1.93k
        }
144
1.93k
#undef CASE_TYPE
145
1.93k
    }
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
103
1.93k
                                     size_t rows_count) const {
104
1.93k
#define CASE_TYPE(ptype, coltype) \
105
1.93k
    case PrimitiveType::ptype:    \
106
1.93k
        return _execute_update_result_impl<IndexType, coltype>(then_idx, then_columns, rows_count);
107
108
1.93k
        switch (data_type()->get_primitive_type()) {
109
0
            CASE_TYPE(TYPE_BOOLEAN, ColumnUInt8)
110
1.60k
            CASE_TYPE(TYPE_TINYINT, ColumnInt8)
111
0
            CASE_TYPE(TYPE_SMALLINT, ColumnInt16)
112
10
            CASE_TYPE(TYPE_INT, ColumnInt32)
113
146
            CASE_TYPE(TYPE_BIGINT, ColumnInt64)
114
0
            CASE_TYPE(TYPE_LARGEINT, ColumnInt128)
115
0
            CASE_TYPE(TYPE_FLOAT, ColumnFloat32)
116
3
            CASE_TYPE(TYPE_DOUBLE, ColumnFloat64)
117
0
            CASE_TYPE(TYPE_DECIMAL32, ColumnDecimal32)
118
68
            CASE_TYPE(TYPE_DECIMAL64, ColumnDecimal64)
119
1
            CASE_TYPE(TYPE_DECIMAL256, ColumnDecimal256)
120
1
            CASE_TYPE(TYPE_DECIMAL128I, ColumnDecimal128V3)
121
0
            CASE_TYPE(TYPE_DECIMALV2, ColumnDecimal128V2)
122
2
            CASE_TYPE(TYPE_STRING, ColumnString)
123
0
            CASE_TYPE(TYPE_CHAR, ColumnString)
124
103
            CASE_TYPE(TYPE_VARCHAR, ColumnString)
125
0
            CASE_TYPE(TYPE_JSONB, ColumnString)
126
0
            CASE_TYPE(TYPE_DATE, ColumnDate)
127
0
            CASE_TYPE(TYPE_DATETIME, ColumnDateTime)
128
2
            CASE_TYPE(TYPE_DATEV2, ColumnDateV2)
129
0
            CASE_TYPE(TYPE_DATETIMEV2, ColumnDateTimeV2)
130
0
            CASE_TYPE(TYPE_TIMESTAMPTZ, ColumnTimeStampTz)
131
0
            CASE_TYPE(TYPE_IPV6, ColumnIPv6)
132
0
            CASE_TYPE(TYPE_IPV4, ColumnIPv4)
133
0
            CASE_TYPE(TYPE_ARRAY, ColumnArray)
134
0
            CASE_TYPE(TYPE_MAP, ColumnMap)
135
0
            CASE_TYPE(TYPE_STRUCT, ColumnStruct)
136
0
            CASE_TYPE(TYPE_VARIANT, ColumnVariant)
137
0
            CASE_TYPE(TYPE_BITMAP, ColumnBitmap)
138
0
            CASE_TYPE(TYPE_HLL, ColumnHLL)
139
0
            CASE_TYPE(TYPE_QUANTILE_STATE, ColumnQuantileState)
140
0
        default:
141
0
            throw Exception(ErrorCode::NOT_IMPLEMENTED_ERROR, "argument_type {} not supported",
142
0
                            data_type()->get_name());
143
1.93k
        }
144
1.93k
#undef CASE_TYPE
145
1.93k
    }
146
147
    template <typename IndexType, typename ColumnType, bool then_null>
148
    void update_result_normal(MutableColumnPtr& result_column_ptr,
149
                              const IndexType* __restrict then_idx,
150
125
                              std::vector<ColumnPtr>& then_columns, size_t rows_count) const {
151
125
        std::vector<ColumnPtr> raw_then_columns(then_columns.size());
152
125
        std::vector<uint8_t> is_consts(then_columns.size());
153
125
        std::vector<uint8_t> is_nullable(then_columns.size());
154
406
        for (size_t i = 0; i < then_columns.size(); i++) {
155
281
            if (!then_columns[i]) {
156
46
                continue;
157
46
            }
158
235
            std::tie(raw_then_columns[i], is_consts[i]) = unpack_if_const(then_columns[i]);
159
235
            is_nullable[i] = raw_then_columns[i]->is_nullable();
160
235
        }
161
162
125
        auto* raw_result_column = result_column_ptr.get();
163
484
        for (int row_idx = 0; row_idx < rows_count; row_idx++) {
164
359
            if (!_has_else_expr && !then_idx[row_idx]) {
165
14
                assert_cast<ColumnNullable*, TypeCheckOnRelease::DISABLE>(raw_result_column)
166
14
                        ->insert_default();
167
14
                continue;
168
14
            }
169
345
            size_t target = is_consts[then_idx[row_idx]] ? 0 : row_idx;
170
345
            if constexpr (then_null) {
171
157
                auto* nullable = assert_cast<ColumnNullable*, TypeCheckOnRelease::DISABLE>(
172
157
                        result_column_ptr.get());
173
157
                if (is_nullable[then_idx[row_idx]]) {
174
39
                    nullable->insert_from_with_type<ColumnType>(
175
39
                            *raw_then_columns[then_idx[row_idx]], target);
176
118
                } else {
177
118
                    auto* nested = assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(
178
118
                            nullable->get_nested_column_ptr().get());
179
118
                    nested->insert_from(*raw_then_columns[then_idx[row_idx]], target);
180
118
                    nullable->push_false_to_nullmap(1);
181
118
                }
182
188
            } else {
183
188
                assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(result_column_ptr.get())
184
188
                        ->insert_from(*raw_then_columns[then_idx[row_idx]], target);
185
188
            }
186
345
        }
187
125
    }
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
150
5
                              std::vector<ColumnPtr>& then_columns, size_t rows_count) const {
151
5
        std::vector<ColumnPtr> raw_then_columns(then_columns.size());
152
5
        std::vector<uint8_t> is_consts(then_columns.size());
153
5
        std::vector<uint8_t> is_nullable(then_columns.size());
154
16
        for (size_t i = 0; i < then_columns.size(); i++) {
155
11
            if (!then_columns[i]) {
156
5
                continue;
157
5
            }
158
6
            std::tie(raw_then_columns[i], is_consts[i]) = unpack_if_const(then_columns[i]);
159
6
            is_nullable[i] = raw_then_columns[i]->is_nullable();
160
6
        }
161
162
5
        auto* raw_result_column = result_column_ptr.get();
163
13
        for (int row_idx = 0; row_idx < rows_count; row_idx++) {
164
8
            if (!_has_else_expr && !then_idx[row_idx]) {
165
0
                assert_cast<ColumnNullable*, TypeCheckOnRelease::DISABLE>(raw_result_column)
166
0
                        ->insert_default();
167
0
                continue;
168
0
            }
169
8
            size_t target = is_consts[then_idx[row_idx]] ? 0 : row_idx;
170
8
            if constexpr (then_null) {
171
8
                auto* nullable = assert_cast<ColumnNullable*, TypeCheckOnRelease::DISABLE>(
172
8
                        result_column_ptr.get());
173
8
                if (is_nullable[then_idx[row_idx]]) {
174
0
                    nullable->insert_from_with_type<ColumnType>(
175
0
                            *raw_then_columns[then_idx[row_idx]], target);
176
8
                } else {
177
8
                    auto* nested = assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(
178
8
                            nullable->get_nested_column_ptr().get());
179
8
                    nested->insert_from(*raw_then_columns[then_idx[row_idx]], target);
180
8
                    nullable->push_false_to_nullmap(1);
181
8
                }
182
            } else {
183
                assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(result_column_ptr.get())
184
                        ->insert_from(*raw_then_columns[then_idx[row_idx]], target);
185
            }
186
8
        }
187
5
    }
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
150
10
                              std::vector<ColumnPtr>& then_columns, size_t rows_count) const {
151
10
        std::vector<ColumnPtr> raw_then_columns(then_columns.size());
152
10
        std::vector<uint8_t> is_consts(then_columns.size());
153
10
        std::vector<uint8_t> is_nullable(then_columns.size());
154
21
        for (size_t i = 0; i < then_columns.size(); i++) {
155
11
            if (!then_columns[i]) {
156
0
                continue;
157
0
            }
158
11
            std::tie(raw_then_columns[i], is_consts[i]) = unpack_if_const(then_columns[i]);
159
11
            is_nullable[i] = raw_then_columns[i]->is_nullable();
160
11
        }
161
162
10
        auto* raw_result_column = result_column_ptr.get();
163
30
        for (int row_idx = 0; row_idx < rows_count; row_idx++) {
164
20
            if (!_has_else_expr && !then_idx[row_idx]) {
165
0
                assert_cast<ColumnNullable*, TypeCheckOnRelease::DISABLE>(raw_result_column)
166
0
                        ->insert_default();
167
0
                continue;
168
0
            }
169
20
            size_t target = is_consts[then_idx[row_idx]] ? 0 : row_idx;
170
20
            if constexpr (then_null) {
171
20
                auto* nullable = assert_cast<ColumnNullable*, TypeCheckOnRelease::DISABLE>(
172
20
                        result_column_ptr.get());
173
20
                if (is_nullable[then_idx[row_idx]]) {
174
20
                    nullable->insert_from_with_type<ColumnType>(
175
20
                            *raw_then_columns[then_idx[row_idx]], target);
176
20
                } else {
177
0
                    auto* nested = assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(
178
0
                            nullable->get_nested_column_ptr().get());
179
0
                    nested->insert_from(*raw_then_columns[then_idx[row_idx]], target);
180
0
                    nullable->push_false_to_nullmap(1);
181
0
                }
182
            } else {
183
                assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(result_column_ptr.get())
184
                        ->insert_from(*raw_then_columns[then_idx[row_idx]], target);
185
            }
186
20
        }
187
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
150
3
                              std::vector<ColumnPtr>& then_columns, size_t rows_count) const {
151
3
        std::vector<ColumnPtr> raw_then_columns(then_columns.size());
152
3
        std::vector<uint8_t> is_consts(then_columns.size());
153
3
        std::vector<uint8_t> is_nullable(then_columns.size());
154
11
        for (size_t i = 0; i < then_columns.size(); i++) {
155
8
            if (!then_columns[i]) {
156
0
                continue;
157
0
            }
158
8
            std::tie(raw_then_columns[i], is_consts[i]) = unpack_if_const(then_columns[i]);
159
8
            is_nullable[i] = raw_then_columns[i]->is_nullable();
160
8
        }
161
162
3
        auto* raw_result_column = result_column_ptr.get();
163
13
        for (int row_idx = 0; row_idx < rows_count; row_idx++) {
164
10
            if (!_has_else_expr && !then_idx[row_idx]) {
165
0
                assert_cast<ColumnNullable*, TypeCheckOnRelease::DISABLE>(raw_result_column)
166
0
                        ->insert_default();
167
0
                continue;
168
0
            }
169
10
            size_t target = is_consts[then_idx[row_idx]] ? 0 : row_idx;
170
10
            if constexpr (then_null) {
171
10
                auto* nullable = assert_cast<ColumnNullable*, TypeCheckOnRelease::DISABLE>(
172
10
                        result_column_ptr.get());
173
10
                if (is_nullable[then_idx[row_idx]]) {
174
7
                    nullable->insert_from_with_type<ColumnType>(
175
7
                            *raw_then_columns[then_idx[row_idx]], target);
176
7
                } else {
177
3
                    auto* nested = assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(
178
3
                            nullable->get_nested_column_ptr().get());
179
3
                    nested->insert_from(*raw_then_columns[then_idx[row_idx]], target);
180
3
                    nullable->push_false_to_nullmap(1);
181
3
                }
182
            } else {
183
                assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(result_column_ptr.get())
184
                        ->insert_from(*raw_then_columns[then_idx[row_idx]], target);
185
            }
186
10
        }
187
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
150
1
                              std::vector<ColumnPtr>& then_columns, size_t rows_count) const {
151
1
        std::vector<ColumnPtr> raw_then_columns(then_columns.size());
152
1
        std::vector<uint8_t> is_consts(then_columns.size());
153
1
        std::vector<uint8_t> is_nullable(then_columns.size());
154
3
        for (size_t i = 0; i < then_columns.size(); i++) {
155
2
            if (!then_columns[i]) {
156
0
                continue;
157
0
            }
158
2
            std::tie(raw_then_columns[i], is_consts[i]) = unpack_if_const(then_columns[i]);
159
2
            is_nullable[i] = raw_then_columns[i]->is_nullable();
160
2
        }
161
162
1
        auto* raw_result_column = result_column_ptr.get();
163
2
        for (int row_idx = 0; row_idx < rows_count; row_idx++) {
164
1
            if (!_has_else_expr && !then_idx[row_idx]) {
165
0
                assert_cast<ColumnNullable*, TypeCheckOnRelease::DISABLE>(raw_result_column)
166
0
                        ->insert_default();
167
0
                continue;
168
0
            }
169
1
            size_t target = is_consts[then_idx[row_idx]] ? 0 : row_idx;
170
1
            if constexpr (then_null) {
171
1
                auto* nullable = assert_cast<ColumnNullable*, TypeCheckOnRelease::DISABLE>(
172
1
                        result_column_ptr.get());
173
1
                if (is_nullable[then_idx[row_idx]]) {
174
1
                    nullable->insert_from_with_type<ColumnType>(
175
1
                            *raw_then_columns[then_idx[row_idx]], target);
176
1
                } else {
177
0
                    auto* nested = assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(
178
0
                            nullable->get_nested_column_ptr().get());
179
0
                    nested->insert_from(*raw_then_columns[then_idx[row_idx]], target);
180
0
                    nullable->push_false_to_nullmap(1);
181
0
                }
182
            } else {
183
                assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(result_column_ptr.get())
184
                        ->insert_from(*raw_then_columns[then_idx[row_idx]], target);
185
            }
186
1
        }
187
1
    }
_ZNK5doris9VCaseExpr20update_result_normalIhNS_13ColumnDecimalILNS_13PrimitiveTypeE30EEELb1EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EEPKT_RSt6vectorINS7_13immutable_ptrIS6_EESaISG_EEm
Line
Count
Source
150
1
                              std::vector<ColumnPtr>& then_columns, size_t rows_count) const {
151
1
        std::vector<ColumnPtr> raw_then_columns(then_columns.size());
152
1
        std::vector<uint8_t> is_consts(then_columns.size());
153
1
        std::vector<uint8_t> is_nullable(then_columns.size());
154
3
        for (size_t i = 0; i < then_columns.size(); i++) {
155
2
            if (!then_columns[i]) {
156
0
                continue;
157
0
            }
158
2
            std::tie(raw_then_columns[i], is_consts[i]) = unpack_if_const(then_columns[i]);
159
2
            is_nullable[i] = raw_then_columns[i]->is_nullable();
160
2
        }
161
162
1
        auto* raw_result_column = result_column_ptr.get();
163
2
        for (int row_idx = 0; row_idx < rows_count; row_idx++) {
164
1
            if (!_has_else_expr && !then_idx[row_idx]) {
165
0
                assert_cast<ColumnNullable*, TypeCheckOnRelease::DISABLE>(raw_result_column)
166
0
                        ->insert_default();
167
0
                continue;
168
0
            }
169
1
            size_t target = is_consts[then_idx[row_idx]] ? 0 : row_idx;
170
1
            if constexpr (then_null) {
171
1
                auto* nullable = assert_cast<ColumnNullable*, TypeCheckOnRelease::DISABLE>(
172
1
                        result_column_ptr.get());
173
1
                if (is_nullable[then_idx[row_idx]]) {
174
1
                    nullable->insert_from_with_type<ColumnType>(
175
1
                            *raw_then_columns[then_idx[row_idx]], target);
176
1
                } else {
177
0
                    auto* nested = assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(
178
0
                            nullable->get_nested_column_ptr().get());
179
0
                    nested->insert_from(*raw_then_columns[then_idx[row_idx]], target);
180
0
                    nullable->push_false_to_nullmap(1);
181
0
                }
182
            } else {
183
                assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(result_column_ptr.get())
184
                        ->insert_from(*raw_then_columns[then_idx[row_idx]], target);
185
            }
186
1
        }
187
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
150
43
                              std::vector<ColumnPtr>& then_columns, size_t rows_count) const {
151
43
        std::vector<ColumnPtr> raw_then_columns(then_columns.size());
152
43
        std::vector<uint8_t> is_consts(then_columns.size());
153
43
        std::vector<uint8_t> is_nullable(then_columns.size());
154
144
        for (size_t i = 0; i < then_columns.size(); i++) {
155
101
            if (!then_columns[i]) {
156
41
                continue;
157
41
            }
158
60
            std::tie(raw_then_columns[i], is_consts[i]) = unpack_if_const(then_columns[i]);
159
60
            is_nullable[i] = raw_then_columns[i]->is_nullable();
160
60
        }
161
162
43
        auto* raw_result_column = result_column_ptr.get();
163
174
        for (int row_idx = 0; row_idx < rows_count; row_idx++) {
164
131
            if (!_has_else_expr && !then_idx[row_idx]) {
165
14
                assert_cast<ColumnNullable*, TypeCheckOnRelease::DISABLE>(raw_result_column)
166
14
                        ->insert_default();
167
14
                continue;
168
14
            }
169
117
            size_t target = is_consts[then_idx[row_idx]] ? 0 : row_idx;
170
117
            if constexpr (then_null) {
171
117
                auto* nullable = assert_cast<ColumnNullable*, TypeCheckOnRelease::DISABLE>(
172
117
                        result_column_ptr.get());
173
117
                if (is_nullable[then_idx[row_idx]]) {
174
10
                    nullable->insert_from_with_type<ColumnType>(
175
10
                            *raw_then_columns[then_idx[row_idx]], target);
176
107
                } else {
177
107
                    auto* nested = assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(
178
107
                            nullable->get_nested_column_ptr().get());
179
107
                    nested->insert_from(*raw_then_columns[then_idx[row_idx]], target);
180
107
                    nullable->push_false_to_nullmap(1);
181
107
                }
182
            } else {
183
                assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(result_column_ptr.get())
184
                        ->insert_from(*raw_then_columns[then_idx[row_idx]], target);
185
            }
186
117
        }
187
43
    }
_ZNK5doris9VCaseExpr20update_result_normalIhNS_9ColumnStrIjEELb0EEEvRNS_3COWINS_7IColumnEE11mutable_ptrIS5_EEPKT_RSt6vectorINS6_13immutable_ptrIS5_EESaISF_EEm
Line
Count
Source
150
62
                              std::vector<ColumnPtr>& then_columns, size_t rows_count) const {
151
62
        std::vector<ColumnPtr> raw_then_columns(then_columns.size());
152
62
        std::vector<uint8_t> is_consts(then_columns.size());
153
62
        std::vector<uint8_t> is_nullable(then_columns.size());
154
208
        for (size_t i = 0; i < then_columns.size(); i++) {
155
146
            if (!then_columns[i]) {
156
0
                continue;
157
0
            }
158
146
            std::tie(raw_then_columns[i], is_consts[i]) = unpack_if_const(then_columns[i]);
159
146
            is_nullable[i] = raw_then_columns[i]->is_nullable();
160
146
        }
161
162
62
        auto* raw_result_column = result_column_ptr.get();
163
250
        for (int row_idx = 0; row_idx < rows_count; row_idx++) {
164
188
            if (!_has_else_expr && !then_idx[row_idx]) {
165
0
                assert_cast<ColumnNullable*, TypeCheckOnRelease::DISABLE>(raw_result_column)
166
0
                        ->insert_default();
167
0
                continue;
168
0
            }
169
188
            size_t target = is_consts[then_idx[row_idx]] ? 0 : row_idx;
170
            if constexpr (then_null) {
171
                auto* nullable = assert_cast<ColumnNullable*, TypeCheckOnRelease::DISABLE>(
172
                        result_column_ptr.get());
173
                if (is_nullable[then_idx[row_idx]]) {
174
                    nullable->insert_from_with_type<ColumnType>(
175
                            *raw_then_columns[then_idx[row_idx]], target);
176
                } else {
177
                    auto* nested = assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(
178
                            nullable->get_nested_column_ptr().get());
179
                    nested->insert_from(*raw_then_columns[then_idx[row_idx]], target);
180
                    nullable->push_false_to_nullmap(1);
181
                }
182
188
            } else {
183
188
                assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(result_column_ptr.get())
184
188
                        ->insert_from(*raw_then_columns[then_idx[row_idx]], target);
185
188
            }
186
188
        }
187
62
    }
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
188
189
    template <typename IndexType, typename ColumnType>
190
    void update_result_auto_simd(MutableColumnPtr& result_column_ptr,
191
                                 const IndexType* __restrict then_idx,
192
1.81k
                                 std::vector<ColumnPtr>& then_columns, size_t rows_count) const {
193
2.79k
        for (auto& then_ptr : then_columns) {
194
2.79k
            then_ptr = then_ptr->convert_to_full_column_if_const();
195
2.79k
        }
196
197
1.81k
        result_column_ptr->resize(rows_count);
198
1.81k
        auto* __restrict result_raw_data =
199
1.81k
                assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(result_column_ptr.get())
200
1.81k
                        ->get_data()
201
1.81k
                        .data();
202
203
        // set default value
204
3.86k
        for (int i = 0; i < rows_count; i++) {
205
            if constexpr (std::is_same_v<ColumnType, ColumnDate> ||
206
                          std::is_same_v<ColumnType, ColumnDateTime> ||
207
                          std::is_same_v<ColumnType, ColumnDateV2> ||
208
                          std::is_same_v<ColumnType, ColumnDateTimeV2> ||
209
10
                          std::is_same_v<ColumnType, ColumnTimeStampTz>) {
210
10
                result_raw_data[i] = ColumnType::default_value();
211
2.04k
            } else {
212
2.04k
                result_raw_data[i] = {};
213
2.04k
            }
214
2.05k
        }
215
216
4.60k
        for (IndexType i = 0; i < then_columns.size(); i++) {
217
2.79k
            if (!then_columns[i]) {
218
0
                continue;
219
0
            }
220
2.79k
            const auto* __restrict column_raw_data =
221
2.79k
                    assert_cast<const ColumnType*, TypeCheckOnRelease::DISABLE>(
222
2.79k
                            then_columns[i].get())
223
2.79k
                            ->get_data()
224
2.79k
                            .data();
225
            if constexpr (std::is_same_v<ColumnType, ColumnDate> ||
226
                          std::is_same_v<ColumnType, ColumnDateTime> ||
227
                          std::is_same_v<ColumnType, ColumnDateV2> ||
228
                          std::is_same_v<ColumnType, ColumnDateTimeV2> ||
229
6
                          std::is_same_v<ColumnType, ColumnTimeStampTz>) {
230
36
                for (int row_idx = 0; row_idx < rows_count; row_idx++) {
231
30
                    result_raw_data[row_idx] = (then_idx[row_idx] == i) ? column_raw_data[row_idx]
232
30
                                                                        : result_raw_data[row_idx];
233
30
                }
234
2.79k
            } else {
235
6.14k
                for (int row_idx = 0; row_idx < rows_count; row_idx++) {
236
3.35k
                    result_raw_data[row_idx] +=
237
3.35k
                            typename ColumnType::value_type(then_idx[row_idx] == i) *
238
3.35k
                            column_raw_data[row_idx];
239
3.35k
                }
240
2.79k
            }
241
2.79k
        }
242
1.81k
    }
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
192
1.59k
                                 std::vector<ColumnPtr>& then_columns, size_t rows_count) const {
193
2.41k
        for (auto& then_ptr : then_columns) {
194
2.41k
            then_ptr = then_ptr->convert_to_full_column_if_const();
195
2.41k
        }
196
197
1.59k
        result_column_ptr->resize(rows_count);
198
1.59k
        auto* __restrict result_raw_data =
199
1.59k
                assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(result_column_ptr.get())
200
1.59k
                        ->get_data()
201
1.59k
                        .data();
202
203
        // set default value
204
3.20k
        for (int i = 0; i < rows_count; i++) {
205
            if constexpr (std::is_same_v<ColumnType, ColumnDate> ||
206
                          std::is_same_v<ColumnType, ColumnDateTime> ||
207
                          std::is_same_v<ColumnType, ColumnDateV2> ||
208
                          std::is_same_v<ColumnType, ColumnDateTimeV2> ||
209
                          std::is_same_v<ColumnType, ColumnTimeStampTz>) {
210
                result_raw_data[i] = ColumnType::default_value();
211
1.61k
            } else {
212
1.61k
                result_raw_data[i] = {};
213
1.61k
            }
214
1.61k
        }
215
216
4.00k
        for (IndexType i = 0; i < then_columns.size(); i++) {
217
2.41k
            if (!then_columns[i]) {
218
0
                continue;
219
0
            }
220
2.41k
            const auto* __restrict column_raw_data =
221
2.41k
                    assert_cast<const ColumnType*, TypeCheckOnRelease::DISABLE>(
222
2.41k
                            then_columns[i].get())
223
2.41k
                            ->get_data()
224
2.41k
                            .data();
225
            if constexpr (std::is_same_v<ColumnType, ColumnDate> ||
226
                          std::is_same_v<ColumnType, ColumnDateTime> ||
227
                          std::is_same_v<ColumnType, ColumnDateV2> ||
228
                          std::is_same_v<ColumnType, ColumnDateTimeV2> ||
229
                          std::is_same_v<ColumnType, ColumnTimeStampTz>) {
230
                for (int row_idx = 0; row_idx < rows_count; row_idx++) {
231
                    result_raw_data[row_idx] = (then_idx[row_idx] == i) ? column_raw_data[row_idx]
232
                                                                        : result_raw_data[row_idx];
233
                }
234
2.41k
            } else {
235
4.86k
                for (int row_idx = 0; row_idx < rows_count; row_idx++) {
236
2.45k
                    result_raw_data[row_idx] +=
237
2.45k
                            typename ColumnType::value_type(then_idx[row_idx] == i) *
238
2.45k
                            column_raw_data[row_idx];
239
2.45k
                }
240
2.41k
            }
241
2.41k
        }
242
1.59k
    }
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
192
146
                                 std::vector<ColumnPtr>& then_columns, size_t rows_count) const {
193
215
        for (auto& then_ptr : then_columns) {
194
215
            then_ptr = then_ptr->convert_to_full_column_if_const();
195
215
        }
196
197
146
        result_column_ptr->resize(rows_count);
198
146
        auto* __restrict result_raw_data =
199
146
                assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(result_column_ptr.get())
200
146
                        ->get_data()
201
146
                        .data();
202
203
        // set default value
204
466
        for (int i = 0; i < rows_count; i++) {
205
            if constexpr (std::is_same_v<ColumnType, ColumnDate> ||
206
                          std::is_same_v<ColumnType, ColumnDateTime> ||
207
                          std::is_same_v<ColumnType, ColumnDateV2> ||
208
                          std::is_same_v<ColumnType, ColumnDateTimeV2> ||
209
                          std::is_same_v<ColumnType, ColumnTimeStampTz>) {
210
                result_raw_data[i] = ColumnType::default_value();
211
320
            } else {
212
320
                result_raw_data[i] = {};
213
320
            }
214
320
        }
215
216
361
        for (IndexType i = 0; i < then_columns.size(); i++) {
217
215
            if (!then_columns[i]) {
218
0
                continue;
219
0
            }
220
215
            const auto* __restrict column_raw_data =
221
215
                    assert_cast<const ColumnType*, TypeCheckOnRelease::DISABLE>(
222
215
                            then_columns[i].get())
223
215
                            ->get_data()
224
215
                            .data();
225
            if constexpr (std::is_same_v<ColumnType, ColumnDate> ||
226
                          std::is_same_v<ColumnType, ColumnDateTime> ||
227
                          std::is_same_v<ColumnType, ColumnDateV2> ||
228
                          std::is_same_v<ColumnType, ColumnDateTimeV2> ||
229
                          std::is_same_v<ColumnType, ColumnTimeStampTz>) {
230
                for (int row_idx = 0; row_idx < rows_count; row_idx++) {
231
                    result_raw_data[row_idx] = (then_idx[row_idx] == i) ? column_raw_data[row_idx]
232
                                                                        : result_raw_data[row_idx];
233
                }
234
215
            } else {
235
813
                for (int row_idx = 0; row_idx < rows_count; row_idx++) {
236
598
                    result_raw_data[row_idx] +=
237
598
                            typename ColumnType::value_type(then_idx[row_idx] == i) *
238
598
                            column_raw_data[row_idx];
239
598
                }
240
215
            }
241
215
        }
242
146
    }
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
192
68
                                 std::vector<ColumnPtr>& then_columns, size_t rows_count) const {
193
164
        for (auto& then_ptr : then_columns) {
194
164
            then_ptr = then_ptr->convert_to_full_column_if_const();
195
164
        }
196
197
68
        result_column_ptr->resize(rows_count);
198
68
        auto* __restrict result_raw_data =
199
68
                assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(result_column_ptr.get())
200
68
                        ->get_data()
201
68
                        .data();
202
203
        // set default value
204
184
        for (int i = 0; i < rows_count; i++) {
205
            if constexpr (std::is_same_v<ColumnType, ColumnDate> ||
206
                          std::is_same_v<ColumnType, ColumnDateTime> ||
207
                          std::is_same_v<ColumnType, ColumnDateV2> ||
208
                          std::is_same_v<ColumnType, ColumnDateTimeV2> ||
209
                          std::is_same_v<ColumnType, ColumnTimeStampTz>) {
210
                result_raw_data[i] = ColumnType::default_value();
211
116
            } else {
212
116
                result_raw_data[i] = {};
213
116
            }
214
116
        }
215
216
232
        for (IndexType i = 0; i < then_columns.size(); i++) {
217
164
            if (!then_columns[i]) {
218
0
                continue;
219
0
            }
220
164
            const auto* __restrict column_raw_data =
221
164
                    assert_cast<const ColumnType*, TypeCheckOnRelease::DISABLE>(
222
164
                            then_columns[i].get())
223
164
                            ->get_data()
224
164
                            .data();
225
            if constexpr (std::is_same_v<ColumnType, ColumnDate> ||
226
                          std::is_same_v<ColumnType, ColumnDateTime> ||
227
                          std::is_same_v<ColumnType, ColumnDateV2> ||
228
                          std::is_same_v<ColumnType, ColumnDateTimeV2> ||
229
                          std::is_same_v<ColumnType, ColumnTimeStampTz>) {
230
                for (int row_idx = 0; row_idx < rows_count; row_idx++) {
231
                    result_raw_data[row_idx] = (then_idx[row_idx] == i) ? column_raw_data[row_idx]
232
                                                                        : result_raw_data[row_idx];
233
                }
234
164
            } else {
235
468
                for (int row_idx = 0; row_idx < rows_count; row_idx++) {
236
304
                    result_raw_data[row_idx] +=
237
304
                            typename ColumnType::value_type(then_idx[row_idx] == i) *
238
304
                            column_raw_data[row_idx];
239
304
                }
240
164
            }
241
164
        }
242
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
192
2
                                 std::vector<ColumnPtr>& then_columns, size_t rows_count) const {
193
6
        for (auto& then_ptr : then_columns) {
194
6
            then_ptr = then_ptr->convert_to_full_column_if_const();
195
6
        }
196
197
2
        result_column_ptr->resize(rows_count);
198
2
        auto* __restrict result_raw_data =
199
2
                assert_cast<ColumnType*, TypeCheckOnRelease::DISABLE>(result_column_ptr.get())
200
2
                        ->get_data()
201
2
                        .data();
202
203
        // set default value
204
12
        for (int i = 0; i < rows_count; i++) {
205
            if constexpr (std::is_same_v<ColumnType, ColumnDate> ||
206
                          std::is_same_v<ColumnType, ColumnDateTime> ||
207
                          std::is_same_v<ColumnType, ColumnDateV2> ||
208
                          std::is_same_v<ColumnType, ColumnDateTimeV2> ||
209
10
                          std::is_same_v<ColumnType, ColumnTimeStampTz>) {
210
10
                result_raw_data[i] = ColumnType::default_value();
211
            } else {
212
                result_raw_data[i] = {};
213
            }
214
10
        }
215
216
8
        for (IndexType i = 0; i < then_columns.size(); i++) {
217
6
            if (!then_columns[i]) {
218
0
                continue;
219
0
            }
220
6
            const auto* __restrict column_raw_data =
221
6
                    assert_cast<const ColumnType*, TypeCheckOnRelease::DISABLE>(
222
6
                            then_columns[i].get())
223
6
                            ->get_data()
224
6
                            .data();
225
            if constexpr (std::is_same_v<ColumnType, ColumnDate> ||
226
                          std::is_same_v<ColumnType, ColumnDateTime> ||
227
                          std::is_same_v<ColumnType, ColumnDateV2> ||
228
                          std::is_same_v<ColumnType, ColumnDateTimeV2> ||
229
6
                          std::is_same_v<ColumnType, ColumnTimeStampTz>) {
230
36
                for (int row_idx = 0; row_idx < rows_count; row_idx++) {
231
30
                    result_raw_data[row_idx] = (then_idx[row_idx] == i) ? column_raw_data[row_idx]
232
30
                                                                        : result_raw_data[row_idx];
233
30
                }
234
            } else {
235
                for (int row_idx = 0; row_idx < rows_count; row_idx++) {
236
                    result_raw_data[row_idx] +=
237
                            typename ColumnType::value_type(then_idx[row_idx] == i) *
238
                            column_raw_data[row_idx];
239
                }
240
            }
241
6
        }
242
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
243
244
    template <typename IndexType>
245
    ColumnPtr _execute_impl(const std::vector<ColumnPtr>& when_columns,
246
1.93k
                            std::vector<ColumnPtr>& then_columns, size_t rows_count) const {
247
1.93k
        std::vector<IndexType> then_idx(rows_count, 0);
248
1.93k
        IndexType* __restrict then_idx_ptr = then_idx.data();
249
3.07k
        for (IndexType i = 0; i < when_columns.size(); i++) {
250
1.14k
            IndexType column_idx = i + 1;
251
1.14k
            auto [raw_when_column, is_consts] = unpack_if_const(when_columns[i]);
252
253
1.14k
            if (is_consts) {
254
0
                if (raw_when_column->get_bool(0)) {
255
0
                    for (int row_idx = 0; row_idx < rows_count; row_idx++) {
256
0
                        then_idx_ptr[row_idx] |= (!then_idx_ptr[row_idx]) * column_idx;
257
0
                    }
258
0
                    break;
259
0
                }
260
0
                continue;
261
0
            }
262
263
1.14k
            if (raw_when_column->is_nullable()) {
264
709
                const auto* column_nullable_ptr =
265
709
                        assert_cast<const ColumnNullable*, TypeCheckOnRelease::DISABLE>(
266
709
                                raw_when_column.get());
267
709
                const auto* __restrict cond_raw_data =
268
709
                        assert_cast<const ColumnUInt8*, TypeCheckOnRelease::DISABLE>(
269
709
                                column_nullable_ptr->get_nested_column_ptr().get())
270
709
                                ->get_data()
271
709
                                .data();
272
709
                if (!column_nullable_ptr->has_null()) {
273
1.62k
                    for (int row_idx = 0; row_idx < rows_count; row_idx++) {
274
987
                        then_idx_ptr[row_idx] |=
275
987
                                (!then_idx_ptr[row_idx]) * cond_raw_data[row_idx] * column_idx;
276
987
                    }
277
641
                    continue;
278
641
                }
279
68
                const auto* __restrict cond_raw_nullmap =
280
68
                        column_nullable_ptr->get_null_map_column_ptr()->get_data().data();
281
368
                for (int row_idx = 0; row_idx < rows_count; row_idx++) {
282
300
                    then_idx_ptr[row_idx] |= (!then_idx_ptr[row_idx] * cond_raw_data[row_idx] *
283
300
                                              !cond_raw_nullmap[row_idx]) *
284
300
                                             column_idx;
285
300
                }
286
433
            } else {
287
433
                const auto* __restrict cond_raw_data =
288
433
                        assert_cast<const ColumnUInt8*, TypeCheckOnRelease::DISABLE>(
289
433
                                raw_when_column.get())
290
433
                                ->get_data()
291
433
                                .data();
292
1.00k
                for (int row_idx = 0; row_idx < rows_count; row_idx++) {
293
572
                    then_idx_ptr[row_idx] |=
294
572
                            (!then_idx_ptr[row_idx]) * cond_raw_data[row_idx] * column_idx;
295
572
                }
296
433
            }
297
1.14k
        }
298
299
1.93k
        return _execute_update_result<IndexType>(then_idx_ptr, then_columns, rows_count);
300
1.93k
    }
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
246
1.93k
                            std::vector<ColumnPtr>& then_columns, size_t rows_count) const {
247
1.93k
        std::vector<IndexType> then_idx(rows_count, 0);
248
1.93k
        IndexType* __restrict then_idx_ptr = then_idx.data();
249
3.07k
        for (IndexType i = 0; i < when_columns.size(); i++) {
250
1.14k
            IndexType column_idx = i + 1;
251
1.14k
            auto [raw_when_column, is_consts] = unpack_if_const(when_columns[i]);
252
253
1.14k
            if (is_consts) {
254
0
                if (raw_when_column->get_bool(0)) {
255
0
                    for (int row_idx = 0; row_idx < rows_count; row_idx++) {
256
0
                        then_idx_ptr[row_idx] |= (!then_idx_ptr[row_idx]) * column_idx;
257
0
                    }
258
0
                    break;
259
0
                }
260
0
                continue;
261
0
            }
262
263
1.14k
            if (raw_when_column->is_nullable()) {
264
709
                const auto* column_nullable_ptr =
265
709
                        assert_cast<const ColumnNullable*, TypeCheckOnRelease::DISABLE>(
266
709
                                raw_when_column.get());
267
709
                const auto* __restrict cond_raw_data =
268
709
                        assert_cast<const ColumnUInt8*, TypeCheckOnRelease::DISABLE>(
269
709
                                column_nullable_ptr->get_nested_column_ptr().get())
270
709
                                ->get_data()
271
709
                                .data();
272
709
                if (!column_nullable_ptr->has_null()) {
273
1.62k
                    for (int row_idx = 0; row_idx < rows_count; row_idx++) {
274
987
                        then_idx_ptr[row_idx] |=
275
987
                                (!then_idx_ptr[row_idx]) * cond_raw_data[row_idx] * column_idx;
276
987
                    }
277
641
                    continue;
278
641
                }
279
68
                const auto* __restrict cond_raw_nullmap =
280
68
                        column_nullable_ptr->get_null_map_column_ptr()->get_data().data();
281
368
                for (int row_idx = 0; row_idx < rows_count; row_idx++) {
282
300
                    then_idx_ptr[row_idx] |= (!then_idx_ptr[row_idx] * cond_raw_data[row_idx] *
283
300
                                              !cond_raw_nullmap[row_idx]) *
284
300
                                             column_idx;
285
300
                }
286
433
            } else {
287
433
                const auto* __restrict cond_raw_data =
288
433
                        assert_cast<const ColumnUInt8*, TypeCheckOnRelease::DISABLE>(
289
433
                                raw_when_column.get())
290
433
                                ->get_data()
291
433
                                .data();
292
1.00k
                for (int row_idx = 0; row_idx < rows_count; row_idx++) {
293
572
                    then_idx_ptr[row_idx] |=
294
572
                            (!then_idx_ptr[row_idx]) * cond_raw_data[row_idx] * column_idx;
295
572
                }
296
433
            }
297
1.14k
        }
298
299
1.93k
        return _execute_update_result<IndexType>(then_idx_ptr, then_columns, rows_count);
300
1.93k
    }
301
302
    bool _has_else_expr;
303
304
    inline static const std::string FUNCTION_NAME = "case";
305
    inline static const std::string EXPR_NAME = "vcase expr";
306
};
307
} // namespace doris