be/src/exprs/function/array/function_array_index.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 | | // This file is copied from |
18 | | // https://github.com/ClickHouse/ClickHouse/blob/master/src/Functions/array/arrayIndex.h |
19 | | // and modified by Doris |
20 | | #pragma once |
21 | | |
22 | | #include <stddef.h> |
23 | | |
24 | | #include <memory> |
25 | | #include <utility> |
26 | | |
27 | | #include "common/status.h" |
28 | | #include "core/assert_cast.h" |
29 | | #include "core/block/block.h" |
30 | | #include "core/block/column_numbers.h" |
31 | | #include "core/block/column_with_type_and_name.h" |
32 | | #include "core/call_on_type_index.h" |
33 | | #include "core/column/column.h" |
34 | | #include "core/column/column_array.h" |
35 | | #include "core/column/column_array_view.h" |
36 | | #include "core/column/column_nullable.h" |
37 | | #include "core/column/column_string.h" |
38 | | #include "core/column/column_vector.h" |
39 | | #include "core/data_type/data_type.h" |
40 | | #include "core/data_type/data_type_array.h" |
41 | | #include "core/data_type/data_type_nullable.h" |
42 | | #include "core/data_type/data_type_number.h" // IWYU pragma: keep |
43 | | #include "core/data_type/define_primitive_type.h" |
44 | | #include "core/data_type/primitive_type.h" |
45 | | #include "core/field.h" |
46 | | #include "core/string_ref.h" |
47 | | #include "core/types.h" |
48 | | #include "exprs/function/function.h" |
49 | | #include "storage/index/index_reader_helper.h" |
50 | | #include "storage/index/inverted/inverted_index_query_type.h" |
51 | | #include "storage/index/inverted/inverted_index_reader.h" |
52 | | #include "storage/predicate/column_predicate.h" |
53 | | |
54 | | namespace doris { |
55 | | class FunctionContext; |
56 | | } // namespace doris |
57 | | |
58 | | namespace doris { |
59 | | |
60 | | struct ArrayContainsAction { |
61 | | static constexpr auto ResultType = PrimitiveType::TYPE_BOOLEAN; |
62 | | static constexpr auto name = "array_contains"; |
63 | | static constexpr const bool resume_execution = false; |
64 | | static constexpr void apply(typename PrimitiveTypeTraits<ResultType>::CppType& current, |
65 | 13 | size_t) noexcept { |
66 | 13 | current = 1; |
67 | 13 | } |
68 | | }; |
69 | | |
70 | | struct ArrayPositionAction { |
71 | | static constexpr auto ResultType = PrimitiveType::TYPE_BIGINT; |
72 | | static constexpr auto name = "array_position"; |
73 | | static constexpr const bool resume_execution = false; |
74 | | static constexpr void apply(typename PrimitiveTypeTraits<ResultType>::CppType& current, |
75 | 8 | size_t j) noexcept { |
76 | 8 | current = j + 1; |
77 | 8 | } |
78 | | }; |
79 | | |
80 | | struct ArrayCountEqual { |
81 | | static constexpr auto ResultType = PrimitiveType::TYPE_BIGINT; |
82 | | static constexpr auto name = "countequal"; |
83 | | static constexpr const bool resume_execution = true; |
84 | | static constexpr void apply(typename PrimitiveTypeTraits<ResultType>::CppType& current, |
85 | 2 | size_t j) noexcept { |
86 | 2 | ++current; |
87 | 2 | } |
88 | | }; |
89 | | |
90 | | struct ParamValue { |
91 | | PrimitiveType type; |
92 | | Field value; |
93 | | }; |
94 | | |
95 | | template <typename ConcreteAction> |
96 | | class FunctionArrayIndex : public IFunction { |
97 | | public: |
98 | | static constexpr auto ResultType = ConcreteAction::ResultType; |
99 | | |
100 | | static constexpr auto name = ConcreteAction::name; |
101 | 29 | static FunctionPtr create() { return std::make_shared<FunctionArrayIndex>(); }_ZN5doris18FunctionArrayIndexINS_19ArrayContainsActionEE6createEv Line | Count | Source | 101 | 18 | static FunctionPtr create() { return std::make_shared<FunctionArrayIndex>(); } |
_ZN5doris18FunctionArrayIndexINS_19ArrayPositionActionEE6createEv Line | Count | Source | 101 | 8 | static FunctionPtr create() { return std::make_shared<FunctionArrayIndex>(); } |
_ZN5doris18FunctionArrayIndexINS_15ArrayCountEqualEE6createEv Line | Count | Source | 101 | 3 | static FunctionPtr create() { return std::make_shared<FunctionArrayIndex>(); } |
|
102 | | |
103 | | /// Get function name. |
104 | 3 | String get_name() const override { return name; }_ZNK5doris18FunctionArrayIndexINS_19ArrayContainsActionEE8get_nameB5cxx11Ev Line | Count | Source | 104 | 1 | String get_name() const override { return name; } |
_ZNK5doris18FunctionArrayIndexINS_19ArrayPositionActionEE8get_nameB5cxx11Ev Line | Count | Source | 104 | 1 | String get_name() const override { return name; } |
_ZNK5doris18FunctionArrayIndexINS_15ArrayCountEqualEE8get_nameB5cxx11Ev Line | Count | Source | 104 | 1 | String get_name() const override { return name; } |
|
105 | | |
106 | 26 | bool is_variadic() const override { return false; }_ZNK5doris18FunctionArrayIndexINS_19ArrayContainsActionEE11is_variadicEv Line | Count | Source | 106 | 17 | bool is_variadic() const override { return false; } |
_ZNK5doris18FunctionArrayIndexINS_19ArrayPositionActionEE11is_variadicEv Line | Count | Source | 106 | 7 | bool is_variadic() const override { return false; } |
_ZNK5doris18FunctionArrayIndexINS_15ArrayCountEqualEE11is_variadicEv Line | Count | Source | 106 | 2 | bool is_variadic() const override { return false; } |
|
107 | | |
108 | 23 | size_t get_number_of_arguments() const override { return 2; }_ZNK5doris18FunctionArrayIndexINS_19ArrayContainsActionEE23get_number_of_argumentsEv Line | Count | Source | 108 | 16 | size_t get_number_of_arguments() const override { return 2; } |
_ZNK5doris18FunctionArrayIndexINS_19ArrayPositionActionEE23get_number_of_argumentsEv Line | Count | Source | 108 | 6 | size_t get_number_of_arguments() const override { return 2; } |
_ZNK5doris18FunctionArrayIndexINS_15ArrayCountEqualEE23get_number_of_argumentsEv Line | Count | Source | 108 | 1 | size_t get_number_of_arguments() const override { return 2; } |
|
109 | | |
110 | 41 | bool use_default_implementation_for_nulls() const override { return false; }_ZNK5doris18FunctionArrayIndexINS_19ArrayContainsActionEE36use_default_implementation_for_nullsEv Line | Count | Source | 110 | 27 | bool use_default_implementation_for_nulls() const override { return false; } |
_ZNK5doris18FunctionArrayIndexINS_19ArrayPositionActionEE36use_default_implementation_for_nullsEv Line | Count | Source | 110 | 12 | bool use_default_implementation_for_nulls() const override { return false; } |
_ZNK5doris18FunctionArrayIndexINS_15ArrayCountEqualEE36use_default_implementation_for_nullsEv Line | Count | Source | 110 | 2 | bool use_default_implementation_for_nulls() const override { return false; } |
|
111 | | |
112 | 56 | Status open(FunctionContext* context, FunctionContext::FunctionStateScope scope) override { |
113 | 56 | if (scope == FunctionContext::THREAD_LOCAL) { |
114 | 33 | return Status::OK(); |
115 | 33 | } |
116 | | |
117 | 56 | DCHECK(context->get_num_args() >= 1); |
118 | 23 | DCHECK_EQ(context->get_arg_type(0)->get_primitive_type(), PrimitiveType::TYPE_ARRAY); |
119 | | // now we only support same |
120 | 23 | std::shared_ptr<ParamValue> state = std::make_shared<ParamValue>(); |
121 | 23 | Field field; |
122 | 23 | if (context->get_constant_col(1)) { |
123 | 9 | context->get_constant_col(1)->column_ptr->get(0, field); |
124 | 9 | state->value = field; |
125 | 9 | state->type = context->get_arg_type(1)->get_primitive_type(); |
126 | 9 | context->set_function_state(scope, state); |
127 | 9 | } |
128 | 23 | return Status::OK(); |
129 | 56 | } _ZN5doris18FunctionArrayIndexINS_19ArrayContainsActionEE4openEPNS_15FunctionContextENS3_18FunctionStateScopeE Line | Count | Source | 112 | 42 | Status open(FunctionContext* context, FunctionContext::FunctionStateScope scope) override { | 113 | 42 | if (scope == FunctionContext::THREAD_LOCAL) { | 114 | 26 | return Status::OK(); | 115 | 26 | } | 116 | | | 117 | 42 | DCHECK(context->get_num_args() >= 1); | 118 | 16 | DCHECK_EQ(context->get_arg_type(0)->get_primitive_type(), PrimitiveType::TYPE_ARRAY); | 119 | | // now we only support same | 120 | 16 | std::shared_ptr<ParamValue> state = std::make_shared<ParamValue>(); | 121 | 16 | Field field; | 122 | 16 | if (context->get_constant_col(1)) { | 123 | 7 | context->get_constant_col(1)->column_ptr->get(0, field); | 124 | 7 | state->value = field; | 125 | 7 | state->type = context->get_arg_type(1)->get_primitive_type(); | 126 | 7 | context->set_function_state(scope, state); | 127 | 7 | } | 128 | 16 | return Status::OK(); | 129 | 42 | } |
_ZN5doris18FunctionArrayIndexINS_19ArrayPositionActionEE4openEPNS_15FunctionContextENS3_18FunctionStateScopeE Line | Count | Source | 112 | 12 | Status open(FunctionContext* context, FunctionContext::FunctionStateScope scope) override { | 113 | 12 | if (scope == FunctionContext::THREAD_LOCAL) { | 114 | 6 | return Status::OK(); | 115 | 6 | } | 116 | | | 117 | 12 | DCHECK(context->get_num_args() >= 1); | 118 | 6 | DCHECK_EQ(context->get_arg_type(0)->get_primitive_type(), PrimitiveType::TYPE_ARRAY); | 119 | | // now we only support same | 120 | 6 | std::shared_ptr<ParamValue> state = std::make_shared<ParamValue>(); | 121 | 6 | Field field; | 122 | 6 | if (context->get_constant_col(1)) { | 123 | 1 | context->get_constant_col(1)->column_ptr->get(0, field); | 124 | 1 | state->value = field; | 125 | 1 | state->type = context->get_arg_type(1)->get_primitive_type(); | 126 | 1 | context->set_function_state(scope, state); | 127 | 1 | } | 128 | 6 | return Status::OK(); | 129 | 12 | } |
_ZN5doris18FunctionArrayIndexINS_15ArrayCountEqualEE4openEPNS_15FunctionContextENS3_18FunctionStateScopeE Line | Count | Source | 112 | 2 | Status open(FunctionContext* context, FunctionContext::FunctionStateScope scope) override { | 113 | 2 | if (scope == FunctionContext::THREAD_LOCAL) { | 114 | 1 | return Status::OK(); | 115 | 1 | } | 116 | | | 117 | 2 | DCHECK(context->get_num_args() >= 1); | 118 | 1 | DCHECK_EQ(context->get_arg_type(0)->get_primitive_type(), PrimitiveType::TYPE_ARRAY); | 119 | | // now we only support same | 120 | 1 | std::shared_ptr<ParamValue> state = std::make_shared<ParamValue>(); | 121 | 1 | Field field; | 122 | 1 | if (context->get_constant_col(1)) { | 123 | 1 | context->get_constant_col(1)->column_ptr->get(0, field); | 124 | 1 | state->value = field; | 125 | 1 | state->type = context->get_arg_type(1)->get_primitive_type(); | 126 | 1 | context->set_function_state(scope, state); | 127 | 1 | } | 128 | 1 | return Status::OK(); | 129 | 2 | } |
|
130 | | |
131 | | Status evaluate_inverted_index( |
132 | | const ColumnsWithTypeAndName& arguments, |
133 | | const std::vector<IndexFieldNameAndTypePair>& data_type_with_names, |
134 | | std::vector<segment_v2::IndexIterator*> iterators, uint32_t num_rows, |
135 | | const InvertedIndexAnalyzerCtx* analyzer_ctx, |
136 | 8 | segment_v2::InvertedIndexResultBitmap& bitmap_result) const override { |
137 | 8 | DCHECK(arguments.size() == 1); |
138 | 8 | DCHECK(data_type_with_names.size() == 1); |
139 | 8 | DCHECK(iterators.size() == 1); |
140 | 8 | auto* iter = iterators[0]; |
141 | 8 | auto data_type_with_name = data_type_with_names[0]; |
142 | 8 | if (iter == nullptr) { |
143 | 0 | return Status::OK(); |
144 | 0 | } |
145 | 8 | if (!segment_v2::IndexReaderHelper::has_string_or_bkd_index(iter)) { |
146 | | // parser is not none we can not make sure the result is correct in expr combination |
147 | | // for example, filter: !array_index(array, 'tall:120cm, weight: 35kg') |
148 | | // here we have rows [tall:120cm, weight: 35kg, hobbies: reading book] which be tokenized |
149 | | // but query is also tokenized, and FULLTEXT reader will catch this row as matched, |
150 | | // so array_index(array, 'tall:120cm, weight: 35kg') return this rowid, |
151 | | // but we expect it to be filtered, because we want row is equal to 'tall:120cm, weight: 35kg' |
152 | 0 | return Status::OK(); |
153 | 0 | } |
154 | 8 | Field param_value; |
155 | 8 | arguments[0].column->get(0, param_value); |
156 | | // The current implementation for the inverted index of arrays cannot handle cases where the array contains null values, |
157 | | // meaning an item in the array is null. |
158 | 8 | if (param_value.is_null()) { |
159 | 0 | return Status::OK(); |
160 | 0 | } |
161 | | |
162 | 8 | std::shared_ptr<roaring::Roaring> null_bitmap = std::make_shared<roaring::Roaring>(); |
163 | 8 | if (iter->has_null()) { |
164 | 8 | segment_v2::InvertedIndexQueryCacheHandle null_bitmap_cache_handle; |
165 | 8 | RETURN_IF_ERROR(iter->read_null_bitmap(&null_bitmap_cache_handle)); |
166 | 8 | null_bitmap = null_bitmap_cache_handle.get_bitmap(); |
167 | 8 | } |
168 | 8 | InvertedIndexParam param; |
169 | 8 | param.column_name = data_type_with_name.first; |
170 | 8 | param.column_type = data_type_with_name.second; |
171 | 8 | param.query_value = param_value; |
172 | 8 | param.query_type = segment_v2::InvertedIndexQueryType::EQUAL_QUERY; |
173 | 8 | param.num_rows = num_rows; |
174 | 8 | param.roaring = std::make_shared<roaring::Roaring>(); |
175 | 8 | param.analyzer_ctx = analyzer_ctx; |
176 | 8 | RETURN_IF_ERROR(iter->read_from_index(segment_v2::IndexParam {¶m})); |
177 | | // here debug for check array_contains function really filter rows by inverted index correctly |
178 | 8 | DBUG_EXECUTE_IF("array_func.array_contains", { |
179 | 8 | auto result_bitmap = DebugPoints::instance()->get_debug_param_or_default<int32_t>( |
180 | 8 | "array_func.array_contains", "result_bitmap", 0); |
181 | 8 | if (result_bitmap < 0) { |
182 | 8 | return Status::Error<ErrorCode::INTERNAL_ERROR>( |
183 | 8 | "result_bitmap count cannot be negative"); |
184 | 8 | } |
185 | 8 | if (param.roaring->cardinality() != result_bitmap) { |
186 | 8 | return Status::Error<ErrorCode::INTERNAL_ERROR>( |
187 | 8 | "array_contains really filtered {} by inverted index not equal to expected " |
188 | 8 | "{}", |
189 | 8 | param.roaring->cardinality(), result_bitmap); |
190 | 8 | } |
191 | 8 | }) |
192 | 8 | segment_v2::InvertedIndexResultBitmap result(param.roaring, null_bitmap); |
193 | 8 | bitmap_result = result; |
194 | 8 | bitmap_result.mask_out_null(); |
195 | | |
196 | 8 | return Status::OK(); |
197 | 8 | } _ZNK5doris18FunctionArrayIndexINS_19ArrayContainsActionEE23evaluate_inverted_indexERKSt6vectorINS_21ColumnWithTypeAndNameESaIS4_EERKS3_ISt4pairINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt10shared_ptrIKNS_9IDataTypeEEESaISK_EES3_IPNS_10segment_v213IndexIteratorESaISR_EEjPKNS_24InvertedIndexAnalyzerCtxERNSP_25InvertedIndexResultBitmapE Line | Count | Source | 136 | 8 | segment_v2::InvertedIndexResultBitmap& bitmap_result) const override { | 137 | 8 | DCHECK(arguments.size() == 1); | 138 | 8 | DCHECK(data_type_with_names.size() == 1); | 139 | 8 | DCHECK(iterators.size() == 1); | 140 | 8 | auto* iter = iterators[0]; | 141 | 8 | auto data_type_with_name = data_type_with_names[0]; | 142 | 8 | if (iter == nullptr) { | 143 | 0 | return Status::OK(); | 144 | 0 | } | 145 | 8 | if (!segment_v2::IndexReaderHelper::has_string_or_bkd_index(iter)) { | 146 | | // parser is not none we can not make sure the result is correct in expr combination | 147 | | // for example, filter: !array_index(array, 'tall:120cm, weight: 35kg') | 148 | | // here we have rows [tall:120cm, weight: 35kg, hobbies: reading book] which be tokenized | 149 | | // but query is also tokenized, and FULLTEXT reader will catch this row as matched, | 150 | | // so array_index(array, 'tall:120cm, weight: 35kg') return this rowid, | 151 | | // but we expect it to be filtered, because we want row is equal to 'tall:120cm, weight: 35kg' | 152 | 0 | return Status::OK(); | 153 | 0 | } | 154 | 8 | Field param_value; | 155 | 8 | arguments[0].column->get(0, param_value); | 156 | | // The current implementation for the inverted index of arrays cannot handle cases where the array contains null values, | 157 | | // meaning an item in the array is null. | 158 | 8 | if (param_value.is_null()) { | 159 | 0 | return Status::OK(); | 160 | 0 | } | 161 | | | 162 | 8 | std::shared_ptr<roaring::Roaring> null_bitmap = std::make_shared<roaring::Roaring>(); | 163 | 8 | if (iter->has_null()) { | 164 | 8 | segment_v2::InvertedIndexQueryCacheHandle null_bitmap_cache_handle; | 165 | 8 | RETURN_IF_ERROR(iter->read_null_bitmap(&null_bitmap_cache_handle)); | 166 | 8 | null_bitmap = null_bitmap_cache_handle.get_bitmap(); | 167 | 8 | } | 168 | 8 | InvertedIndexParam param; | 169 | 8 | param.column_name = data_type_with_name.first; | 170 | 8 | param.column_type = data_type_with_name.second; | 171 | 8 | param.query_value = param_value; | 172 | 8 | param.query_type = segment_v2::InvertedIndexQueryType::EQUAL_QUERY; | 173 | 8 | param.num_rows = num_rows; | 174 | 8 | param.roaring = std::make_shared<roaring::Roaring>(); | 175 | 8 | param.analyzer_ctx = analyzer_ctx; | 176 | 8 | RETURN_IF_ERROR(iter->read_from_index(segment_v2::IndexParam {¶m})); | 177 | | // here debug for check array_contains function really filter rows by inverted index correctly | 178 | 8 | DBUG_EXECUTE_IF("array_func.array_contains", { | 179 | 8 | auto result_bitmap = DebugPoints::instance()->get_debug_param_or_default<int32_t>( | 180 | 8 | "array_func.array_contains", "result_bitmap", 0); | 181 | 8 | if (result_bitmap < 0) { | 182 | 8 | return Status::Error<ErrorCode::INTERNAL_ERROR>( | 183 | 8 | "result_bitmap count cannot be negative"); | 184 | 8 | } | 185 | 8 | if (param.roaring->cardinality() != result_bitmap) { | 186 | 8 | return Status::Error<ErrorCode::INTERNAL_ERROR>( | 187 | 8 | "array_contains really filtered {} by inverted index not equal to expected " | 188 | 8 | "{}", | 189 | 8 | param.roaring->cardinality(), result_bitmap); | 190 | 8 | } | 191 | 8 | }) | 192 | 8 | segment_v2::InvertedIndexResultBitmap result(param.roaring, null_bitmap); | 193 | 8 | bitmap_result = result; | 194 | 8 | bitmap_result.mask_out_null(); | 195 | | | 196 | 8 | return Status::OK(); | 197 | 8 | } |
Unexecuted instantiation: _ZNK5doris18FunctionArrayIndexINS_19ArrayPositionActionEE23evaluate_inverted_indexERKSt6vectorINS_21ColumnWithTypeAndNameESaIS4_EERKS3_ISt4pairINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt10shared_ptrIKNS_9IDataTypeEEESaISK_EES3_IPNS_10segment_v213IndexIteratorESaISR_EEjPKNS_24InvertedIndexAnalyzerCtxERNSP_25InvertedIndexResultBitmapE Unexecuted instantiation: _ZNK5doris18FunctionArrayIndexINS_15ArrayCountEqualEE23evaluate_inverted_indexERKSt6vectorINS_21ColumnWithTypeAndNameESaIS4_EERKS3_ISt4pairINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt10shared_ptrIKNS_9IDataTypeEEESaISK_EES3_IPNS_10segment_v213IndexIteratorESaISR_EEjPKNS_24InvertedIndexAnalyzerCtxERNSP_25InvertedIndexResultBitmapE |
198 | | |
199 | 23 | DataTypePtr get_return_type_impl(const DataTypes& arguments) const override { |
200 | 23 | if (arguments[0]->is_nullable()) { |
201 | 23 | return make_nullable( |
202 | 23 | std::make_shared<typename PrimitiveTypeTraits<ResultType>::DataType>()); |
203 | 23 | } else { |
204 | 0 | return std::make_shared<typename PrimitiveTypeTraits<ResultType>::DataType>(); |
205 | 0 | } |
206 | 23 | } _ZNK5doris18FunctionArrayIndexINS_19ArrayContainsActionEE20get_return_type_implERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE Line | Count | Source | 199 | 16 | DataTypePtr get_return_type_impl(const DataTypes& arguments) const override { | 200 | 16 | if (arguments[0]->is_nullable()) { | 201 | 16 | return make_nullable( | 202 | 16 | std::make_shared<typename PrimitiveTypeTraits<ResultType>::DataType>()); | 203 | 16 | } else { | 204 | 0 | return std::make_shared<typename PrimitiveTypeTraits<ResultType>::DataType>(); | 205 | 0 | } | 206 | 16 | } |
_ZNK5doris18FunctionArrayIndexINS_19ArrayPositionActionEE20get_return_type_implERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE Line | Count | Source | 199 | 6 | DataTypePtr get_return_type_impl(const DataTypes& arguments) const override { | 200 | 6 | if (arguments[0]->is_nullable()) { | 201 | 6 | return make_nullable( | 202 | 6 | std::make_shared<typename PrimitiveTypeTraits<ResultType>::DataType>()); | 203 | 6 | } else { | 204 | 0 | return std::make_shared<typename PrimitiveTypeTraits<ResultType>::DataType>(); | 205 | 0 | } | 206 | 6 | } |
_ZNK5doris18FunctionArrayIndexINS_15ArrayCountEqualEE20get_return_type_implERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE Line | Count | Source | 199 | 1 | DataTypePtr get_return_type_impl(const DataTypes& arguments) const override { | 200 | 1 | if (arguments[0]->is_nullable()) { | 201 | 1 | return make_nullable( | 202 | 1 | std::make_shared<typename PrimitiveTypeTraits<ResultType>::DataType>()); | 203 | 1 | } else { | 204 | 0 | return std::make_shared<typename PrimitiveTypeTraits<ResultType>::DataType>(); | 205 | 0 | } | 206 | 1 | } |
|
207 | | |
208 | | Status execute_impl(FunctionContext* context, Block& block, const ColumnNumbers& arguments, |
209 | 18 | uint32_t result, size_t input_rows_count) const override { |
210 | 18 | DBUG_EXECUTE_IF("array_func.array_contains", { |
211 | 18 | auto req_id = DebugPoints::instance()->get_debug_param_or_default<int32_t>( |
212 | 18 | "array_func.array_contains", "req_id", 0); |
213 | 18 | return Status::Error<ErrorCode::INTERNAL_ERROR>( |
214 | 18 | "{} has already execute inverted index req_id {} , should not execute expr " |
215 | 18 | "with rows: {}", |
216 | 18 | get_name(), req_id, input_rows_count); |
217 | 18 | }); |
218 | 18 | return _execute_dispatch(block, arguments, result, input_rows_count); |
219 | 18 | } _ZNK5doris18FunctionArrayIndexINS_19ArrayContainsActionEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjm Line | Count | Source | 209 | 11 | uint32_t result, size_t input_rows_count) const override { | 210 | 11 | DBUG_EXECUTE_IF("array_func.array_contains", { | 211 | 11 | auto req_id = DebugPoints::instance()->get_debug_param_or_default<int32_t>( | 212 | 11 | "array_func.array_contains", "req_id", 0); | 213 | 11 | return Status::Error<ErrorCode::INTERNAL_ERROR>( | 214 | 11 | "{} has already execute inverted index req_id {} , should not execute expr " | 215 | 11 | "with rows: {}", | 216 | 11 | get_name(), req_id, input_rows_count); | 217 | 11 | }); | 218 | 11 | return _execute_dispatch(block, arguments, result, input_rows_count); | 219 | 11 | } |
_ZNK5doris18FunctionArrayIndexINS_19ArrayPositionActionEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjm Line | Count | Source | 209 | 6 | uint32_t result, size_t input_rows_count) const override { | 210 | 6 | DBUG_EXECUTE_IF("array_func.array_contains", { | 211 | 6 | auto req_id = DebugPoints::instance()->get_debug_param_or_default<int32_t>( | 212 | 6 | "array_func.array_contains", "req_id", 0); | 213 | 6 | return Status::Error<ErrorCode::INTERNAL_ERROR>( | 214 | 6 | "{} has already execute inverted index req_id {} , should not execute expr " | 215 | 6 | "with rows: {}", | 216 | 6 | get_name(), req_id, input_rows_count); | 217 | 6 | }); | 218 | 6 | return _execute_dispatch(block, arguments, result, input_rows_count); | 219 | 6 | } |
_ZNK5doris18FunctionArrayIndexINS_15ArrayCountEqualEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjm Line | Count | Source | 209 | 1 | uint32_t result, size_t input_rows_count) const override { | 210 | 1 | DBUG_EXECUTE_IF("array_func.array_contains", { | 211 | 1 | auto req_id = DebugPoints::instance()->get_debug_param_or_default<int32_t>( | 212 | 1 | "array_func.array_contains", "req_id", 0); | 213 | 1 | return Status::Error<ErrorCode::INTERNAL_ERROR>( | 214 | 1 | "{} has already execute inverted index req_id {} , should not execute expr " | 215 | 1 | "with rows: {}", | 216 | 1 | get_name(), req_id, input_rows_count); | 217 | 1 | }); | 218 | 1 | return _execute_dispatch(block, arguments, result, input_rows_count); | 219 | 1 | } |
|
220 | | |
221 | | private: |
222 | | template <PrimitiveType PType> |
223 | | ColumnPtr _execute_view(const ColumnArrayView<PType>& array_view, |
224 | 18 | const ColumnView<PType>& right_view) const { |
225 | | // prepare return data |
226 | 18 | auto dst = PrimitiveTypeTraits<ResultType>::ColumnType::create(array_view.size(), 0); |
227 | 18 | auto& dst_data = dst->get_data(); |
228 | 18 | auto dst_null_column = ColumnUInt8::create(array_view.size(), 0); |
229 | 18 | auto& dst_null_data = dst_null_column->get_data(); |
230 | | |
231 | | // process |
232 | 103 | for (size_t row = 0; row < array_view.size(); ++row) { |
233 | 64 | if (array_view.is_null_at(row)) { |
234 | 16 | dst_null_data[row] = true; |
235 | 16 | continue; |
236 | 16 | } |
237 | 48 | dst_null_data[row] = false; |
238 | 48 | typename PrimitiveTypeTraits<ResultType>::CppType res = 0; |
239 | 48 | const auto array_data = array_view[row]; |
240 | 126 | for (size_t pos = 0; pos < array_data.size(); ++pos) { |
241 | | // match null value |
242 | 78 | if (right_view.is_null_at(row) && array_data.is_null_at(pos)) { |
243 | 1 | ConcreteAction::apply(res, pos); |
244 | 1 | if constexpr (!ConcreteAction::resume_execution) { |
245 | 1 | break; |
246 | 1 | } |
247 | 1 | } |
248 | | // some is null while another is not |
249 | 78 | if (right_view.is_null_at(row) != array_data.is_null_at(pos)) { |
250 | 3 | continue; |
251 | 3 | } |
252 | 75 | if (array_data.is_null_at(pos)) { |
253 | 0 | continue; |
254 | 0 | } |
255 | 75 | if (array_data.value_at(pos) == right_view.value_at(row)) { |
256 | 22 | ConcreteAction::apply(res, pos); |
257 | 22 | if constexpr (!ConcreteAction::resume_execution) { |
258 | 20 | break; |
259 | 20 | } |
260 | 22 | } |
261 | 75 | } |
262 | 68 | dst_data[row] = res; |
263 | 68 | } |
264 | | |
265 | 39 | if (!array_view.is_nullable()) { |
266 | 0 | return dst; |
267 | 0 | } |
268 | 39 | return ColumnNullable::create(std::move(dst), std::move(dst_null_column)); |
269 | 38 | } Unexecuted instantiation: _ZNK5doris18FunctionArrayIndexINS_19ArrayContainsActionEE13_execute_viewILNS_13PrimitiveTypeE2EEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EERKNS_15ColumnArrayViewIXT_EEERKNS_10ColumnViewIXT_EEE _ZNK5doris18FunctionArrayIndexINS_19ArrayContainsActionEE13_execute_viewILNS_13PrimitiveTypeE3EEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EERKNS_15ColumnArrayViewIXT_EEERKNS_10ColumnViewIXT_EEE Line | Count | Source | 224 | 1 | const ColumnView<PType>& right_view) const { | 225 | | // prepare return data | 226 | 1 | auto dst = PrimitiveTypeTraits<ResultType>::ColumnType::create(array_view.size(), 0); | 227 | 1 | auto& dst_data = dst->get_data(); | 228 | 1 | auto dst_null_column = ColumnUInt8::create(array_view.size(), 0); | 229 | 1 | auto& dst_null_data = dst_null_column->get_data(); | 230 | | | 231 | | // process | 232 | 6 | for (size_t row = 0; row < array_view.size(); ++row) { | 233 | 4 | if (array_view.is_null_at(row)) { | 234 | 1 | dst_null_data[row] = true; | 235 | 1 | continue; | 236 | 1 | } | 237 | 3 | dst_null_data[row] = false; | 238 | 3 | typename PrimitiveTypeTraits<ResultType>::CppType res = 0; | 239 | 3 | const auto array_data = array_view[row]; | 240 | 8 | for (size_t pos = 0; pos < array_data.size(); ++pos) { | 241 | | // match null value | 242 | 5 | if (right_view.is_null_at(row) && array_data.is_null_at(pos)) { | 243 | 0 | ConcreteAction::apply(res, pos); | 244 | 0 | if constexpr (!ConcreteAction::resume_execution) { | 245 | 0 | break; | 246 | 0 | } | 247 | 0 | } | 248 | | // some is null while another is not | 249 | 5 | if (right_view.is_null_at(row) != array_data.is_null_at(pos)) { | 250 | 0 | continue; | 251 | 0 | } | 252 | 5 | if (array_data.is_null_at(pos)) { | 253 | 0 | continue; | 254 | 0 | } | 255 | 5 | if (array_data.value_at(pos) == right_view.value_at(row)) { | 256 | 1 | ConcreteAction::apply(res, pos); | 257 | 1 | if constexpr (!ConcreteAction::resume_execution) { | 258 | 1 | break; | 259 | 1 | } | 260 | 1 | } | 261 | 5 | } | 262 | 4 | dst_data[row] = res; | 263 | 4 | } | 264 | | | 265 | 2 | if (!array_view.is_nullable()) { | 266 | 0 | return dst; | 267 | 0 | } | 268 | 2 | return ColumnNullable::create(std::move(dst), std::move(dst_null_column)); | 269 | 2 | } |
Unexecuted instantiation: _ZNK5doris18FunctionArrayIndexINS_19ArrayContainsActionEE13_execute_viewILNS_13PrimitiveTypeE4EEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EERKNS_15ColumnArrayViewIXT_EEERKNS_10ColumnViewIXT_EEE _ZNK5doris18FunctionArrayIndexINS_19ArrayContainsActionEE13_execute_viewILNS_13PrimitiveTypeE5EEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EERKNS_15ColumnArrayViewIXT_EEERKNS_10ColumnViewIXT_EEE Line | Count | Source | 224 | 2 | const ColumnView<PType>& right_view) const { | 225 | | // prepare return data | 226 | 2 | auto dst = PrimitiveTypeTraits<ResultType>::ColumnType::create(array_view.size(), 0); | 227 | 2 | auto& dst_data = dst->get_data(); | 228 | 2 | auto dst_null_column = ColumnUInt8::create(array_view.size(), 0); | 229 | 2 | auto& dst_null_data = dst_null_column->get_data(); | 230 | | | 231 | | // process | 232 | 9 | for (size_t row = 0; row < array_view.size(); ++row) { | 233 | 5 | if (array_view.is_null_at(row)) { | 234 | 1 | dst_null_data[row] = true; | 235 | 1 | continue; | 236 | 1 | } | 237 | 4 | dst_null_data[row] = false; | 238 | 4 | typename PrimitiveTypeTraits<ResultType>::CppType res = 0; | 239 | 4 | const auto array_data = array_view[row]; | 240 | 10 | for (size_t pos = 0; pos < array_data.size(); ++pos) { | 241 | | // match null value | 242 | 6 | if (right_view.is_null_at(row) && array_data.is_null_at(pos)) { | 243 | 0 | ConcreteAction::apply(res, pos); | 244 | 0 | if constexpr (!ConcreteAction::resume_execution) { | 245 | 0 | break; | 246 | 0 | } | 247 | 0 | } | 248 | | // some is null while another is not | 249 | 6 | if (right_view.is_null_at(row) != array_data.is_null_at(pos)) { | 250 | 0 | continue; | 251 | 0 | } | 252 | 6 | if (array_data.is_null_at(pos)) { | 253 | 0 | continue; | 254 | 0 | } | 255 | 6 | if (array_data.value_at(pos) == right_view.value_at(row)) { | 256 | 2 | ConcreteAction::apply(res, pos); | 257 | 2 | if constexpr (!ConcreteAction::resume_execution) { | 258 | 2 | break; | 259 | 2 | } | 260 | 2 | } | 261 | 6 | } | 262 | 6 | dst_data[row] = res; | 263 | 6 | } | 264 | | | 265 | 4 | if (!array_view.is_nullable()) { | 266 | 0 | return dst; | 267 | 0 | } | 268 | 4 | return ColumnNullable::create(std::move(dst), std::move(dst_null_column)); | 269 | 4 | } |
_ZNK5doris18FunctionArrayIndexINS_19ArrayContainsActionEE13_execute_viewILNS_13PrimitiveTypeE6EEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EERKNS_15ColumnArrayViewIXT_EEERKNS_10ColumnViewIXT_EEE Line | Count | Source | 224 | 1 | const ColumnView<PType>& right_view) const { | 225 | | // prepare return data | 226 | 1 | auto dst = PrimitiveTypeTraits<ResultType>::ColumnType::create(array_view.size(), 0); | 227 | 1 | auto& dst_data = dst->get_data(); | 228 | 1 | auto dst_null_column = ColumnUInt8::create(array_view.size(), 0); | 229 | 1 | auto& dst_null_data = dst_null_column->get_data(); | 230 | | | 231 | | // process | 232 | 6 | for (size_t row = 0; row < array_view.size(); ++row) { | 233 | 4 | if (array_view.is_null_at(row)) { | 234 | 1 | dst_null_data[row] = true; | 235 | 1 | continue; | 236 | 1 | } | 237 | 3 | dst_null_data[row] = false; | 238 | 3 | typename PrimitiveTypeTraits<ResultType>::CppType res = 0; | 239 | 3 | const auto array_data = array_view[row]; | 240 | 8 | for (size_t pos = 0; pos < array_data.size(); ++pos) { | 241 | | // match null value | 242 | 5 | if (right_view.is_null_at(row) && array_data.is_null_at(pos)) { | 243 | 0 | ConcreteAction::apply(res, pos); | 244 | 0 | if constexpr (!ConcreteAction::resume_execution) { | 245 | 0 | break; | 246 | 0 | } | 247 | 0 | } | 248 | | // some is null while another is not | 249 | 5 | if (right_view.is_null_at(row) != array_data.is_null_at(pos)) { | 250 | 0 | continue; | 251 | 0 | } | 252 | 5 | if (array_data.is_null_at(pos)) { | 253 | 0 | continue; | 254 | 0 | } | 255 | 5 | if (array_data.value_at(pos) == right_view.value_at(row)) { | 256 | 1 | ConcreteAction::apply(res, pos); | 257 | 1 | if constexpr (!ConcreteAction::resume_execution) { | 258 | 1 | break; | 259 | 1 | } | 260 | 1 | } | 261 | 5 | } | 262 | 4 | dst_data[row] = res; | 263 | 4 | } | 264 | | | 265 | 2 | if (!array_view.is_nullable()) { | 266 | 0 | return dst; | 267 | 0 | } | 268 | 2 | return ColumnNullable::create(std::move(dst), std::move(dst_null_column)); | 269 | 2 | } |
_ZNK5doris18FunctionArrayIndexINS_19ArrayContainsActionEE13_execute_viewILNS_13PrimitiveTypeE7EEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EERKNS_15ColumnArrayViewIXT_EEERKNS_10ColumnViewIXT_EEE Line | Count | Source | 224 | 1 | const ColumnView<PType>& right_view) const { | 225 | | // prepare return data | 226 | 1 | auto dst = PrimitiveTypeTraits<ResultType>::ColumnType::create(array_view.size(), 0); | 227 | 1 | auto& dst_data = dst->get_data(); | 228 | 1 | auto dst_null_column = ColumnUInt8::create(array_view.size(), 0); | 229 | 1 | auto& dst_null_data = dst_null_column->get_data(); | 230 | | | 231 | | // process | 232 | 6 | for (size_t row = 0; row < array_view.size(); ++row) { | 233 | 4 | if (array_view.is_null_at(row)) { | 234 | 1 | dst_null_data[row] = true; | 235 | 1 | continue; | 236 | 1 | } | 237 | 3 | dst_null_data[row] = false; | 238 | 3 | typename PrimitiveTypeTraits<ResultType>::CppType res = 0; | 239 | 3 | const auto array_data = array_view[row]; | 240 | 7 | for (size_t pos = 0; pos < array_data.size(); ++pos) { | 241 | | // match null value | 242 | 4 | if (right_view.is_null_at(row) && array_data.is_null_at(pos)) { | 243 | 0 | ConcreteAction::apply(res, pos); | 244 | 0 | if constexpr (!ConcreteAction::resume_execution) { | 245 | 0 | break; | 246 | 0 | } | 247 | 0 | } | 248 | | // some is null while another is not | 249 | 4 | if (right_view.is_null_at(row) != array_data.is_null_at(pos)) { | 250 | 0 | continue; | 251 | 0 | } | 252 | 4 | if (array_data.is_null_at(pos)) { | 253 | 0 | continue; | 254 | 0 | } | 255 | 4 | if (array_data.value_at(pos) == right_view.value_at(row)) { | 256 | 1 | ConcreteAction::apply(res, pos); | 257 | 1 | if constexpr (!ConcreteAction::resume_execution) { | 258 | 1 | break; | 259 | 1 | } | 260 | 1 | } | 261 | 4 | } | 262 | 4 | dst_data[row] = res; | 263 | 4 | } | 264 | | | 265 | 2 | if (!array_view.is_nullable()) { | 266 | 0 | return dst; | 267 | 0 | } | 268 | 2 | return ColumnNullable::create(std::move(dst), std::move(dst_null_column)); | 269 | 2 | } |
_ZNK5doris18FunctionArrayIndexINS_19ArrayContainsActionEE13_execute_viewILNS_13PrimitiveTypeE8EEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EERKNS_15ColumnArrayViewIXT_EEERKNS_10ColumnViewIXT_EEE Line | Count | Source | 224 | 1 | const ColumnView<PType>& right_view) const { | 225 | | // prepare return data | 226 | 1 | auto dst = PrimitiveTypeTraits<ResultType>::ColumnType::create(array_view.size(), 0); | 227 | 1 | auto& dst_data = dst->get_data(); | 228 | 1 | auto dst_null_column = ColumnUInt8::create(array_view.size(), 0); | 229 | 1 | auto& dst_null_data = dst_null_column->get_data(); | 230 | | | 231 | | // process | 232 | 6 | for (size_t row = 0; row < array_view.size(); ++row) { | 233 | 4 | if (array_view.is_null_at(row)) { | 234 | 1 | dst_null_data[row] = true; | 235 | 1 | continue; | 236 | 1 | } | 237 | 3 | dst_null_data[row] = false; | 238 | 3 | typename PrimitiveTypeTraits<ResultType>::CppType res = 0; | 239 | 3 | const auto array_data = array_view[row]; | 240 | 8 | for (size_t pos = 0; pos < array_data.size(); ++pos) { | 241 | | // match null value | 242 | 5 | if (right_view.is_null_at(row) && array_data.is_null_at(pos)) { | 243 | 0 | ConcreteAction::apply(res, pos); | 244 | 0 | if constexpr (!ConcreteAction::resume_execution) { | 245 | 0 | break; | 246 | 0 | } | 247 | 0 | } | 248 | | // some is null while another is not | 249 | 5 | if (right_view.is_null_at(row) != array_data.is_null_at(pos)) { | 250 | 0 | continue; | 251 | 0 | } | 252 | 5 | if (array_data.is_null_at(pos)) { | 253 | 0 | continue; | 254 | 0 | } | 255 | 5 | if (array_data.value_at(pos) == right_view.value_at(row)) { | 256 | 1 | ConcreteAction::apply(res, pos); | 257 | 1 | if constexpr (!ConcreteAction::resume_execution) { | 258 | 1 | break; | 259 | 1 | } | 260 | 1 | } | 261 | 5 | } | 262 | 4 | dst_data[row] = res; | 263 | 4 | } | 264 | | | 265 | 2 | if (!array_view.is_nullable()) { | 266 | 0 | return dst; | 267 | 0 | } | 268 | 2 | return ColumnNullable::create(std::move(dst), std::move(dst_null_column)); | 269 | 2 | } |
_ZNK5doris18FunctionArrayIndexINS_19ArrayContainsActionEE13_execute_viewILNS_13PrimitiveTypeE9EEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EERKNS_15ColumnArrayViewIXT_EEERKNS_10ColumnViewIXT_EEE Line | Count | Source | 224 | 1 | const ColumnView<PType>& right_view) const { | 225 | | // prepare return data | 226 | 1 | auto dst = PrimitiveTypeTraits<ResultType>::ColumnType::create(array_view.size(), 0); | 227 | 1 | auto& dst_data = dst->get_data(); | 228 | 1 | auto dst_null_column = ColumnUInt8::create(array_view.size(), 0); | 229 | 1 | auto& dst_null_data = dst_null_column->get_data(); | 230 | | | 231 | | // process | 232 | 6 | for (size_t row = 0; row < array_view.size(); ++row) { | 233 | 4 | if (array_view.is_null_at(row)) { | 234 | 1 | dst_null_data[row] = true; | 235 | 1 | continue; | 236 | 1 | } | 237 | 3 | dst_null_data[row] = false; | 238 | 3 | typename PrimitiveTypeTraits<ResultType>::CppType res = 0; | 239 | 3 | const auto array_data = array_view[row]; | 240 | 8 | for (size_t pos = 0; pos < array_data.size(); ++pos) { | 241 | | // match null value | 242 | 5 | if (right_view.is_null_at(row) && array_data.is_null_at(pos)) { | 243 | 0 | ConcreteAction::apply(res, pos); | 244 | 0 | if constexpr (!ConcreteAction::resume_execution) { | 245 | 0 | break; | 246 | 0 | } | 247 | 0 | } | 248 | | // some is null while another is not | 249 | 5 | if (right_view.is_null_at(row) != array_data.is_null_at(pos)) { | 250 | 0 | continue; | 251 | 0 | } | 252 | 5 | if (array_data.is_null_at(pos)) { | 253 | 0 | continue; | 254 | 0 | } | 255 | 5 | if (array_data.value_at(pos) == right_view.value_at(row)) { | 256 | 1 | ConcreteAction::apply(res, pos); | 257 | 1 | if constexpr (!ConcreteAction::resume_execution) { | 258 | 1 | break; | 259 | 1 | } | 260 | 1 | } | 261 | 5 | } | 262 | 4 | dst_data[row] = res; | 263 | 4 | } | 264 | | | 265 | 2 | if (!array_view.is_nullable()) { | 266 | 0 | return dst; | 267 | 0 | } | 268 | 2 | return ColumnNullable::create(std::move(dst), std::move(dst_null_column)); | 269 | 2 | } |
Unexecuted instantiation: _ZNK5doris18FunctionArrayIndexINS_19ArrayContainsActionEE13_execute_viewILNS_13PrimitiveTypeE28EEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EERKNS_15ColumnArrayViewIXT_EEERKNS_10ColumnViewIXT_EEE Unexecuted instantiation: _ZNK5doris18FunctionArrayIndexINS_19ArrayContainsActionEE13_execute_viewILNS_13PrimitiveTypeE29EEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EERKNS_15ColumnArrayViewIXT_EEERKNS_10ColumnViewIXT_EEE _ZNK5doris18FunctionArrayIndexINS_19ArrayContainsActionEE13_execute_viewILNS_13PrimitiveTypeE20EEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EERKNS_15ColumnArrayViewIXT_EEERKNS_10ColumnViewIXT_EEE Line | Count | Source | 224 | 1 | const ColumnView<PType>& right_view) const { | 225 | | // prepare return data | 226 | 1 | auto dst = PrimitiveTypeTraits<ResultType>::ColumnType::create(array_view.size(), 0); | 227 | 1 | auto& dst_data = dst->get_data(); | 228 | 1 | auto dst_null_column = ColumnUInt8::create(array_view.size(), 0); | 229 | 1 | auto& dst_null_data = dst_null_column->get_data(); | 230 | | | 231 | | // process | 232 | 7 | for (size_t row = 0; row < array_view.size(); ++row) { | 233 | 4 | if (array_view.is_null_at(row)) { | 234 | 1 | dst_null_data[row] = true; | 235 | 1 | continue; | 236 | 1 | } | 237 | 3 | dst_null_data[row] = false; | 238 | 3 | typename PrimitiveTypeTraits<ResultType>::CppType res = 0; | 239 | 3 | const auto array_data = array_view[row]; | 240 | 8 | for (size_t pos = 0; pos < array_data.size(); ++pos) { | 241 | | // match null value | 242 | 5 | if (right_view.is_null_at(row) && array_data.is_null_at(pos)) { | 243 | 0 | ConcreteAction::apply(res, pos); | 244 | 0 | if constexpr (!ConcreteAction::resume_execution) { | 245 | 0 | break; | 246 | 0 | } | 247 | 0 | } | 248 | | // some is null while another is not | 249 | 5 | if (right_view.is_null_at(row) != array_data.is_null_at(pos)) { | 250 | 0 | continue; | 251 | 0 | } | 252 | 5 | if (array_data.is_null_at(pos)) { | 253 | 0 | continue; | 254 | 0 | } | 255 | 5 | if (array_data.value_at(pos) == right_view.value_at(row)) { | 256 | 2 | ConcreteAction::apply(res, pos); | 257 | 2 | if constexpr (!ConcreteAction::resume_execution) { | 258 | 2 | break; | 259 | 2 | } | 260 | 2 | } | 261 | 5 | } | 262 | 5 | dst_data[row] = res; | 263 | 5 | } | 264 | | | 265 | 3 | if (!array_view.is_nullable()) { | 266 | 0 | return dst; | 267 | 0 | } | 268 | 3 | return ColumnNullable::create(std::move(dst), std::move(dst_null_column)); | 269 | 3 | } |
Unexecuted instantiation: _ZNK5doris18FunctionArrayIndexINS_19ArrayContainsActionEE13_execute_viewILNS_13PrimitiveTypeE30EEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EERKNS_15ColumnArrayViewIXT_EEERKNS_10ColumnViewIXT_EEE Unexecuted instantiation: _ZNK5doris18FunctionArrayIndexINS_19ArrayContainsActionEE13_execute_viewILNS_13PrimitiveTypeE35EEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EERKNS_15ColumnArrayViewIXT_EEERKNS_10ColumnViewIXT_EEE Unexecuted instantiation: _ZNK5doris18FunctionArrayIndexINS_19ArrayContainsActionEE13_execute_viewILNS_13PrimitiveTypeE11EEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EERKNS_15ColumnArrayViewIXT_EEERKNS_10ColumnViewIXT_EEE Unexecuted instantiation: _ZNK5doris18FunctionArrayIndexINS_19ArrayContainsActionEE13_execute_viewILNS_13PrimitiveTypeE25EEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EERKNS_15ColumnArrayViewIXT_EEERKNS_10ColumnViewIXT_EEE Unexecuted instantiation: _ZNK5doris18FunctionArrayIndexINS_19ArrayContainsActionEE13_execute_viewILNS_13PrimitiveTypeE26EEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EERKNS_15ColumnArrayViewIXT_EEERKNS_10ColumnViewIXT_EEE Unexecuted instantiation: _ZNK5doris18FunctionArrayIndexINS_19ArrayContainsActionEE13_execute_viewILNS_13PrimitiveTypeE12EEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EERKNS_15ColumnArrayViewIXT_EEERKNS_10ColumnViewIXT_EEE Unexecuted instantiation: _ZNK5doris18FunctionArrayIndexINS_19ArrayContainsActionEE13_execute_viewILNS_13PrimitiveTypeE27EEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EERKNS_15ColumnArrayViewIXT_EEERKNS_10ColumnViewIXT_EEE Unexecuted instantiation: _ZNK5doris18FunctionArrayIndexINS_19ArrayContainsActionEE13_execute_viewILNS_13PrimitiveTypeE42EEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EERKNS_15ColumnArrayViewIXT_EEERKNS_10ColumnViewIXT_EEE Unexecuted instantiation: _ZNK5doris18FunctionArrayIndexINS_19ArrayContainsActionEE13_execute_viewILNS_13PrimitiveTypeE36EEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EERKNS_15ColumnArrayViewIXT_EEERKNS_10ColumnViewIXT_EEE Unexecuted instantiation: _ZNK5doris18FunctionArrayIndexINS_19ArrayContainsActionEE13_execute_viewILNS_13PrimitiveTypeE37EEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EERKNS_15ColumnArrayViewIXT_EEERKNS_10ColumnViewIXT_EEE _ZNK5doris18FunctionArrayIndexINS_19ArrayContainsActionEE13_execute_viewILNS_13PrimitiveTypeE23EEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EERKNS_15ColumnArrayViewIXT_EEERKNS_10ColumnViewIXT_EEE Line | Count | Source | 224 | 3 | const ColumnView<PType>& right_view) const { | 225 | | // prepare return data | 226 | 3 | auto dst = PrimitiveTypeTraits<ResultType>::ColumnType::create(array_view.size(), 0); | 227 | 3 | auto& dst_data = dst->get_data(); | 228 | 3 | auto dst_null_column = ColumnUInt8::create(array_view.size(), 0); | 229 | 3 | auto& dst_null_data = dst_null_column->get_data(); | 230 | | | 231 | | // process | 232 | 19 | for (size_t row = 0; row < array_view.size(); ++row) { | 233 | 12 | if (array_view.is_null_at(row)) { | 234 | 4 | dst_null_data[row] = true; | 235 | 4 | continue; | 236 | 4 | } | 237 | 8 | dst_null_data[row] = false; | 238 | 8 | typename PrimitiveTypeTraits<ResultType>::CppType res = 0; | 239 | 8 | const auto array_data = array_view[row]; | 240 | 19 | for (size_t pos = 0; pos < array_data.size(); ++pos) { | 241 | | // match null value | 242 | 11 | if (right_view.is_null_at(row) && array_data.is_null_at(pos)) { | 243 | 0 | ConcreteAction::apply(res, pos); | 244 | 0 | if constexpr (!ConcreteAction::resume_execution) { | 245 | 0 | break; | 246 | 0 | } | 247 | 0 | } | 248 | | // some is null while another is not | 249 | 11 | if (right_view.is_null_at(row) != array_data.is_null_at(pos)) { | 250 | 1 | continue; | 251 | 1 | } | 252 | 10 | if (array_data.is_null_at(pos)) { | 253 | 0 | continue; | 254 | 0 | } | 255 | 10 | if (array_data.value_at(pos) == right_view.value_at(row)) { | 256 | 4 | ConcreteAction::apply(res, pos); | 257 | 4 | if constexpr (!ConcreteAction::resume_execution) { | 258 | 4 | break; | 259 | 4 | } | 260 | 4 | } | 261 | 10 | } | 262 | 12 | dst_data[row] = res; | 263 | 12 | } | 264 | | | 265 | 7 | if (!array_view.is_nullable()) { | 266 | 0 | return dst; | 267 | 0 | } | 268 | 7 | return ColumnNullable::create(std::move(dst), std::move(dst_null_column)); | 269 | 7 | } |
Unexecuted instantiation: _ZNK5doris18FunctionArrayIndexINS_19ArrayPositionActionEE13_execute_viewILNS_13PrimitiveTypeE2EEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EERKNS_15ColumnArrayViewIXT_EEERKNS_10ColumnViewIXT_EEE _ZNK5doris18FunctionArrayIndexINS_19ArrayPositionActionEE13_execute_viewILNS_13PrimitiveTypeE3EEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EERKNS_15ColumnArrayViewIXT_EEERKNS_10ColumnViewIXT_EEE Line | Count | Source | 224 | 1 | const ColumnView<PType>& right_view) const { | 225 | | // prepare return data | 226 | 1 | auto dst = PrimitiveTypeTraits<ResultType>::ColumnType::create(array_view.size(), 0); | 227 | 1 | auto& dst_data = dst->get_data(); | 228 | 1 | auto dst_null_column = ColumnUInt8::create(array_view.size(), 0); | 229 | 1 | auto& dst_null_data = dst_null_column->get_data(); | 230 | | | 231 | | // process | 232 | 6 | for (size_t row = 0; row < array_view.size(); ++row) { | 233 | 4 | if (array_view.is_null_at(row)) { | 234 | 1 | dst_null_data[row] = true; | 235 | 1 | continue; | 236 | 1 | } | 237 | 3 | dst_null_data[row] = false; | 238 | 3 | typename PrimitiveTypeTraits<ResultType>::CppType res = 0; | 239 | 3 | const auto array_data = array_view[row]; | 240 | 8 | for (size_t pos = 0; pos < array_data.size(); ++pos) { | 241 | | // match null value | 242 | 5 | if (right_view.is_null_at(row) && array_data.is_null_at(pos)) { | 243 | 0 | ConcreteAction::apply(res, pos); | 244 | 0 | if constexpr (!ConcreteAction::resume_execution) { | 245 | 0 | break; | 246 | 0 | } | 247 | 0 | } | 248 | | // some is null while another is not | 249 | 5 | if (right_view.is_null_at(row) != array_data.is_null_at(pos)) { | 250 | 0 | continue; | 251 | 0 | } | 252 | 5 | if (array_data.is_null_at(pos)) { | 253 | 0 | continue; | 254 | 0 | } | 255 | 5 | if (array_data.value_at(pos) == right_view.value_at(row)) { | 256 | 1 | ConcreteAction::apply(res, pos); | 257 | 1 | if constexpr (!ConcreteAction::resume_execution) { | 258 | 1 | break; | 259 | 1 | } | 260 | 1 | } | 261 | 5 | } | 262 | 4 | dst_data[row] = res; | 263 | 4 | } | 264 | | | 265 | 2 | if (!array_view.is_nullable()) { | 266 | 0 | return dst; | 267 | 0 | } | 268 | 2 | return ColumnNullable::create(std::move(dst), std::move(dst_null_column)); | 269 | 2 | } |
Unexecuted instantiation: _ZNK5doris18FunctionArrayIndexINS_19ArrayPositionActionEE13_execute_viewILNS_13PrimitiveTypeE4EEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EERKNS_15ColumnArrayViewIXT_EEERKNS_10ColumnViewIXT_EEE _ZNK5doris18FunctionArrayIndexINS_19ArrayPositionActionEE13_execute_viewILNS_13PrimitiveTypeE5EEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EERKNS_15ColumnArrayViewIXT_EEERKNS_10ColumnViewIXT_EEE Line | Count | Source | 224 | 3 | const ColumnView<PType>& right_view) const { | 225 | | // prepare return data | 226 | 3 | auto dst = PrimitiveTypeTraits<ResultType>::ColumnType::create(array_view.size(), 0); | 227 | 3 | auto& dst_data = dst->get_data(); | 228 | 3 | auto dst_null_column = ColumnUInt8::create(array_view.size(), 0); | 229 | 3 | auto& dst_null_data = dst_null_column->get_data(); | 230 | | | 231 | | // process | 232 | 15 | for (size_t row = 0; row < array_view.size(); ++row) { | 233 | 9 | if (array_view.is_null_at(row)) { | 234 | 2 | dst_null_data[row] = true; | 235 | 2 | continue; | 236 | 2 | } | 237 | 7 | dst_null_data[row] = false; | 238 | 7 | typename PrimitiveTypeTraits<ResultType>::CppType res = 0; | 239 | 7 | const auto array_data = array_view[row]; | 240 | 19 | for (size_t pos = 0; pos < array_data.size(); ++pos) { | 241 | | // match null value | 242 | 12 | if (right_view.is_null_at(row) && array_data.is_null_at(pos)) { | 243 | 1 | ConcreteAction::apply(res, pos); | 244 | 1 | if constexpr (!ConcreteAction::resume_execution) { | 245 | 1 | break; | 246 | 1 | } | 247 | 1 | } | 248 | | // some is null while another is not | 249 | 12 | if (right_view.is_null_at(row) != array_data.is_null_at(pos)) { | 250 | 1 | continue; | 251 | 1 | } | 252 | 11 | if (array_data.is_null_at(pos)) { | 253 | 0 | continue; | 254 | 0 | } | 255 | 11 | if (array_data.value_at(pos) == right_view.value_at(row)) { | 256 | 2 | ConcreteAction::apply(res, pos); | 257 | 2 | if constexpr (!ConcreteAction::resume_execution) { | 258 | 2 | break; | 259 | 2 | } | 260 | 2 | } | 261 | 11 | } | 262 | 10 | dst_data[row] = res; | 263 | 10 | } | 264 | | | 265 | 6 | if (!array_view.is_nullable()) { | 266 | 0 | return dst; | 267 | 0 | } | 268 | 6 | return ColumnNullable::create(std::move(dst), std::move(dst_null_column)); | 269 | 6 | } |
Unexecuted instantiation: _ZNK5doris18FunctionArrayIndexINS_19ArrayPositionActionEE13_execute_viewILNS_13PrimitiveTypeE6EEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EERKNS_15ColumnArrayViewIXT_EEERKNS_10ColumnViewIXT_EEE Unexecuted instantiation: _ZNK5doris18FunctionArrayIndexINS_19ArrayPositionActionEE13_execute_viewILNS_13PrimitiveTypeE7EEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EERKNS_15ColumnArrayViewIXT_EEERKNS_10ColumnViewIXT_EEE Unexecuted instantiation: _ZNK5doris18FunctionArrayIndexINS_19ArrayPositionActionEE13_execute_viewILNS_13PrimitiveTypeE8EEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EERKNS_15ColumnArrayViewIXT_EEERKNS_10ColumnViewIXT_EEE Unexecuted instantiation: _ZNK5doris18FunctionArrayIndexINS_19ArrayPositionActionEE13_execute_viewILNS_13PrimitiveTypeE9EEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EERKNS_15ColumnArrayViewIXT_EEERKNS_10ColumnViewIXT_EEE Unexecuted instantiation: _ZNK5doris18FunctionArrayIndexINS_19ArrayPositionActionEE13_execute_viewILNS_13PrimitiveTypeE28EEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EERKNS_15ColumnArrayViewIXT_EEERKNS_10ColumnViewIXT_EEE Unexecuted instantiation: _ZNK5doris18FunctionArrayIndexINS_19ArrayPositionActionEE13_execute_viewILNS_13PrimitiveTypeE29EEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EERKNS_15ColumnArrayViewIXT_EEERKNS_10ColumnViewIXT_EEE _ZNK5doris18FunctionArrayIndexINS_19ArrayPositionActionEE13_execute_viewILNS_13PrimitiveTypeE20EEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EERKNS_15ColumnArrayViewIXT_EEERKNS_10ColumnViewIXT_EEE Line | Count | Source | 224 | 1 | const ColumnView<PType>& right_view) const { | 225 | | // prepare return data | 226 | 1 | auto dst = PrimitiveTypeTraits<ResultType>::ColumnType::create(array_view.size(), 0); | 227 | 1 | auto& dst_data = dst->get_data(); | 228 | 1 | auto dst_null_column = ColumnUInt8::create(array_view.size(), 0); | 229 | 1 | auto& dst_null_data = dst_null_column->get_data(); | 230 | | | 231 | | // process | 232 | 7 | for (size_t row = 0; row < array_view.size(); ++row) { | 233 | 4 | if (array_view.is_null_at(row)) { | 234 | 1 | dst_null_data[row] = true; | 235 | 1 | continue; | 236 | 1 | } | 237 | 3 | dst_null_data[row] = false; | 238 | 3 | typename PrimitiveTypeTraits<ResultType>::CppType res = 0; | 239 | 3 | const auto array_data = array_view[row]; | 240 | 8 | for (size_t pos = 0; pos < array_data.size(); ++pos) { | 241 | | // match null value | 242 | 5 | if (right_view.is_null_at(row) && array_data.is_null_at(pos)) { | 243 | 0 | ConcreteAction::apply(res, pos); | 244 | 0 | if constexpr (!ConcreteAction::resume_execution) { | 245 | 0 | break; | 246 | 0 | } | 247 | 0 | } | 248 | | // some is null while another is not | 249 | 5 | if (right_view.is_null_at(row) != array_data.is_null_at(pos)) { | 250 | 0 | continue; | 251 | 0 | } | 252 | 5 | if (array_data.is_null_at(pos)) { | 253 | 0 | continue; | 254 | 0 | } | 255 | 5 | if (array_data.value_at(pos) == right_view.value_at(row)) { | 256 | 2 | ConcreteAction::apply(res, pos); | 257 | 2 | if constexpr (!ConcreteAction::resume_execution) { | 258 | 2 | break; | 259 | 2 | } | 260 | 2 | } | 261 | 5 | } | 262 | 5 | dst_data[row] = res; | 263 | 5 | } | 264 | | | 265 | 3 | if (!array_view.is_nullable()) { | 266 | 0 | return dst; | 267 | 0 | } | 268 | 3 | return ColumnNullable::create(std::move(dst), std::move(dst_null_column)); | 269 | 3 | } |
Unexecuted instantiation: _ZNK5doris18FunctionArrayIndexINS_19ArrayPositionActionEE13_execute_viewILNS_13PrimitiveTypeE30EEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EERKNS_15ColumnArrayViewIXT_EEERKNS_10ColumnViewIXT_EEE Unexecuted instantiation: _ZNK5doris18FunctionArrayIndexINS_19ArrayPositionActionEE13_execute_viewILNS_13PrimitiveTypeE35EEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EERKNS_15ColumnArrayViewIXT_EEERKNS_10ColumnViewIXT_EEE Unexecuted instantiation: _ZNK5doris18FunctionArrayIndexINS_19ArrayPositionActionEE13_execute_viewILNS_13PrimitiveTypeE11EEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EERKNS_15ColumnArrayViewIXT_EEERKNS_10ColumnViewIXT_EEE Unexecuted instantiation: _ZNK5doris18FunctionArrayIndexINS_19ArrayPositionActionEE13_execute_viewILNS_13PrimitiveTypeE25EEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EERKNS_15ColumnArrayViewIXT_EEERKNS_10ColumnViewIXT_EEE Unexecuted instantiation: _ZNK5doris18FunctionArrayIndexINS_19ArrayPositionActionEE13_execute_viewILNS_13PrimitiveTypeE26EEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EERKNS_15ColumnArrayViewIXT_EEERKNS_10ColumnViewIXT_EEE Unexecuted instantiation: _ZNK5doris18FunctionArrayIndexINS_19ArrayPositionActionEE13_execute_viewILNS_13PrimitiveTypeE12EEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EERKNS_15ColumnArrayViewIXT_EEERKNS_10ColumnViewIXT_EEE Unexecuted instantiation: _ZNK5doris18FunctionArrayIndexINS_19ArrayPositionActionEE13_execute_viewILNS_13PrimitiveTypeE27EEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EERKNS_15ColumnArrayViewIXT_EEERKNS_10ColumnViewIXT_EEE Unexecuted instantiation: _ZNK5doris18FunctionArrayIndexINS_19ArrayPositionActionEE13_execute_viewILNS_13PrimitiveTypeE42EEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EERKNS_15ColumnArrayViewIXT_EEERKNS_10ColumnViewIXT_EEE Unexecuted instantiation: _ZNK5doris18FunctionArrayIndexINS_19ArrayPositionActionEE13_execute_viewILNS_13PrimitiveTypeE36EEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EERKNS_15ColumnArrayViewIXT_EEERKNS_10ColumnViewIXT_EEE Unexecuted instantiation: _ZNK5doris18FunctionArrayIndexINS_19ArrayPositionActionEE13_execute_viewILNS_13PrimitiveTypeE37EEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EERKNS_15ColumnArrayViewIXT_EEERKNS_10ColumnViewIXT_EEE _ZNK5doris18FunctionArrayIndexINS_19ArrayPositionActionEE13_execute_viewILNS_13PrimitiveTypeE23EEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EERKNS_15ColumnArrayViewIXT_EEERKNS_10ColumnViewIXT_EEE Line | Count | Source | 224 | 1 | const ColumnView<PType>& right_view) const { | 225 | | // prepare return data | 226 | 1 | auto dst = PrimitiveTypeTraits<ResultType>::ColumnType::create(array_view.size(), 0); | 227 | 1 | auto& dst_data = dst->get_data(); | 228 | 1 | auto dst_null_column = ColumnUInt8::create(array_view.size(), 0); | 229 | 1 | auto& dst_null_data = dst_null_column->get_data(); | 230 | | | 231 | | // process | 232 | 8 | for (size_t row = 0; row < array_view.size(); ++row) { | 233 | 5 | if (array_view.is_null_at(row)) { | 234 | 1 | dst_null_data[row] = true; | 235 | 1 | continue; | 236 | 1 | } | 237 | 4 | dst_null_data[row] = false; | 238 | 4 | typename PrimitiveTypeTraits<ResultType>::CppType res = 0; | 239 | 4 | const auto array_data = array_view[row]; | 240 | 10 | for (size_t pos = 0; pos < array_data.size(); ++pos) { | 241 | | // match null value | 242 | 6 | if (right_view.is_null_at(row) && array_data.is_null_at(pos)) { | 243 | 0 | ConcreteAction::apply(res, pos); | 244 | 0 | if constexpr (!ConcreteAction::resume_execution) { | 245 | 0 | break; | 246 | 0 | } | 247 | 0 | } | 248 | | // some is null while another is not | 249 | 6 | if (right_view.is_null_at(row) != array_data.is_null_at(pos)) { | 250 | 0 | continue; | 251 | 0 | } | 252 | 6 | if (array_data.is_null_at(pos)) { | 253 | 0 | continue; | 254 | 0 | } | 255 | 6 | if (array_data.value_at(pos) == right_view.value_at(row)) { | 256 | 2 | ConcreteAction::apply(res, pos); | 257 | 2 | if constexpr (!ConcreteAction::resume_execution) { | 258 | 2 | break; | 259 | 2 | } | 260 | 2 | } | 261 | 6 | } | 262 | 6 | dst_data[row] = res; | 263 | 6 | } | 264 | | | 265 | 3 | if (!array_view.is_nullable()) { | 266 | 0 | return dst; | 267 | 0 | } | 268 | 3 | return ColumnNullable::create(std::move(dst), std::move(dst_null_column)); | 269 | 3 | } |
Unexecuted instantiation: _ZNK5doris18FunctionArrayIndexINS_15ArrayCountEqualEE13_execute_viewILNS_13PrimitiveTypeE2EEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EERKNS_15ColumnArrayViewIXT_EEERKNS_10ColumnViewIXT_EEE Unexecuted instantiation: _ZNK5doris18FunctionArrayIndexINS_15ArrayCountEqualEE13_execute_viewILNS_13PrimitiveTypeE3EEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EERKNS_15ColumnArrayViewIXT_EEERKNS_10ColumnViewIXT_EEE Unexecuted instantiation: _ZNK5doris18FunctionArrayIndexINS_15ArrayCountEqualEE13_execute_viewILNS_13PrimitiveTypeE4EEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EERKNS_15ColumnArrayViewIXT_EEERKNS_10ColumnViewIXT_EEE _ZNK5doris18FunctionArrayIndexINS_15ArrayCountEqualEE13_execute_viewILNS_13PrimitiveTypeE5EEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EERKNS_15ColumnArrayViewIXT_EEERKNS_10ColumnViewIXT_EEE Line | Count | Source | 224 | 1 | const ColumnView<PType>& right_view) const { | 225 | | // prepare return data | 226 | 1 | auto dst = PrimitiveTypeTraits<ResultType>::ColumnType::create(array_view.size(), 0); | 227 | 1 | auto& dst_data = dst->get_data(); | 228 | 1 | auto dst_null_column = ColumnUInt8::create(array_view.size(), 0); | 229 | 1 | auto& dst_null_data = dst_null_column->get_data(); | 230 | | | 231 | | // process | 232 | 2 | for (size_t row = 0; row < array_view.size(); ++row) { | 233 | 1 | if (array_view.is_null_at(row)) { | 234 | 0 | dst_null_data[row] = true; | 235 | 0 | continue; | 236 | 0 | } | 237 | 1 | dst_null_data[row] = false; | 238 | 1 | typename PrimitiveTypeTraits<ResultType>::CppType res = 0; | 239 | 1 | const auto array_data = array_view[row]; | 240 | 5 | for (size_t pos = 0; pos < array_data.size(); ++pos) { | 241 | | // match null value | 242 | 4 | if (right_view.is_null_at(row) && array_data.is_null_at(pos)) { | 243 | 0 | ConcreteAction::apply(res, pos); | 244 | | if constexpr (!ConcreteAction::resume_execution) { | 245 | | break; | 246 | | } | 247 | 0 | } | 248 | | // some is null while another is not | 249 | 4 | if (right_view.is_null_at(row) != array_data.is_null_at(pos)) { | 250 | 1 | continue; | 251 | 1 | } | 252 | 3 | if (array_data.is_null_at(pos)) { | 253 | 0 | continue; | 254 | 0 | } | 255 | 3 | if (array_data.value_at(pos) == right_view.value_at(row)) { | 256 | 2 | ConcreteAction::apply(res, pos); | 257 | | if constexpr (!ConcreteAction::resume_execution) { | 258 | | break; | 259 | | } | 260 | 2 | } | 261 | 3 | } | 262 | 1 | dst_data[row] = res; | 263 | 1 | } | 264 | | | 265 | 1 | if (!array_view.is_nullable()) { | 266 | 0 | return dst; | 267 | 0 | } | 268 | 1 | return ColumnNullable::create(std::move(dst), std::move(dst_null_column)); | 269 | 1 | } |
Unexecuted instantiation: _ZNK5doris18FunctionArrayIndexINS_15ArrayCountEqualEE13_execute_viewILNS_13PrimitiveTypeE6EEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EERKNS_15ColumnArrayViewIXT_EEERKNS_10ColumnViewIXT_EEE Unexecuted instantiation: _ZNK5doris18FunctionArrayIndexINS_15ArrayCountEqualEE13_execute_viewILNS_13PrimitiveTypeE7EEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EERKNS_15ColumnArrayViewIXT_EEERKNS_10ColumnViewIXT_EEE Unexecuted instantiation: _ZNK5doris18FunctionArrayIndexINS_15ArrayCountEqualEE13_execute_viewILNS_13PrimitiveTypeE8EEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EERKNS_15ColumnArrayViewIXT_EEERKNS_10ColumnViewIXT_EEE Unexecuted instantiation: _ZNK5doris18FunctionArrayIndexINS_15ArrayCountEqualEE13_execute_viewILNS_13PrimitiveTypeE9EEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EERKNS_15ColumnArrayViewIXT_EEERKNS_10ColumnViewIXT_EEE Unexecuted instantiation: _ZNK5doris18FunctionArrayIndexINS_15ArrayCountEqualEE13_execute_viewILNS_13PrimitiveTypeE28EEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EERKNS_15ColumnArrayViewIXT_EEERKNS_10ColumnViewIXT_EEE Unexecuted instantiation: _ZNK5doris18FunctionArrayIndexINS_15ArrayCountEqualEE13_execute_viewILNS_13PrimitiveTypeE29EEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EERKNS_15ColumnArrayViewIXT_EEERKNS_10ColumnViewIXT_EEE Unexecuted instantiation: _ZNK5doris18FunctionArrayIndexINS_15ArrayCountEqualEE13_execute_viewILNS_13PrimitiveTypeE20EEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EERKNS_15ColumnArrayViewIXT_EEERKNS_10ColumnViewIXT_EEE Unexecuted instantiation: _ZNK5doris18FunctionArrayIndexINS_15ArrayCountEqualEE13_execute_viewILNS_13PrimitiveTypeE30EEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EERKNS_15ColumnArrayViewIXT_EEERKNS_10ColumnViewIXT_EEE Unexecuted instantiation: _ZNK5doris18FunctionArrayIndexINS_15ArrayCountEqualEE13_execute_viewILNS_13PrimitiveTypeE35EEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EERKNS_15ColumnArrayViewIXT_EEERKNS_10ColumnViewIXT_EEE Unexecuted instantiation: _ZNK5doris18FunctionArrayIndexINS_15ArrayCountEqualEE13_execute_viewILNS_13PrimitiveTypeE11EEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EERKNS_15ColumnArrayViewIXT_EEERKNS_10ColumnViewIXT_EEE Unexecuted instantiation: _ZNK5doris18FunctionArrayIndexINS_15ArrayCountEqualEE13_execute_viewILNS_13PrimitiveTypeE25EEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EERKNS_15ColumnArrayViewIXT_EEERKNS_10ColumnViewIXT_EEE Unexecuted instantiation: _ZNK5doris18FunctionArrayIndexINS_15ArrayCountEqualEE13_execute_viewILNS_13PrimitiveTypeE26EEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EERKNS_15ColumnArrayViewIXT_EEERKNS_10ColumnViewIXT_EEE Unexecuted instantiation: _ZNK5doris18FunctionArrayIndexINS_15ArrayCountEqualEE13_execute_viewILNS_13PrimitiveTypeE12EEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EERKNS_15ColumnArrayViewIXT_EEERKNS_10ColumnViewIXT_EEE Unexecuted instantiation: _ZNK5doris18FunctionArrayIndexINS_15ArrayCountEqualEE13_execute_viewILNS_13PrimitiveTypeE27EEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EERKNS_15ColumnArrayViewIXT_EEERKNS_10ColumnViewIXT_EEE Unexecuted instantiation: _ZNK5doris18FunctionArrayIndexINS_15ArrayCountEqualEE13_execute_viewILNS_13PrimitiveTypeE42EEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EERKNS_15ColumnArrayViewIXT_EEERKNS_10ColumnViewIXT_EEE Unexecuted instantiation: _ZNK5doris18FunctionArrayIndexINS_15ArrayCountEqualEE13_execute_viewILNS_13PrimitiveTypeE36EEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EERKNS_15ColumnArrayViewIXT_EEERKNS_10ColumnViewIXT_EEE Unexecuted instantiation: _ZNK5doris18FunctionArrayIndexINS_15ArrayCountEqualEE13_execute_viewILNS_13PrimitiveTypeE37EEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EERKNS_15ColumnArrayViewIXT_EEERKNS_10ColumnViewIXT_EEE Unexecuted instantiation: _ZNK5doris18FunctionArrayIndexINS_15ArrayCountEqualEE13_execute_viewILNS_13PrimitiveTypeE23EEENS_3COWINS_7IColumnEE13immutable_ptrIS6_EERKNS_15ColumnArrayViewIXT_EEERKNS_10ColumnViewIXT_EEE |
270 | | |
271 | | Status _execute_dispatch(Block& block, const ColumnNumbers& arguments, uint32_t result, |
272 | 18 | size_t input_rows_count) const { |
273 | 18 | if (block.get_by_position(arguments[0]).type->get_primitive_type() != TYPE_ARRAY) { |
274 | 0 | return Status::InvalidArgument(get_name() + " first argument must be array, but got " + |
275 | 0 | block.get_by_position(arguments[0]).type->get_name()); |
276 | 0 | } |
277 | | // execute |
278 | 18 | auto array_type = remove_nullable(block.get_by_position(arguments[0]).type); |
279 | 18 | auto left_element_type = remove_nullable( |
280 | 18 | assert_cast<const DataTypeArray*>(array_type.get())->get_nested_type()); |
281 | 18 | auto right_type = remove_nullable(block.get_by_position(arguments[1]).type); |
282 | | |
283 | 18 | auto left_element_primitive_type = left_element_type->get_primitive_type(); |
284 | 18 | auto right_primitive_type = right_type->get_primitive_type(); |
285 | 18 | ColumnPtr return_column = nullptr; |
286 | 18 | if (right_primitive_type == left_element_primitive_type || |
287 | 18 | (is_string_type(right_primitive_type) && is_string_type(left_element_primitive_type))) { |
288 | 18 | auto call = [&](const auto& type) -> bool { |
289 | 18 | using DispatchType = std::decay_t<decltype(type)>; |
290 | 18 | constexpr PrimitiveType PType = DispatchType::PType; |
291 | 18 | auto array_view = |
292 | 18 | ColumnArrayView<PType>::create(block.get_by_position(arguments[0]).column); |
293 | 18 | auto right_view = |
294 | 18 | ColumnView<PType>::create(block.get_by_position(arguments[1]).column); |
295 | 18 | return_column = _execute_view(array_view, right_view); |
296 | 18 | return true; |
297 | 18 | }; Unexecuted instantiation: _ZZNK5doris18FunctionArrayIndexINS_19ArrayContainsActionEE17_execute_dispatchERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE2EEEEEbSC_ _ZZNK5doris18FunctionArrayIndexINS_19ArrayContainsActionEE17_execute_dispatchERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE3EEEEEbSC_ Line | Count | Source | 288 | 1 | auto call = [&](const auto& type) -> bool { | 289 | 1 | using DispatchType = std::decay_t<decltype(type)>; | 290 | 1 | constexpr PrimitiveType PType = DispatchType::PType; | 291 | 1 | auto array_view = | 292 | 1 | ColumnArrayView<PType>::create(block.get_by_position(arguments[0]).column); | 293 | 1 | auto right_view = | 294 | 1 | ColumnView<PType>::create(block.get_by_position(arguments[1]).column); | 295 | 1 | return_column = _execute_view(array_view, right_view); | 296 | 1 | return true; | 297 | 1 | }; |
Unexecuted instantiation: _ZZNK5doris18FunctionArrayIndexINS_19ArrayContainsActionEE17_execute_dispatchERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE4EEEEEbSC_ _ZZNK5doris18FunctionArrayIndexINS_19ArrayContainsActionEE17_execute_dispatchERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE5EEEEEbSC_ Line | Count | Source | 288 | 2 | auto call = [&](const auto& type) -> bool { | 289 | 2 | using DispatchType = std::decay_t<decltype(type)>; | 290 | 2 | constexpr PrimitiveType PType = DispatchType::PType; | 291 | 2 | auto array_view = | 292 | 2 | ColumnArrayView<PType>::create(block.get_by_position(arguments[0]).column); | 293 | 2 | auto right_view = | 294 | 2 | ColumnView<PType>::create(block.get_by_position(arguments[1]).column); | 295 | 2 | return_column = _execute_view(array_view, right_view); | 296 | 2 | return true; | 297 | 2 | }; |
_ZZNK5doris18FunctionArrayIndexINS_19ArrayContainsActionEE17_execute_dispatchERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE6EEEEEbSC_ Line | Count | Source | 288 | 1 | auto call = [&](const auto& type) -> bool { | 289 | 1 | using DispatchType = std::decay_t<decltype(type)>; | 290 | 1 | constexpr PrimitiveType PType = DispatchType::PType; | 291 | 1 | auto array_view = | 292 | 1 | ColumnArrayView<PType>::create(block.get_by_position(arguments[0]).column); | 293 | 1 | auto right_view = | 294 | 1 | ColumnView<PType>::create(block.get_by_position(arguments[1]).column); | 295 | 1 | return_column = _execute_view(array_view, right_view); | 296 | 1 | return true; | 297 | 1 | }; |
_ZZNK5doris18FunctionArrayIndexINS_19ArrayContainsActionEE17_execute_dispatchERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE7EEEEEbSC_ Line | Count | Source | 288 | 1 | auto call = [&](const auto& type) -> bool { | 289 | 1 | using DispatchType = std::decay_t<decltype(type)>; | 290 | 1 | constexpr PrimitiveType PType = DispatchType::PType; | 291 | 1 | auto array_view = | 292 | 1 | ColumnArrayView<PType>::create(block.get_by_position(arguments[0]).column); | 293 | 1 | auto right_view = | 294 | 1 | ColumnView<PType>::create(block.get_by_position(arguments[1]).column); | 295 | 1 | return_column = _execute_view(array_view, right_view); | 296 | 1 | return true; | 297 | 1 | }; |
_ZZNK5doris18FunctionArrayIndexINS_19ArrayContainsActionEE17_execute_dispatchERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE8EEEEEbSC_ Line | Count | Source | 288 | 1 | auto call = [&](const auto& type) -> bool { | 289 | 1 | using DispatchType = std::decay_t<decltype(type)>; | 290 | 1 | constexpr PrimitiveType PType = DispatchType::PType; | 291 | 1 | auto array_view = | 292 | 1 | ColumnArrayView<PType>::create(block.get_by_position(arguments[0]).column); | 293 | 1 | auto right_view = | 294 | 1 | ColumnView<PType>::create(block.get_by_position(arguments[1]).column); | 295 | 1 | return_column = _execute_view(array_view, right_view); | 296 | 1 | return true; | 297 | 1 | }; |
_ZZNK5doris18FunctionArrayIndexINS_19ArrayContainsActionEE17_execute_dispatchERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE9EEEEEbSC_ Line | Count | Source | 288 | 1 | auto call = [&](const auto& type) -> bool { | 289 | 1 | using DispatchType = std::decay_t<decltype(type)>; | 290 | 1 | constexpr PrimitiveType PType = DispatchType::PType; | 291 | 1 | auto array_view = | 292 | 1 | ColumnArrayView<PType>::create(block.get_by_position(arguments[0]).column); | 293 | 1 | auto right_view = | 294 | 1 | ColumnView<PType>::create(block.get_by_position(arguments[1]).column); | 295 | 1 | return_column = _execute_view(array_view, right_view); | 296 | 1 | return true; | 297 | 1 | }; |
Unexecuted instantiation: _ZZNK5doris18FunctionArrayIndexINS_19ArrayContainsActionEE17_execute_dispatchERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE28EEEEEbSC_ Unexecuted instantiation: _ZZNK5doris18FunctionArrayIndexINS_19ArrayContainsActionEE17_execute_dispatchERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE29EEEEEbSC_ _ZZNK5doris18FunctionArrayIndexINS_19ArrayContainsActionEE17_execute_dispatchERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE20EEEEEbSC_ Line | Count | Source | 288 | 1 | auto call = [&](const auto& type) -> bool { | 289 | 1 | using DispatchType = std::decay_t<decltype(type)>; | 290 | 1 | constexpr PrimitiveType PType = DispatchType::PType; | 291 | 1 | auto array_view = | 292 | 1 | ColumnArrayView<PType>::create(block.get_by_position(arguments[0]).column); | 293 | 1 | auto right_view = | 294 | 1 | ColumnView<PType>::create(block.get_by_position(arguments[1]).column); | 295 | 1 | return_column = _execute_view(array_view, right_view); | 296 | 1 | return true; | 297 | 1 | }; |
Unexecuted instantiation: _ZZNK5doris18FunctionArrayIndexINS_19ArrayContainsActionEE17_execute_dispatchERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE30EEEEEbSC_ Unexecuted instantiation: _ZZNK5doris18FunctionArrayIndexINS_19ArrayContainsActionEE17_execute_dispatchERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE35EEEEEbSC_ Unexecuted instantiation: _ZZNK5doris18FunctionArrayIndexINS_19ArrayContainsActionEE17_execute_dispatchERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE11EEEEEbSC_ Unexecuted instantiation: _ZZNK5doris18FunctionArrayIndexINS_19ArrayContainsActionEE17_execute_dispatchERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE25EEEEEbSC_ Unexecuted instantiation: _ZZNK5doris18FunctionArrayIndexINS_19ArrayContainsActionEE17_execute_dispatchERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE26EEEEEbSC_ Unexecuted instantiation: _ZZNK5doris18FunctionArrayIndexINS_19ArrayContainsActionEE17_execute_dispatchERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE12EEEEEbSC_ Unexecuted instantiation: _ZZNK5doris18FunctionArrayIndexINS_19ArrayContainsActionEE17_execute_dispatchERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE27EEEEEbSC_ Unexecuted instantiation: _ZZNK5doris18FunctionArrayIndexINS_19ArrayContainsActionEE17_execute_dispatchERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE42EEEEEbSC_ Unexecuted instantiation: _ZZNK5doris18FunctionArrayIndexINS_19ArrayContainsActionEE17_execute_dispatchERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE36EEEEEbSC_ Unexecuted instantiation: _ZZNK5doris18FunctionArrayIndexINS_19ArrayContainsActionEE17_execute_dispatchERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE37EEEEEbSC_ _ZZNK5doris18FunctionArrayIndexINS_19ArrayContainsActionEE17_execute_dispatchERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE23EEEEEbSC_ Line | Count | Source | 288 | 3 | auto call = [&](const auto& type) -> bool { | 289 | 3 | using DispatchType = std::decay_t<decltype(type)>; | 290 | 3 | constexpr PrimitiveType PType = DispatchType::PType; | 291 | 3 | auto array_view = | 292 | 3 | ColumnArrayView<PType>::create(block.get_by_position(arguments[0]).column); | 293 | 3 | auto right_view = | 294 | 3 | ColumnView<PType>::create(block.get_by_position(arguments[1]).column); | 295 | 3 | return_column = _execute_view(array_view, right_view); | 296 | 3 | return true; | 297 | 3 | }; |
Unexecuted instantiation: _ZZNK5doris18FunctionArrayIndexINS_19ArrayPositionActionEE17_execute_dispatchERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE2EEEEEbSC_ _ZZNK5doris18FunctionArrayIndexINS_19ArrayPositionActionEE17_execute_dispatchERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE3EEEEEbSC_ Line | Count | Source | 288 | 1 | auto call = [&](const auto& type) -> bool { | 289 | 1 | using DispatchType = std::decay_t<decltype(type)>; | 290 | 1 | constexpr PrimitiveType PType = DispatchType::PType; | 291 | 1 | auto array_view = | 292 | 1 | ColumnArrayView<PType>::create(block.get_by_position(arguments[0]).column); | 293 | 1 | auto right_view = | 294 | 1 | ColumnView<PType>::create(block.get_by_position(arguments[1]).column); | 295 | 1 | return_column = _execute_view(array_view, right_view); | 296 | 1 | return true; | 297 | 1 | }; |
Unexecuted instantiation: _ZZNK5doris18FunctionArrayIndexINS_19ArrayPositionActionEE17_execute_dispatchERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE4EEEEEbSC_ _ZZNK5doris18FunctionArrayIndexINS_19ArrayPositionActionEE17_execute_dispatchERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE5EEEEEbSC_ Line | Count | Source | 288 | 3 | auto call = [&](const auto& type) -> bool { | 289 | 3 | using DispatchType = std::decay_t<decltype(type)>; | 290 | 3 | constexpr PrimitiveType PType = DispatchType::PType; | 291 | 3 | auto array_view = | 292 | 3 | ColumnArrayView<PType>::create(block.get_by_position(arguments[0]).column); | 293 | 3 | auto right_view = | 294 | 3 | ColumnView<PType>::create(block.get_by_position(arguments[1]).column); | 295 | 3 | return_column = _execute_view(array_view, right_view); | 296 | 3 | return true; | 297 | 3 | }; |
Unexecuted instantiation: _ZZNK5doris18FunctionArrayIndexINS_19ArrayPositionActionEE17_execute_dispatchERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE6EEEEEbSC_ Unexecuted instantiation: _ZZNK5doris18FunctionArrayIndexINS_19ArrayPositionActionEE17_execute_dispatchERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE7EEEEEbSC_ Unexecuted instantiation: _ZZNK5doris18FunctionArrayIndexINS_19ArrayPositionActionEE17_execute_dispatchERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE8EEEEEbSC_ Unexecuted instantiation: _ZZNK5doris18FunctionArrayIndexINS_19ArrayPositionActionEE17_execute_dispatchERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE9EEEEEbSC_ Unexecuted instantiation: _ZZNK5doris18FunctionArrayIndexINS_19ArrayPositionActionEE17_execute_dispatchERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE28EEEEEbSC_ Unexecuted instantiation: _ZZNK5doris18FunctionArrayIndexINS_19ArrayPositionActionEE17_execute_dispatchERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE29EEEEEbSC_ _ZZNK5doris18FunctionArrayIndexINS_19ArrayPositionActionEE17_execute_dispatchERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE20EEEEEbSC_ Line | Count | Source | 288 | 1 | auto call = [&](const auto& type) -> bool { | 289 | 1 | using DispatchType = std::decay_t<decltype(type)>; | 290 | 1 | constexpr PrimitiveType PType = DispatchType::PType; | 291 | 1 | auto array_view = | 292 | 1 | ColumnArrayView<PType>::create(block.get_by_position(arguments[0]).column); | 293 | 1 | auto right_view = | 294 | 1 | ColumnView<PType>::create(block.get_by_position(arguments[1]).column); | 295 | 1 | return_column = _execute_view(array_view, right_view); | 296 | 1 | return true; | 297 | 1 | }; |
Unexecuted instantiation: _ZZNK5doris18FunctionArrayIndexINS_19ArrayPositionActionEE17_execute_dispatchERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE30EEEEEbSC_ Unexecuted instantiation: _ZZNK5doris18FunctionArrayIndexINS_19ArrayPositionActionEE17_execute_dispatchERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE35EEEEEbSC_ Unexecuted instantiation: _ZZNK5doris18FunctionArrayIndexINS_19ArrayPositionActionEE17_execute_dispatchERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE11EEEEEbSC_ Unexecuted instantiation: _ZZNK5doris18FunctionArrayIndexINS_19ArrayPositionActionEE17_execute_dispatchERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE25EEEEEbSC_ Unexecuted instantiation: _ZZNK5doris18FunctionArrayIndexINS_19ArrayPositionActionEE17_execute_dispatchERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE26EEEEEbSC_ Unexecuted instantiation: _ZZNK5doris18FunctionArrayIndexINS_19ArrayPositionActionEE17_execute_dispatchERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE12EEEEEbSC_ Unexecuted instantiation: _ZZNK5doris18FunctionArrayIndexINS_19ArrayPositionActionEE17_execute_dispatchERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE27EEEEEbSC_ Unexecuted instantiation: _ZZNK5doris18FunctionArrayIndexINS_19ArrayPositionActionEE17_execute_dispatchERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE42EEEEEbSC_ Unexecuted instantiation: _ZZNK5doris18FunctionArrayIndexINS_19ArrayPositionActionEE17_execute_dispatchERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE36EEEEEbSC_ Unexecuted instantiation: _ZZNK5doris18FunctionArrayIndexINS_19ArrayPositionActionEE17_execute_dispatchERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE37EEEEEbSC_ _ZZNK5doris18FunctionArrayIndexINS_19ArrayPositionActionEE17_execute_dispatchERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE23EEEEEbSC_ Line | Count | Source | 288 | 1 | auto call = [&](const auto& type) -> bool { | 289 | 1 | using DispatchType = std::decay_t<decltype(type)>; | 290 | 1 | constexpr PrimitiveType PType = DispatchType::PType; | 291 | 1 | auto array_view = | 292 | 1 | ColumnArrayView<PType>::create(block.get_by_position(arguments[0]).column); | 293 | 1 | auto right_view = | 294 | 1 | ColumnView<PType>::create(block.get_by_position(arguments[1]).column); | 295 | 1 | return_column = _execute_view(array_view, right_view); | 296 | 1 | return true; | 297 | 1 | }; |
Unexecuted instantiation: _ZZNK5doris18FunctionArrayIndexINS_15ArrayCountEqualEE17_execute_dispatchERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE2EEEEEbSC_ Unexecuted instantiation: _ZZNK5doris18FunctionArrayIndexINS_15ArrayCountEqualEE17_execute_dispatchERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE3EEEEEbSC_ Unexecuted instantiation: _ZZNK5doris18FunctionArrayIndexINS_15ArrayCountEqualEE17_execute_dispatchERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE4EEEEEbSC_ _ZZNK5doris18FunctionArrayIndexINS_15ArrayCountEqualEE17_execute_dispatchERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE5EEEEEbSC_ Line | Count | Source | 288 | 1 | auto call = [&](const auto& type) -> bool { | 289 | 1 | using DispatchType = std::decay_t<decltype(type)>; | 290 | 1 | constexpr PrimitiveType PType = DispatchType::PType; | 291 | 1 | auto array_view = | 292 | 1 | ColumnArrayView<PType>::create(block.get_by_position(arguments[0]).column); | 293 | 1 | auto right_view = | 294 | 1 | ColumnView<PType>::create(block.get_by_position(arguments[1]).column); | 295 | 1 | return_column = _execute_view(array_view, right_view); | 296 | 1 | return true; | 297 | 1 | }; |
Unexecuted instantiation: _ZZNK5doris18FunctionArrayIndexINS_15ArrayCountEqualEE17_execute_dispatchERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE6EEEEEbSC_ Unexecuted instantiation: _ZZNK5doris18FunctionArrayIndexINS_15ArrayCountEqualEE17_execute_dispatchERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE7EEEEEbSC_ Unexecuted instantiation: _ZZNK5doris18FunctionArrayIndexINS_15ArrayCountEqualEE17_execute_dispatchERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE8EEEEEbSC_ Unexecuted instantiation: _ZZNK5doris18FunctionArrayIndexINS_15ArrayCountEqualEE17_execute_dispatchERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE9EEEEEbSC_ Unexecuted instantiation: _ZZNK5doris18FunctionArrayIndexINS_15ArrayCountEqualEE17_execute_dispatchERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE28EEEEEbSC_ Unexecuted instantiation: _ZZNK5doris18FunctionArrayIndexINS_15ArrayCountEqualEE17_execute_dispatchERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE29EEEEEbSC_ Unexecuted instantiation: _ZZNK5doris18FunctionArrayIndexINS_15ArrayCountEqualEE17_execute_dispatchERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE20EEEEEbSC_ Unexecuted instantiation: _ZZNK5doris18FunctionArrayIndexINS_15ArrayCountEqualEE17_execute_dispatchERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE30EEEEEbSC_ Unexecuted instantiation: _ZZNK5doris18FunctionArrayIndexINS_15ArrayCountEqualEE17_execute_dispatchERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE35EEEEEbSC_ Unexecuted instantiation: _ZZNK5doris18FunctionArrayIndexINS_15ArrayCountEqualEE17_execute_dispatchERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE11EEEEEbSC_ Unexecuted instantiation: _ZZNK5doris18FunctionArrayIndexINS_15ArrayCountEqualEE17_execute_dispatchERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE25EEEEEbSC_ Unexecuted instantiation: _ZZNK5doris18FunctionArrayIndexINS_15ArrayCountEqualEE17_execute_dispatchERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE26EEEEEbSC_ Unexecuted instantiation: _ZZNK5doris18FunctionArrayIndexINS_15ArrayCountEqualEE17_execute_dispatchERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE12EEEEEbSC_ Unexecuted instantiation: _ZZNK5doris18FunctionArrayIndexINS_15ArrayCountEqualEE17_execute_dispatchERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE27EEEEEbSC_ Unexecuted instantiation: _ZZNK5doris18FunctionArrayIndexINS_15ArrayCountEqualEE17_execute_dispatchERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE42EEEEEbSC_ Unexecuted instantiation: _ZZNK5doris18FunctionArrayIndexINS_15ArrayCountEqualEE17_execute_dispatchERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE36EEEEEbSC_ Unexecuted instantiation: _ZZNK5doris18FunctionArrayIndexINS_15ArrayCountEqualEE17_execute_dispatchERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE37EEEEEbSC_ Unexecuted instantiation: _ZZNK5doris18FunctionArrayIndexINS_15ArrayCountEqualEE17_execute_dispatchERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE23EEEEEbSC_ |
298 | 18 | dispatch_switch_all(left_element_primitive_type, call); |
299 | 18 | } |
300 | | |
301 | 18 | if (return_column) { |
302 | 18 | block.replace_by_position(result, std::move(return_column)); |
303 | 18 | return Status::OK(); |
304 | 18 | } |
305 | 0 | return Status::RuntimeError("execute failed or unsupported types for function {}({}, {})", |
306 | 0 | get_name(), |
307 | 0 | block.get_by_position(arguments[0]).type->get_name(), |
308 | 0 | block.get_by_position(arguments[1]).type->get_name()); |
309 | 18 | } _ZNK5doris18FunctionArrayIndexINS_19ArrayContainsActionEE17_execute_dispatchERNS_5BlockERKSt6vectorIjSaIjEEjm Line | Count | Source | 272 | 11 | size_t input_rows_count) const { | 273 | 11 | if (block.get_by_position(arguments[0]).type->get_primitive_type() != TYPE_ARRAY) { | 274 | 0 | return Status::InvalidArgument(get_name() + " first argument must be array, but got " + | 275 | 0 | block.get_by_position(arguments[0]).type->get_name()); | 276 | 0 | } | 277 | | // execute | 278 | 11 | auto array_type = remove_nullable(block.get_by_position(arguments[0]).type); | 279 | 11 | auto left_element_type = remove_nullable( | 280 | 11 | assert_cast<const DataTypeArray*>(array_type.get())->get_nested_type()); | 281 | 11 | auto right_type = remove_nullable(block.get_by_position(arguments[1]).type); | 282 | | | 283 | 11 | auto left_element_primitive_type = left_element_type->get_primitive_type(); | 284 | 11 | auto right_primitive_type = right_type->get_primitive_type(); | 285 | 11 | ColumnPtr return_column = nullptr; | 286 | 11 | if (right_primitive_type == left_element_primitive_type || | 287 | 11 | (is_string_type(right_primitive_type) && is_string_type(left_element_primitive_type))) { | 288 | 11 | auto call = [&](const auto& type) -> bool { | 289 | 11 | using DispatchType = std::decay_t<decltype(type)>; | 290 | 11 | constexpr PrimitiveType PType = DispatchType::PType; | 291 | 11 | auto array_view = | 292 | 11 | ColumnArrayView<PType>::create(block.get_by_position(arguments[0]).column); | 293 | 11 | auto right_view = | 294 | 11 | ColumnView<PType>::create(block.get_by_position(arguments[1]).column); | 295 | 11 | return_column = _execute_view(array_view, right_view); | 296 | 11 | return true; | 297 | 11 | }; | 298 | 11 | dispatch_switch_all(left_element_primitive_type, call); | 299 | 11 | } | 300 | | | 301 | 11 | if (return_column) { | 302 | 11 | block.replace_by_position(result, std::move(return_column)); | 303 | 11 | return Status::OK(); | 304 | 11 | } | 305 | 0 | return Status::RuntimeError("execute failed or unsupported types for function {}({}, {})", | 306 | 0 | get_name(), | 307 | 0 | block.get_by_position(arguments[0]).type->get_name(), | 308 | 0 | block.get_by_position(arguments[1]).type->get_name()); | 309 | 11 | } |
_ZNK5doris18FunctionArrayIndexINS_19ArrayPositionActionEE17_execute_dispatchERNS_5BlockERKSt6vectorIjSaIjEEjm Line | Count | Source | 272 | 6 | size_t input_rows_count) const { | 273 | 6 | if (block.get_by_position(arguments[0]).type->get_primitive_type() != TYPE_ARRAY) { | 274 | 0 | return Status::InvalidArgument(get_name() + " first argument must be array, but got " + | 275 | 0 | block.get_by_position(arguments[0]).type->get_name()); | 276 | 0 | } | 277 | | // execute | 278 | 6 | auto array_type = remove_nullable(block.get_by_position(arguments[0]).type); | 279 | 6 | auto left_element_type = remove_nullable( | 280 | 6 | assert_cast<const DataTypeArray*>(array_type.get())->get_nested_type()); | 281 | 6 | auto right_type = remove_nullable(block.get_by_position(arguments[1]).type); | 282 | | | 283 | 6 | auto left_element_primitive_type = left_element_type->get_primitive_type(); | 284 | 6 | auto right_primitive_type = right_type->get_primitive_type(); | 285 | 6 | ColumnPtr return_column = nullptr; | 286 | 6 | if (right_primitive_type == left_element_primitive_type || | 287 | 6 | (is_string_type(right_primitive_type) && is_string_type(left_element_primitive_type))) { | 288 | 6 | auto call = [&](const auto& type) -> bool { | 289 | 6 | using DispatchType = std::decay_t<decltype(type)>; | 290 | 6 | constexpr PrimitiveType PType = DispatchType::PType; | 291 | 6 | auto array_view = | 292 | 6 | ColumnArrayView<PType>::create(block.get_by_position(arguments[0]).column); | 293 | 6 | auto right_view = | 294 | 6 | ColumnView<PType>::create(block.get_by_position(arguments[1]).column); | 295 | 6 | return_column = _execute_view(array_view, right_view); | 296 | 6 | return true; | 297 | 6 | }; | 298 | 6 | dispatch_switch_all(left_element_primitive_type, call); | 299 | 6 | } | 300 | | | 301 | 6 | if (return_column) { | 302 | 6 | block.replace_by_position(result, std::move(return_column)); | 303 | 6 | return Status::OK(); | 304 | 6 | } | 305 | 0 | return Status::RuntimeError("execute failed or unsupported types for function {}({}, {})", | 306 | 0 | get_name(), | 307 | 0 | block.get_by_position(arguments[0]).type->get_name(), | 308 | 0 | block.get_by_position(arguments[1]).type->get_name()); | 309 | 6 | } |
_ZNK5doris18FunctionArrayIndexINS_15ArrayCountEqualEE17_execute_dispatchERNS_5BlockERKSt6vectorIjSaIjEEjm Line | Count | Source | 272 | 1 | size_t input_rows_count) const { | 273 | 1 | if (block.get_by_position(arguments[0]).type->get_primitive_type() != TYPE_ARRAY) { | 274 | 0 | return Status::InvalidArgument(get_name() + " first argument must be array, but got " + | 275 | 0 | block.get_by_position(arguments[0]).type->get_name()); | 276 | 0 | } | 277 | | // execute | 278 | 1 | auto array_type = remove_nullable(block.get_by_position(arguments[0]).type); | 279 | 1 | auto left_element_type = remove_nullable( | 280 | 1 | assert_cast<const DataTypeArray*>(array_type.get())->get_nested_type()); | 281 | 1 | auto right_type = remove_nullable(block.get_by_position(arguments[1]).type); | 282 | | | 283 | 1 | auto left_element_primitive_type = left_element_type->get_primitive_type(); | 284 | 1 | auto right_primitive_type = right_type->get_primitive_type(); | 285 | 1 | ColumnPtr return_column = nullptr; | 286 | 1 | if (right_primitive_type == left_element_primitive_type || | 287 | 1 | (is_string_type(right_primitive_type) && is_string_type(left_element_primitive_type))) { | 288 | 1 | auto call = [&](const auto& type) -> bool { | 289 | 1 | using DispatchType = std::decay_t<decltype(type)>; | 290 | 1 | constexpr PrimitiveType PType = DispatchType::PType; | 291 | 1 | auto array_view = | 292 | 1 | ColumnArrayView<PType>::create(block.get_by_position(arguments[0]).column); | 293 | 1 | auto right_view = | 294 | 1 | ColumnView<PType>::create(block.get_by_position(arguments[1]).column); | 295 | 1 | return_column = _execute_view(array_view, right_view); | 296 | 1 | return true; | 297 | 1 | }; | 298 | 1 | dispatch_switch_all(left_element_primitive_type, call); | 299 | 1 | } | 300 | | | 301 | 1 | if (return_column) { | 302 | 1 | block.replace_by_position(result, std::move(return_column)); | 303 | 1 | return Status::OK(); | 304 | 1 | } | 305 | 0 | return Status::RuntimeError("execute failed or unsupported types for function {}({}, {})", | 306 | 0 | get_name(), | 307 | 0 | block.get_by_position(arguments[0]).type->get_name(), | 308 | 0 | block.get_by_position(arguments[1]).type->get_name()); | 309 | 1 | } |
|
310 | | }; |
311 | | |
312 | | } // namespace doris |