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