be/src/exec/pipeline/dependency.cpp
Line | Count | Source |
1 | | // Licensed to the Apache Software Foundation (ASF) under one |
2 | | // or more contributor license agreements. See the NOTICE file |
3 | | // distributed with this work for additional information |
4 | | // regarding copyright ownership. The ASF licenses this file |
5 | | // to you under the Apache License, Version 2.0 (the |
6 | | // "License"); you may not use this file except in compliance |
7 | | // with the License. You may obtain a copy of the License at |
8 | | // |
9 | | // http://www.apache.org/licenses/LICENSE-2.0 |
10 | | // |
11 | | // Unless required by applicable law or agreed to in writing, |
12 | | // software distributed under the License is distributed on an |
13 | | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
14 | | // KIND, either express or implied. See the License for the |
15 | | // specific language governing permissions and limitations |
16 | | // under the License. |
17 | | |
18 | | #include "exec/pipeline/dependency.h" |
19 | | |
20 | | #include <memory> |
21 | | #include <mutex> |
22 | | |
23 | | #include "common/logging.h" |
24 | | #include "exec/common/util.hpp" |
25 | | #include "exec/operator/multi_cast_data_streamer.h" |
26 | | #include "exec/pipeline/pipeline_fragment_context.h" |
27 | | #include "exec/pipeline/pipeline_task.h" |
28 | | #include "exec/rowid_fetcher.h" |
29 | | #include "exec/runtime_filter/runtime_filter_consumer.h" |
30 | | #include "exec/scan/file_scanner.h" |
31 | | #include "exec/spill/spill_stream_manager.h" |
32 | | #include "exprs/vectorized_agg_fn.h" |
33 | | #include "exprs/vslot_ref.h" |
34 | | #include "runtime/exec_env.h" |
35 | | #include "runtime/memory/mem_tracker.h" |
36 | | #include "util/brpc_client_cache.h" |
37 | | |
38 | | namespace doris { |
39 | | #include "common/compile_check_begin.h" |
40 | | |
41 | | Dependency* BasicSharedState::create_source_dependency(int operator_id, int node_id, |
42 | 661k | const std::string& name) { |
43 | 661k | source_deps.push_back(std::make_shared<Dependency>(operator_id, node_id, name + "_DEPENDENCY")); |
44 | 661k | source_deps.back()->set_shared_state(this); |
45 | 661k | return source_deps.back().get(); |
46 | 661k | } |
47 | | |
48 | | void BasicSharedState::create_source_dependencies(int num_sources, int operator_id, int node_id, |
49 | 131k | const std::string& name) { |
50 | 131k | source_deps.resize(num_sources, nullptr); |
51 | 893k | for (auto& source_dep : source_deps) { |
52 | 893k | source_dep = std::make_shared<Dependency>(operator_id, node_id, name + "_DEPENDENCY"); |
53 | 893k | source_dep->set_shared_state(this); |
54 | 893k | } |
55 | 131k | } |
56 | | |
57 | | Dependency* BasicSharedState::create_sink_dependency(int dest_id, int node_id, |
58 | 1.31M | const std::string& name) { |
59 | 1.31M | sink_deps.push_back(std::make_shared<Dependency>(dest_id, node_id, name + "_DEPENDENCY", true)); |
60 | 1.31M | sink_deps.back()->set_shared_state(this); |
61 | 1.31M | return sink_deps.back().get(); |
62 | 1.31M | } |
63 | | |
64 | 5.61M | void Dependency::_add_block_task(std::shared_ptr<PipelineTask> task) { |
65 | 18.4E | DCHECK(_blocked_task.empty() || _blocked_task[_blocked_task.size() - 1].lock() == nullptr || |
66 | 18.4E | _blocked_task[_blocked_task.size() - 1].lock().get() != task.get()) |
67 | 18.4E | << "Duplicate task: " << task->debug_string(); |
68 | 5.61M | _blocked_task.push_back(task); |
69 | 5.61M | } |
70 | | |
71 | 116M | void Dependency::set_ready() { |
72 | 118M | if (_ready) { |
73 | 118M | return; |
74 | 118M | } |
75 | 18.4E | std::vector<std::weak_ptr<PipelineTask>> local_block_task {}; |
76 | 18.4E | { |
77 | 18.4E | std::unique_lock<std::mutex> lc(_task_lock); |
78 | 18.4E | if (_ready) { |
79 | 465 | return; |
80 | 465 | } |
81 | 18.4E | _watcher.stop(); |
82 | 18.4E | _ready = true; |
83 | 18.4E | local_block_task.swap(_blocked_task); |
84 | 18.4E | } |
85 | 5.62M | for (auto task : local_block_task) { |
86 | 5.62M | if (auto t = task.lock()) { |
87 | 5.62M | std::unique_lock<std::mutex> lc(_task_lock); |
88 | 5.62M | THROW_IF_ERROR(t->wake_up(this, lc)); |
89 | 5.62M | } |
90 | 5.62M | } |
91 | 18.4E | } |
92 | | |
93 | 130M | Dependency* Dependency::is_blocked_by(std::shared_ptr<PipelineTask> task) { |
94 | 130M | std::unique_lock<std::mutex> lc(_task_lock); |
95 | 130M | auto ready = _ready.load(); |
96 | 130M | if (!ready && task) { |
97 | 5.62M | _add_block_task(task); |
98 | 5.62M | start_watcher(); |
99 | 5.62M | THROW_IF_ERROR(task->blocked(this, lc)); |
100 | 5.62M | } |
101 | 130M | return ready ? nullptr : this; |
102 | 130M | } |
103 | | |
104 | 397k | std::string Dependency::debug_string(int indentation_level) { |
105 | 397k | fmt::memory_buffer debug_string_buffer; |
106 | 397k | fmt::format_to(debug_string_buffer, "{}{}: id={}, block task = {}, ready={}, _always_ready={}", |
107 | 397k | std::string(indentation_level * 2, ' '), _name, _node_id, _blocked_task.size(), |
108 | 397k | _ready, _always_ready); |
109 | 397k | return fmt::to_string(debug_string_buffer); |
110 | 397k | } |
111 | | |
112 | 612 | std::string CountedFinishDependency::debug_string(int indentation_level) { |
113 | 612 | fmt::memory_buffer debug_string_buffer; |
114 | 612 | fmt::format_to(debug_string_buffer, |
115 | 612 | "{}{}: id={}, block_task={}, ready={}, _always_ready={}, count={}", |
116 | 612 | std::string(indentation_level * 2, ' '), _name, _node_id, _blocked_task.size(), |
117 | 612 | _ready, _always_ready, _counter); |
118 | 612 | return fmt::to_string(debug_string_buffer); |
119 | 612 | } |
120 | | |
121 | 2.64k | void RuntimeFilterTimer::call_timeout() { |
122 | 2.64k | _parent->set_ready(); |
123 | 2.64k | } |
124 | | |
125 | 77.1k | void RuntimeFilterTimer::call_ready() { |
126 | 77.1k | _parent->set_ready(); |
127 | 77.1k | } |
128 | | |
129 | | // should check rf timeout in two case: |
130 | | // 1. the rf is ready just remove the wait queue |
131 | | // 2. if the rf have local dependency, the rf should start wait when all local dependency is ready |
132 | 12.9M | bool RuntimeFilterTimer::should_be_check_timeout() { |
133 | 12.9M | if (!_parent->ready() && !_local_runtime_filter_dependencies.empty()) { |
134 | 502k | bool all_ready = true; |
135 | 502k | for (auto& dep : _local_runtime_filter_dependencies) { |
136 | 502k | if (!dep->ready()) { |
137 | 502k | all_ready = false; |
138 | 502k | break; |
139 | 502k | } |
140 | 502k | } |
141 | 502k | if (all_ready) { |
142 | 10 | _local_runtime_filter_dependencies.clear(); |
143 | 10 | _registration_time = MonotonicMillis(); |
144 | 10 | } |
145 | 502k | return all_ready; |
146 | 502k | } |
147 | 12.4M | return true; |
148 | 12.9M | } |
149 | | |
150 | 6 | void RuntimeFilterTimerQueue::start() { |
151 | 391k | while (!_stop) { |
152 | 391k | std::unique_lock<std::mutex> lk(cv_m); |
153 | | |
154 | 395k | while (_que.empty() && !_stop) { |
155 | 9.65k | cv.wait_for(lk, std::chrono::seconds(3), [this] { return !_que.empty() || _stop; }); |
156 | 4.82k | } |
157 | 391k | if (_stop) { |
158 | 2 | break; |
159 | 2 | } |
160 | 391k | { |
161 | 391k | std::unique_lock<std::mutex> lc(_que_lock); |
162 | 391k | std::list<std::shared_ptr<RuntimeFilterTimer>> new_que; |
163 | 12.9M | for (auto& it : _que) { |
164 | 12.9M | if (it.use_count() == 1) { |
165 | | // `use_count == 1` means this runtime filter has been released |
166 | 12.9M | } else if (it->should_be_check_timeout()) { |
167 | 12.4M | if (it->force_wait_timeout() || it->_parent->is_blocked_by()) { |
168 | | // This means runtime filter is not ready, so we call timeout or continue to poll this timer. |
169 | 12.4M | int64_t ms_since_registration = MonotonicMillis() - it->registration_time(); |
170 | 12.4M | if (ms_since_registration > it->wait_time_ms()) { |
171 | 2.64k | it->call_timeout(); |
172 | 12.4M | } else { |
173 | 12.4M | new_que.push_back(std::move(it)); |
174 | 12.4M | } |
175 | 12.4M | } |
176 | 12.4M | } else { |
177 | 502k | new_que.push_back(std::move(it)); |
178 | 502k | } |
179 | 12.9M | } |
180 | 391k | new_que.swap(_que); |
181 | 391k | } |
182 | 391k | std::this_thread::sleep_for(std::chrono::milliseconds(interval)); |
183 | 391k | } |
184 | 6 | _shutdown = true; |
185 | 6 | } |
186 | | |
187 | 382k | void LocalExchangeSharedState::sub_running_sink_operators() { |
188 | 382k | std::unique_lock<std::mutex> lc(le_lock); |
189 | 382k | if (exchanger->_running_sink_operators.fetch_sub(1) == 1) { |
190 | 127k | _set_always_ready(); |
191 | 127k | } |
192 | 382k | } |
193 | | |
194 | 867k | void LocalExchangeSharedState::sub_running_source_operators() { |
195 | 867k | std::unique_lock<std::mutex> lc(le_lock); |
196 | 867k | if (exchanger->_running_source_operators.fetch_sub(1) == 1) { |
197 | 127k | _set_always_ready(); |
198 | 127k | exchanger->finalize(); |
199 | 127k | } |
200 | 867k | } |
201 | | |
202 | 127k | LocalExchangeSharedState::LocalExchangeSharedState(int num_instances) { |
203 | 127k | source_deps.resize(num_instances, nullptr); |
204 | 127k | mem_counters.resize(num_instances, nullptr); |
205 | 127k | } |
206 | | |
207 | 258 | MutableColumns AggSharedState::_get_keys_hash_table() { |
208 | 258 | return std::visit( |
209 | 258 | Overload {[&](std::monostate& arg) { |
210 | 0 | throw doris::Exception(ErrorCode::INTERNAL_ERROR, "uninited hash table"); |
211 | 0 | return MutableColumns(); |
212 | 0 | }, |
213 | 258 | [&](auto&& agg_method) -> MutableColumns { |
214 | 258 | MutableColumns key_columns; |
215 | 673 | for (int i = 0; i < probe_expr_ctxs.size(); ++i) { |
216 | 415 | key_columns.emplace_back( |
217 | 415 | probe_expr_ctxs[i]->root()->data_type()->create_column()); |
218 | 415 | } |
219 | 258 | auto& data = *agg_method.hash_table; |
220 | 258 | bool has_null_key = data.has_null_key_data(); |
221 | 258 | const auto size = data.size() - has_null_key; |
222 | 258 | using KeyType = std::decay_t<decltype(agg_method)>::Key; |
223 | 258 | std::vector<KeyType> keys(size); |
224 | | |
225 | 258 | uint32_t num_rows = 0; |
226 | 258 | auto iter = aggregate_data_container->begin(); |
227 | 258 | { |
228 | 47.5k | while (iter != aggregate_data_container->end()) { |
229 | 47.3k | keys[num_rows] = iter.get_key<KeyType>(); |
230 | 47.3k | ++iter; |
231 | 47.3k | ++num_rows; |
232 | 47.3k | } |
233 | 258 | } |
234 | 258 | agg_method.insert_keys_into_columns(keys, key_columns, num_rows); |
235 | 258 | if (has_null_key) { |
236 | 4 | key_columns[0]->insert_data(nullptr, 0); |
237 | 4 | } |
238 | 258 | return key_columns; |
239 | 258 | }}, dependency.cpp:_ZZN5doris14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_16MethodSerializedI9PHHashMapINS_9StringRefEPc11DefaultHashIS5_vEEEEEESt6vectorINS_3COWINS_7IColumnEE11mutable_ptrISE_EESaISH_EEOT_ Line | Count | Source | 213 | 26 | [&](auto&& agg_method) -> MutableColumns { | 214 | 26 | MutableColumns key_columns; | 215 | 98 | for (int i = 0; i < probe_expr_ctxs.size(); ++i) { | 216 | 72 | key_columns.emplace_back( | 217 | 72 | probe_expr_ctxs[i]->root()->data_type()->create_column()); | 218 | 72 | } | 219 | 26 | auto& data = *agg_method.hash_table; | 220 | 26 | bool has_null_key = data.has_null_key_data(); | 221 | 26 | const auto size = data.size() - has_null_key; | 222 | 26 | using KeyType = std::decay_t<decltype(agg_method)>::Key; | 223 | 26 | std::vector<KeyType> keys(size); | 224 | | | 225 | 26 | uint32_t num_rows = 0; | 226 | 26 | auto iter = aggregate_data_container->begin(); | 227 | 26 | { | 228 | 24.4k | while (iter != aggregate_data_container->end()) { | 229 | 24.4k | keys[num_rows] = iter.get_key<KeyType>(); | 230 | 24.4k | ++iter; | 231 | 24.4k | ++num_rows; | 232 | 24.4k | } | 233 | 26 | } | 234 | 26 | agg_method.insert_keys_into_columns(keys, key_columns, num_rows); | 235 | 26 | if (has_null_key) { | 236 | 0 | key_columns[0]->insert_data(nullptr, 0); | 237 | 0 | } | 238 | 26 | return key_columns; | 239 | 26 | }}, |
Unexecuted instantiation: dependency.cpp:_ZZN5doris14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_15MethodOneNumberIh9PHHashMapIhPc9HashCRC32IhEEEEEESt6vectorINS_3COWINS_7IColumnEE11mutable_ptrISD_EESaISG_EEOT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_15MethodOneNumberIt9PHHashMapItPc9HashCRC32ItEEEEEESt6vectorINS_3COWINS_7IColumnEE11mutable_ptrISD_EESaISG_EEOT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_15MethodOneNumberIj9PHHashMapIjPc9HashCRC32IjEEEEEESt6vectorINS_3COWINS_7IColumnEE11mutable_ptrISD_EESaISG_EEOT_ dependency.cpp:_ZZN5doris14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_15MethodOneNumberIm9PHHashMapImPc9HashCRC32ImEEEEEESt6vectorINS_3COWINS_7IColumnEE11mutable_ptrISD_EESaISG_EEOT_ Line | Count | Source | 213 | 2 | [&](auto&& agg_method) -> MutableColumns { | 214 | 2 | MutableColumns key_columns; | 215 | 4 | for (int i = 0; i < probe_expr_ctxs.size(); ++i) { | 216 | 2 | key_columns.emplace_back( | 217 | 2 | probe_expr_ctxs[i]->root()->data_type()->create_column()); | 218 | 2 | } | 219 | 2 | auto& data = *agg_method.hash_table; | 220 | 2 | bool has_null_key = data.has_null_key_data(); | 221 | 2 | const auto size = data.size() - has_null_key; | 222 | 2 | using KeyType = std::decay_t<decltype(agg_method)>::Key; | 223 | 2 | std::vector<KeyType> keys(size); | 224 | | | 225 | 2 | uint32_t num_rows = 0; | 226 | 2 | auto iter = aggregate_data_container->begin(); | 227 | 2 | { | 228 | 12 | while (iter != aggregate_data_container->end()) { | 229 | 10 | keys[num_rows] = iter.get_key<KeyType>(); | 230 | 10 | ++iter; | 231 | 10 | ++num_rows; | 232 | 10 | } | 233 | 2 | } | 234 | 2 | agg_method.insert_keys_into_columns(keys, key_columns, num_rows); | 235 | 2 | if (has_null_key) { | 236 | 0 | key_columns[0]->insert_data(nullptr, 0); | 237 | 0 | } | 238 | 2 | return key_columns; | 239 | 2 | }}, |
Unexecuted instantiation: dependency.cpp:_ZZN5doris14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_19MethodStringNoCacheINS_13StringHashMapIPcNS_9AllocatorILb1ELb1ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEEEEESt6vectorINS_3COWINS_7IColumnEE11mutable_ptrISE_EESaISH_EEOT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_15MethodOneNumberIN4wide7integerILm128EjEE9PHHashMapIS6_Pc9HashCRC32IS6_EEEEEESt6vectorINS_3COWINS_7IColumnEE11mutable_ptrISG_EESaISJ_EEOT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_15MethodOneNumberIN4wide7integerILm256EjEE9PHHashMapIS6_Pc9HashCRC32IS6_EEEEEESt6vectorINS_3COWINS_7IColumnEE11mutable_ptrISG_EESaISJ_EEOT_ dependency.cpp:_ZZN5doris14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_15MethodOneNumberIj9PHHashMapIjPc14HashMixWrapperIj9HashCRC32IjEEEEEEESt6vectorINS_3COWINS_7IColumnEE11mutable_ptrISF_EESaISI_EEOT_ Line | Count | Source | 213 | 6 | [&](auto&& agg_method) -> MutableColumns { | 214 | 6 | MutableColumns key_columns; | 215 | 12 | for (int i = 0; i < probe_expr_ctxs.size(); ++i) { | 216 | 6 | key_columns.emplace_back( | 217 | 6 | probe_expr_ctxs[i]->root()->data_type()->create_column()); | 218 | 6 | } | 219 | 6 | auto& data = *agg_method.hash_table; | 220 | 6 | bool has_null_key = data.has_null_key_data(); | 221 | 6 | const auto size = data.size() - has_null_key; | 222 | 6 | using KeyType = std::decay_t<decltype(agg_method)>::Key; | 223 | 6 | std::vector<KeyType> keys(size); | 224 | | | 225 | 6 | uint32_t num_rows = 0; | 226 | 6 | auto iter = aggregate_data_container->begin(); | 227 | 6 | { | 228 | 12 | while (iter != aggregate_data_container->end()) { | 229 | 6 | keys[num_rows] = iter.get_key<KeyType>(); | 230 | 6 | ++iter; | 231 | 6 | ++num_rows; | 232 | 6 | } | 233 | 6 | } | 234 | 6 | agg_method.insert_keys_into_columns(keys, key_columns, num_rows); | 235 | 6 | if (has_null_key) { | 236 | 0 | key_columns[0]->insert_data(nullptr, 0); | 237 | 0 | } | 238 | 6 | return key_columns; | 239 | 6 | }}, |
dependency.cpp:_ZZN5doris14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_15MethodOneNumberIm9PHHashMapImPc14HashMixWrapperIm9HashCRC32ImEEEEEEESt6vectorINS_3COWINS_7IColumnEE11mutable_ptrISF_EESaISI_EEOT_ Line | Count | Source | 213 | 6 | [&](auto&& agg_method) -> MutableColumns { | 214 | 6 | MutableColumns key_columns; | 215 | 12 | for (int i = 0; i < probe_expr_ctxs.size(); ++i) { | 216 | 6 | key_columns.emplace_back( | 217 | 6 | probe_expr_ctxs[i]->root()->data_type()->create_column()); | 218 | 6 | } | 219 | 6 | auto& data = *agg_method.hash_table; | 220 | 6 | bool has_null_key = data.has_null_key_data(); | 221 | 6 | const auto size = data.size() - has_null_key; | 222 | 6 | using KeyType = std::decay_t<decltype(agg_method)>::Key; | 223 | 6 | std::vector<KeyType> keys(size); | 224 | | | 225 | 6 | uint32_t num_rows = 0; | 226 | 6 | auto iter = aggregate_data_container->begin(); | 227 | 6 | { | 228 | 33 | while (iter != aggregate_data_container->end()) { | 229 | 27 | keys[num_rows] = iter.get_key<KeyType>(); | 230 | 27 | ++iter; | 231 | 27 | ++num_rows; | 232 | 27 | } | 233 | 6 | } | 234 | 6 | agg_method.insert_keys_into_columns(keys, key_columns, num_rows); | 235 | 6 | if (has_null_key) { | 236 | 0 | key_columns[0]->insert_data(nullptr, 0); | 237 | 0 | } | 238 | 6 | return key_columns; | 239 | 6 | }}, |
dependency.cpp:_ZZN5doris14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_26MethodSingleNullableColumnINS_15MethodOneNumberIhNS_15DataWithNullKeyI9PHHashMapIhPc9HashCRC32IhEEEEEEEEEESt6vectorINS_3COWINS_7IColumnEE11mutable_ptrISH_EESaISK_EEOT_ Line | Count | Source | 213 | 3 | [&](auto&& agg_method) -> MutableColumns { | 214 | 3 | MutableColumns key_columns; | 215 | 6 | for (int i = 0; i < probe_expr_ctxs.size(); ++i) { | 216 | 3 | key_columns.emplace_back( | 217 | 3 | probe_expr_ctxs[i]->root()->data_type()->create_column()); | 218 | 3 | } | 219 | 3 | auto& data = *agg_method.hash_table; | 220 | 3 | bool has_null_key = data.has_null_key_data(); | 221 | 3 | const auto size = data.size() - has_null_key; | 222 | 3 | using KeyType = std::decay_t<decltype(agg_method)>::Key; | 223 | 3 | std::vector<KeyType> keys(size); | 224 | | | 225 | 3 | uint32_t num_rows = 0; | 226 | 3 | auto iter = aggregate_data_container->begin(); | 227 | 3 | { | 228 | 13 | while (iter != aggregate_data_container->end()) { | 229 | 10 | keys[num_rows] = iter.get_key<KeyType>(); | 230 | 10 | ++iter; | 231 | 10 | ++num_rows; | 232 | 10 | } | 233 | 3 | } | 234 | 3 | agg_method.insert_keys_into_columns(keys, key_columns, num_rows); | 235 | 3 | if (has_null_key) { | 236 | 0 | key_columns[0]->insert_data(nullptr, 0); | 237 | 0 | } | 238 | 3 | return key_columns; | 239 | 3 | }}, |
Unexecuted instantiation: dependency.cpp:_ZZN5doris14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_26MethodSingleNullableColumnINS_15MethodOneNumberItNS_15DataWithNullKeyI9PHHashMapItPc9HashCRC32ItEEEEEEEEEESt6vectorINS_3COWINS_7IColumnEE11mutable_ptrISH_EESaISK_EEOT_ dependency.cpp:_ZZN5doris14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_26MethodSingleNullableColumnINS_15MethodOneNumberIjNS_15DataWithNullKeyI9PHHashMapIjPc9HashCRC32IjEEEEEEEEEESt6vectorINS_3COWINS_7IColumnEE11mutable_ptrISH_EESaISK_EEOT_ Line | Count | Source | 213 | 5 | [&](auto&& agg_method) -> MutableColumns { | 214 | 5 | MutableColumns key_columns; | 215 | 10 | for (int i = 0; i < probe_expr_ctxs.size(); ++i) { | 216 | 5 | key_columns.emplace_back( | 217 | 5 | probe_expr_ctxs[i]->root()->data_type()->create_column()); | 218 | 5 | } | 219 | 5 | auto& data = *agg_method.hash_table; | 220 | 5 | bool has_null_key = data.has_null_key_data(); | 221 | 5 | const auto size = data.size() - has_null_key; | 222 | 5 | using KeyType = std::decay_t<decltype(agg_method)>::Key; | 223 | 5 | std::vector<KeyType> keys(size); | 224 | | | 225 | 5 | uint32_t num_rows = 0; | 226 | 5 | auto iter = aggregate_data_container->begin(); | 227 | 5 | { | 228 | 2.34k | while (iter != aggregate_data_container->end()) { | 229 | 2.33k | keys[num_rows] = iter.get_key<KeyType>(); | 230 | 2.33k | ++iter; | 231 | 2.33k | ++num_rows; | 232 | 2.33k | } | 233 | 5 | } | 234 | 5 | agg_method.insert_keys_into_columns(keys, key_columns, num_rows); | 235 | 5 | if (has_null_key) { | 236 | 0 | key_columns[0]->insert_data(nullptr, 0); | 237 | 0 | } | 238 | 5 | return key_columns; | 239 | 5 | }}, |
dependency.cpp:_ZZN5doris14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_26MethodSingleNullableColumnINS_15MethodOneNumberImNS_15DataWithNullKeyI9PHHashMapImPc9HashCRC32ImEEEEEEEEEESt6vectorINS_3COWINS_7IColumnEE11mutable_ptrISH_EESaISK_EEOT_ Line | Count | Source | 213 | 5 | [&](auto&& agg_method) -> MutableColumns { | 214 | 5 | MutableColumns key_columns; | 215 | 10 | for (int i = 0; i < probe_expr_ctxs.size(); ++i) { | 216 | 5 | key_columns.emplace_back( | 217 | 5 | probe_expr_ctxs[i]->root()->data_type()->create_column()); | 218 | 5 | } | 219 | 5 | auto& data = *agg_method.hash_table; | 220 | 5 | bool has_null_key = data.has_null_key_data(); | 221 | 5 | const auto size = data.size() - has_null_key; | 222 | 5 | using KeyType = std::decay_t<decltype(agg_method)>::Key; | 223 | 5 | std::vector<KeyType> keys(size); | 224 | | | 225 | 5 | uint32_t num_rows = 0; | 226 | 5 | auto iter = aggregate_data_container->begin(); | 227 | 5 | { | 228 | 2.35k | while (iter != aggregate_data_container->end()) { | 229 | 2.34k | keys[num_rows] = iter.get_key<KeyType>(); | 230 | 2.34k | ++iter; | 231 | 2.34k | ++num_rows; | 232 | 2.34k | } | 233 | 5 | } | 234 | 5 | agg_method.insert_keys_into_columns(keys, key_columns, num_rows); | 235 | 5 | if (has_null_key) { | 236 | 0 | key_columns[0]->insert_data(nullptr, 0); | 237 | 0 | } | 238 | 5 | return key_columns; | 239 | 5 | }}, |
dependency.cpp:_ZZN5doris14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_26MethodSingleNullableColumnINS_15MethodOneNumberIjNS_15DataWithNullKeyI9PHHashMapIjPc14HashMixWrapperIj9HashCRC32IjEEEEEEEEEEESt6vectorINS_3COWINS_7IColumnEE11mutable_ptrISJ_EESaISM_EEOT_ Line | Count | Source | 213 | 65 | [&](auto&& agg_method) -> MutableColumns { | 214 | 65 | MutableColumns key_columns; | 215 | 130 | for (int i = 0; i < probe_expr_ctxs.size(); ++i) { | 216 | 65 | key_columns.emplace_back( | 217 | 65 | probe_expr_ctxs[i]->root()->data_type()->create_column()); | 218 | 65 | } | 219 | 65 | auto& data = *agg_method.hash_table; | 220 | 65 | bool has_null_key = data.has_null_key_data(); | 221 | 65 | const auto size = data.size() - has_null_key; | 222 | 65 | using KeyType = std::decay_t<decltype(agg_method)>::Key; | 223 | 65 | std::vector<KeyType> keys(size); | 224 | | | 225 | 65 | uint32_t num_rows = 0; | 226 | 65 | auto iter = aggregate_data_container->begin(); | 227 | 65 | { | 228 | 5.30k | while (iter != aggregate_data_container->end()) { | 229 | 5.24k | keys[num_rows] = iter.get_key<KeyType>(); | 230 | 5.24k | ++iter; | 231 | 5.24k | ++num_rows; | 232 | 5.24k | } | 233 | 65 | } | 234 | 65 | agg_method.insert_keys_into_columns(keys, key_columns, num_rows); | 235 | 65 | if (has_null_key) { | 236 | 3 | key_columns[0]->insert_data(nullptr, 0); | 237 | 3 | } | 238 | 65 | return key_columns; | 239 | 65 | }}, |
dependency.cpp:_ZZN5doris14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_26MethodSingleNullableColumnINS_15MethodOneNumberImNS_15DataWithNullKeyI9PHHashMapImPc14HashMixWrapperIm9HashCRC32ImEEEEEEEEEEESt6vectorINS_3COWINS_7IColumnEE11mutable_ptrISJ_EESaISM_EEOT_ Line | Count | Source | 213 | 46 | [&](auto&& agg_method) -> MutableColumns { | 214 | 46 | MutableColumns key_columns; | 215 | 92 | for (int i = 0; i < probe_expr_ctxs.size(); ++i) { | 216 | 46 | key_columns.emplace_back( | 217 | 46 | probe_expr_ctxs[i]->root()->data_type()->create_column()); | 218 | 46 | } | 219 | 46 | auto& data = *agg_method.hash_table; | 220 | 46 | bool has_null_key = data.has_null_key_data(); | 221 | 46 | const auto size = data.size() - has_null_key; | 222 | 46 | using KeyType = std::decay_t<decltype(agg_method)>::Key; | 223 | 46 | std::vector<KeyType> keys(size); | 224 | | | 225 | 46 | uint32_t num_rows = 0; | 226 | 46 | auto iter = aggregate_data_container->begin(); | 227 | 46 | { | 228 | 9.14k | while (iter != aggregate_data_container->end()) { | 229 | 9.09k | keys[num_rows] = iter.get_key<KeyType>(); | 230 | 9.09k | ++iter; | 231 | 9.09k | ++num_rows; | 232 | 9.09k | } | 233 | 46 | } | 234 | 46 | agg_method.insert_keys_into_columns(keys, key_columns, num_rows); | 235 | 46 | if (has_null_key) { | 236 | 1 | key_columns[0]->insert_data(nullptr, 0); | 237 | 1 | } | 238 | 46 | return key_columns; | 239 | 46 | }}, |
dependency.cpp:_ZZN5doris14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_26MethodSingleNullableColumnINS_15MethodOneNumberIN4wide7integerILm128EjEENS_15DataWithNullKeyI9PHHashMapIS7_Pc9HashCRC32IS7_EEEEEEEEEESt6vectorINS_3COWINS_7IColumnEE11mutable_ptrISK_EESaISN_EEOT_ Line | Count | Source | 213 | 1 | [&](auto&& agg_method) -> MutableColumns { | 214 | 1 | MutableColumns key_columns; | 215 | 2 | for (int i = 0; i < probe_expr_ctxs.size(); ++i) { | 216 | 1 | key_columns.emplace_back( | 217 | 1 | probe_expr_ctxs[i]->root()->data_type()->create_column()); | 218 | 1 | } | 219 | 1 | auto& data = *agg_method.hash_table; | 220 | 1 | bool has_null_key = data.has_null_key_data(); | 221 | 1 | const auto size = data.size() - has_null_key; | 222 | 1 | using KeyType = std::decay_t<decltype(agg_method)>::Key; | 223 | 1 | std::vector<KeyType> keys(size); | 224 | | | 225 | 1 | uint32_t num_rows = 0; | 226 | 1 | auto iter = aggregate_data_container->begin(); | 227 | 1 | { | 228 | 4 | while (iter != aggregate_data_container->end()) { | 229 | 3 | keys[num_rows] = iter.get_key<KeyType>(); | 230 | 3 | ++iter; | 231 | 3 | ++num_rows; | 232 | 3 | } | 233 | 1 | } | 234 | 1 | agg_method.insert_keys_into_columns(keys, key_columns, num_rows); | 235 | 1 | if (has_null_key) { | 236 | 0 | key_columns[0]->insert_data(nullptr, 0); | 237 | 0 | } | 238 | 1 | return key_columns; | 239 | 1 | }}, |
Unexecuted instantiation: dependency.cpp:_ZZN5doris14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_26MethodSingleNullableColumnINS_15MethodOneNumberIN4wide7integerILm256EjEENS_15DataWithNullKeyI9PHHashMapIS7_Pc9HashCRC32IS7_EEEEEEEEEESt6vectorINS_3COWINS_7IColumnEE11mutable_ptrISK_EESaISN_EEOT_ dependency.cpp:_ZZN5doris14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_26MethodSingleNullableColumnINS_19MethodStringNoCacheINS_15DataWithNullKeyINS_13StringHashMapIPcNS_9AllocatorILb1ELb1ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEEEEEEEEESt6vectorINS_3COWINS_7IColumnEE11mutable_ptrISI_EESaISL_EEOT_ Line | Count | Source | 213 | 32 | [&](auto&& agg_method) -> MutableColumns { | 214 | 32 | MutableColumns key_columns; | 215 | 64 | for (int i = 0; i < probe_expr_ctxs.size(); ++i) { | 216 | 32 | key_columns.emplace_back( | 217 | 32 | probe_expr_ctxs[i]->root()->data_type()->create_column()); | 218 | 32 | } | 219 | 32 | auto& data = *agg_method.hash_table; | 220 | 32 | bool has_null_key = data.has_null_key_data(); | 221 | 32 | const auto size = data.size() - has_null_key; | 222 | 32 | using KeyType = std::decay_t<decltype(agg_method)>::Key; | 223 | 32 | std::vector<KeyType> keys(size); | 224 | | | 225 | 32 | uint32_t num_rows = 0; | 226 | 32 | auto iter = aggregate_data_container->begin(); | 227 | 32 | { | 228 | 1.48k | while (iter != aggregate_data_container->end()) { | 229 | 1.45k | keys[num_rows] = iter.get_key<KeyType>(); | 230 | 1.45k | ++iter; | 231 | 1.45k | ++num_rows; | 232 | 1.45k | } | 233 | 32 | } | 234 | 32 | agg_method.insert_keys_into_columns(keys, key_columns, num_rows); | 235 | 32 | if (has_null_key) { | 236 | 0 | key_columns[0]->insert_data(nullptr, 0); | 237 | 0 | } | 238 | 32 | return key_columns; | 239 | 32 | }}, |
Unexecuted instantiation: dependency.cpp:_ZZN5doris14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_15MethodKeysFixedI9PHHashMapImPc9HashCRC32ImEEEEEESt6vectorINS_3COWINS_7IColumnEE11mutable_ptrISD_EESaISG_EEOT_ dependency.cpp:_ZZN5doris14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_15MethodKeysFixedI9PHHashMapINS_6UInt72EPc9HashCRC32IS5_EEEEEESt6vectorINS_3COWINS_7IColumnEE11mutable_ptrISE_EESaISH_EEOT_ Line | Count | Source | 213 | 1 | [&](auto&& agg_method) -> MutableColumns { | 214 | 1 | MutableColumns key_columns; | 215 | 3 | for (int i = 0; i < probe_expr_ctxs.size(); ++i) { | 216 | 2 | key_columns.emplace_back( | 217 | 2 | probe_expr_ctxs[i]->root()->data_type()->create_column()); | 218 | 2 | } | 219 | 1 | auto& data = *agg_method.hash_table; | 220 | 1 | bool has_null_key = data.has_null_key_data(); | 221 | 1 | const auto size = data.size() - has_null_key; | 222 | 1 | using KeyType = std::decay_t<decltype(agg_method)>::Key; | 223 | 1 | std::vector<KeyType> keys(size); | 224 | | | 225 | 1 | uint32_t num_rows = 0; | 226 | 1 | auto iter = aggregate_data_container->begin(); | 227 | 1 | { | 228 | 7 | while (iter != aggregate_data_container->end()) { | 229 | 6 | keys[num_rows] = iter.get_key<KeyType>(); | 230 | 6 | ++iter; | 231 | 6 | ++num_rows; | 232 | 6 | } | 233 | 1 | } | 234 | 1 | agg_method.insert_keys_into_columns(keys, key_columns, num_rows); | 235 | 1 | if (has_null_key) { | 236 | 0 | key_columns[0]->insert_data(nullptr, 0); | 237 | 0 | } | 238 | 1 | return key_columns; | 239 | 1 | }}, |
Unexecuted instantiation: dependency.cpp:_ZZN5doris14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_15MethodKeysFixedI9PHHashMapINS_6UInt96EPc9HashCRC32IS5_EEEEEESt6vectorINS_3COWINS_7IColumnEE11mutable_ptrISE_EESaISH_EEOT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_15MethodKeysFixedI9PHHashMapINS_7UInt104EPc9HashCRC32IS5_EEEEEESt6vectorINS_3COWINS_7IColumnEE11mutable_ptrISE_EESaISH_EEOT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_15MethodKeysFixedI9PHHashMapIN4wide7integerILm128EjEEPc9HashCRC32IS7_EEEEEESt6vectorINS_3COWINS_7IColumnEE11mutable_ptrISG_EESaISJ_EEOT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_15MethodKeysFixedI9PHHashMapINS_7UInt136EPc9HashCRC32IS5_EEEEEESt6vectorINS_3COWINS_7IColumnEE11mutable_ptrISE_EESaISH_EEOT_ dependency.cpp:_ZZN5doris14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_15MethodKeysFixedI9PHHashMapIN4wide7integerILm256EjEEPc9HashCRC32IS7_EEEEEESt6vectorINS_3COWINS_7IColumnEE11mutable_ptrISG_EESaISJ_EEOT_ Line | Count | Source | 213 | 60 | [&](auto&& agg_method) -> MutableColumns { | 214 | 60 | MutableColumns key_columns; | 215 | 230 | for (int i = 0; i < probe_expr_ctxs.size(); ++i) { | 216 | 170 | key_columns.emplace_back( | 217 | 170 | probe_expr_ctxs[i]->root()->data_type()->create_column()); | 218 | 170 | } | 219 | 60 | auto& data = *agg_method.hash_table; | 220 | 60 | bool has_null_key = data.has_null_key_data(); | 221 | 60 | const auto size = data.size() - has_null_key; | 222 | 60 | using KeyType = std::decay_t<decltype(agg_method)>::Key; | 223 | 60 | std::vector<KeyType> keys(size); | 224 | | | 225 | 60 | uint32_t num_rows = 0; | 226 | 60 | auto iter = aggregate_data_container->begin(); | 227 | 60 | { | 228 | 2.40k | while (iter != aggregate_data_container->end()) { | 229 | 2.34k | keys[num_rows] = iter.get_key<KeyType>(); | 230 | 2.34k | ++iter; | 231 | 2.34k | ++num_rows; | 232 | 2.34k | } | 233 | 60 | } | 234 | 60 | agg_method.insert_keys_into_columns(keys, key_columns, num_rows); | 235 | 60 | if (has_null_key) { | 236 | 0 | key_columns[0]->insert_data(nullptr, 0); | 237 | 0 | } | 238 | 60 | return key_columns; | 239 | 60 | }}, |
|
240 | 258 | agg_data->method_variant); |
241 | 258 | } |
242 | | |
243 | 258 | void AggSharedState::build_limit_heap(size_t hash_table_size) { |
244 | 258 | limit_columns = _get_keys_hash_table(); |
245 | 47.3k | for (size_t i = 0; i < hash_table_size; ++i) { |
246 | 47.1k | limit_heap.emplace(i, limit_columns, order_directions, null_directions); |
247 | 47.1k | } |
248 | 46.0k | while (hash_table_size > limit) { |
249 | 45.7k | limit_heap.pop(); |
250 | 45.7k | hash_table_size--; |
251 | 45.7k | } |
252 | 258 | limit_columns_min = limit_heap.top()._row_id; |
253 | 258 | } |
254 | | |
255 | | bool AggSharedState::do_limit_filter(Block* block, size_t num_rows, |
256 | 740 | const std::vector<int>* key_locs) { |
257 | 740 | if (num_rows) { |
258 | 740 | cmp_res.resize(num_rows); |
259 | 740 | need_computes.resize(num_rows); |
260 | 740 | memset(need_computes.data(), 0, need_computes.size()); |
261 | 740 | memset(cmp_res.data(), 0, cmp_res.size()); |
262 | | |
263 | 740 | const auto key_size = null_directions.size(); |
264 | 2.30k | for (int i = 0; i < key_size; i++) { |
265 | 1.56k | block->get_by_position(key_locs ? key_locs->operator[](i) : i) |
266 | 1.56k | .column->compare_internal(limit_columns_min, *limit_columns[i], |
267 | 1.56k | null_directions[i], order_directions[i], cmp_res, |
268 | 1.56k | need_computes.data()); |
269 | 1.56k | } |
270 | | |
271 | 740 | auto set_computes_arr = [](auto* __restrict res, auto* __restrict computes, size_t rows) { |
272 | 630k | for (size_t i = 0; i < rows; ++i) { |
273 | 630k | computes[i] = computes[i] == res[i]; |
274 | 630k | } |
275 | 740 | }; |
276 | 740 | set_computes_arr(cmp_res.data(), need_computes.data(), num_rows); |
277 | | |
278 | 740 | return std::find(need_computes.begin(), need_computes.end(), 0) != need_computes.end(); |
279 | 740 | } |
280 | | |
281 | 0 | return false; |
282 | 740 | } |
283 | | |
284 | 15 | Status AggSharedState::reset_hash_table() { |
285 | 15 | return std::visit( |
286 | 15 | Overload {[&](std::monostate& arg) -> Status { |
287 | 0 | return Status::InternalError("Uninited hash table"); |
288 | 0 | }, |
289 | 15 | [&](auto& agg_method) { |
290 | 15 | auto& hash_table = *agg_method.hash_table; |
291 | 15 | using HashTableType = std::decay_t<decltype(hash_table)>; |
292 | | |
293 | 15 | agg_method.arena.clear(); |
294 | 15 | agg_method.inited_iterator = false; |
295 | | |
296 | 1.04M | hash_table.for_each_mapped([&](auto& mapped) { |
297 | 1.04M | if (mapped) { |
298 | 1.04M | _destroy_agg_status(mapped); |
299 | 1.04M | mapped = nullptr; |
300 | 1.04M | } |
301 | 1.04M | }); Unexecuted instantiation: dependency.cpp:_ZZZN5doris14AggSharedState16reset_hash_tableEvENK3$_1clINS_16MethodSerializedI9PHHashMapINS_9StringRefEPc11DefaultHashIS5_vEEEEEEDaRT_ENKUlSC_E_clIS6_EEDaSC_ Unexecuted instantiation: dependency.cpp:_ZZZN5doris14AggSharedState16reset_hash_tableEvENK3$_1clINS_15MethodOneNumberIh9PHHashMapIhPc9HashCRC32IhEEEEEEDaRT_ENKUlSB_E_clIS5_EEDaSB_ Unexecuted instantiation: dependency.cpp:_ZZZN5doris14AggSharedState16reset_hash_tableEvENK3$_1clINS_15MethodOneNumberIt9PHHashMapItPc9HashCRC32ItEEEEEEDaRT_ENKUlSB_E_clIS5_EEDaSB_ Unexecuted instantiation: dependency.cpp:_ZZZN5doris14AggSharedState16reset_hash_tableEvENK3$_1clINS_15MethodOneNumberIj9PHHashMapIjPc9HashCRC32IjEEEEEEDaRT_ENKUlSB_E_clIS5_EEDaSB_ Unexecuted instantiation: dependency.cpp:_ZZZN5doris14AggSharedState16reset_hash_tableEvENK3$_1clINS_15MethodOneNumberIm9PHHashMapImPc9HashCRC32ImEEEEEEDaRT_ENKUlSB_E_clIS5_EEDaSB_ Unexecuted instantiation: dependency.cpp:_ZZZN5doris14AggSharedState16reset_hash_tableEvENK3$_1clINS_19MethodStringNoCacheINS_13StringHashMapIPcNS_9AllocatorILb1ELb1ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEEEEEDaRT_ENKUlSC_E_clIS5_EEDaSC_ Unexecuted instantiation: dependency.cpp:_ZZZN5doris14AggSharedState16reset_hash_tableEvENK3$_1clINS_15MethodOneNumberIN4wide7integerILm128EjEE9PHHashMapIS6_Pc9HashCRC32IS6_EEEEEEDaRT_ENKUlSE_E_clIS8_EEDaSE_ Unexecuted instantiation: dependency.cpp:_ZZZN5doris14AggSharedState16reset_hash_tableEvENK3$_1clINS_15MethodOneNumberIN4wide7integerILm256EjEE9PHHashMapIS6_Pc9HashCRC32IS6_EEEEEEDaRT_ENKUlSE_E_clIS8_EEDaSE_ dependency.cpp:_ZZZN5doris14AggSharedState16reset_hash_tableEvENK3$_1clINS_15MethodOneNumberIj9PHHashMapIjPc14HashMixWrapperIj9HashCRC32IjEEEEEEEDaRT_ENKUlSD_E_clIS5_EEDaSD_ Line | Count | Source | 296 | 1.04M | hash_table.for_each_mapped([&](auto& mapped) { | 297 | 1.04M | if (mapped) { | 298 | 1.04M | _destroy_agg_status(mapped); | 299 | 1.04M | mapped = nullptr; | 300 | 1.04M | } | 301 | 1.04M | }); |
Unexecuted instantiation: dependency.cpp:_ZZZN5doris14AggSharedState16reset_hash_tableEvENK3$_1clINS_15MethodOneNumberIm9PHHashMapImPc14HashMixWrapperIm9HashCRC32ImEEEEEEEDaRT_ENKUlSD_E_clIS5_EEDaSD_ Unexecuted instantiation: dependency.cpp:_ZZZN5doris14AggSharedState16reset_hash_tableEvENK3$_1clINS_26MethodSingleNullableColumnINS_15MethodOneNumberIhNS_15DataWithNullKeyI9PHHashMapIhPc9HashCRC32IhEEEEEEEEEEDaRT_ENKUlSF_E_clIS7_EEDaSF_ Unexecuted instantiation: dependency.cpp:_ZZZN5doris14AggSharedState16reset_hash_tableEvENK3$_1clINS_26MethodSingleNullableColumnINS_15MethodOneNumberItNS_15DataWithNullKeyI9PHHashMapItPc9HashCRC32ItEEEEEEEEEEDaRT_ENKUlSF_E_clIS7_EEDaSF_ Unexecuted instantiation: dependency.cpp:_ZZZN5doris14AggSharedState16reset_hash_tableEvENK3$_1clINS_26MethodSingleNullableColumnINS_15MethodOneNumberIjNS_15DataWithNullKeyI9PHHashMapIjPc9HashCRC32IjEEEEEEEEEEDaRT_ENKUlSF_E_clIS7_EEDaSF_ Unexecuted instantiation: dependency.cpp:_ZZZN5doris14AggSharedState16reset_hash_tableEvENK3$_1clINS_26MethodSingleNullableColumnINS_15MethodOneNumberImNS_15DataWithNullKeyI9PHHashMapImPc9HashCRC32ImEEEEEEEEEEDaRT_ENKUlSF_E_clIS7_EEDaSF_ Unexecuted instantiation: dependency.cpp:_ZZZN5doris14AggSharedState16reset_hash_tableEvENK3$_1clINS_26MethodSingleNullableColumnINS_15MethodOneNumberIjNS_15DataWithNullKeyI9PHHashMapIjPc14HashMixWrapperIj9HashCRC32IjEEEEEEEEEEEDaRT_ENKUlSH_E_clIS7_EEDaSH_ Unexecuted instantiation: dependency.cpp:_ZZZN5doris14AggSharedState16reset_hash_tableEvENK3$_1clINS_26MethodSingleNullableColumnINS_15MethodOneNumberImNS_15DataWithNullKeyI9PHHashMapImPc14HashMixWrapperIm9HashCRC32ImEEEEEEEEEEEDaRT_ENKUlSH_E_clIS7_EEDaSH_ Unexecuted instantiation: dependency.cpp:_ZZZN5doris14AggSharedState16reset_hash_tableEvENK3$_1clINS_26MethodSingleNullableColumnINS_15MethodOneNumberIN4wide7integerILm128EjEENS_15DataWithNullKeyI9PHHashMapIS7_Pc9HashCRC32IS7_EEEEEEEEEEDaRT_ENKUlSI_E_clISA_EEDaSI_ Unexecuted instantiation: dependency.cpp:_ZZZN5doris14AggSharedState16reset_hash_tableEvENK3$_1clINS_26MethodSingleNullableColumnINS_15MethodOneNumberIN4wide7integerILm256EjEENS_15DataWithNullKeyI9PHHashMapIS7_Pc9HashCRC32IS7_EEEEEEEEEEDaRT_ENKUlSI_E_clISA_EEDaSI_ Unexecuted instantiation: dependency.cpp:_ZZZN5doris14AggSharedState16reset_hash_tableEvENK3$_1clINS_26MethodSingleNullableColumnINS_19MethodStringNoCacheINS_15DataWithNullKeyINS_13StringHashMapIPcNS_9AllocatorILb1ELb1ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEEEEEEEEEDaRT_ENKUlSG_E_clIS7_EEDaSG_ Unexecuted instantiation: dependency.cpp:_ZZZN5doris14AggSharedState16reset_hash_tableEvENK3$_1clINS_15MethodKeysFixedI9PHHashMapImPc9HashCRC32ImEEEEEEDaRT_ENKUlSB_E_clIS5_EEDaSB_ Unexecuted instantiation: dependency.cpp:_ZZZN5doris14AggSharedState16reset_hash_tableEvENK3$_1clINS_15MethodKeysFixedI9PHHashMapINS_6UInt72EPc9HashCRC32IS5_EEEEEEDaRT_ENKUlSC_E_clIS6_EEDaSC_ Unexecuted instantiation: dependency.cpp:_ZZZN5doris14AggSharedState16reset_hash_tableEvENK3$_1clINS_15MethodKeysFixedI9PHHashMapINS_6UInt96EPc9HashCRC32IS5_EEEEEEDaRT_ENKUlSC_E_clIS6_EEDaSC_ Unexecuted instantiation: dependency.cpp:_ZZZN5doris14AggSharedState16reset_hash_tableEvENK3$_1clINS_15MethodKeysFixedI9PHHashMapINS_7UInt104EPc9HashCRC32IS5_EEEEEEDaRT_ENKUlSC_E_clIS6_EEDaSC_ Unexecuted instantiation: dependency.cpp:_ZZZN5doris14AggSharedState16reset_hash_tableEvENK3$_1clINS_15MethodKeysFixedI9PHHashMapIN4wide7integerILm128EjEEPc9HashCRC32IS7_EEEEEEDaRT_ENKUlSE_E_clIS8_EEDaSE_ Unexecuted instantiation: dependency.cpp:_ZZZN5doris14AggSharedState16reset_hash_tableEvENK3$_1clINS_15MethodKeysFixedI9PHHashMapINS_7UInt136EPc9HashCRC32IS5_EEEEEEDaRT_ENKUlSC_E_clIS6_EEDaSC_ Unexecuted instantiation: dependency.cpp:_ZZZN5doris14AggSharedState16reset_hash_tableEvENK3$_1clINS_15MethodKeysFixedI9PHHashMapIN4wide7integerILm256EjEEPc9HashCRC32IS7_EEEEEEDaRT_ENKUlSE_E_clIS8_EEDaSE_ |
302 | | |
303 | 15 | if (hash_table.has_null_key_data()) { |
304 | 0 | _destroy_agg_status( |
305 | 0 | hash_table.template get_null_key_data<AggregateDataPtr>()); |
306 | 0 | } |
307 | | |
308 | 15 | aggregate_data_container.reset(new AggregateDataContainer( |
309 | 15 | sizeof(typename HashTableType::key_type), |
310 | 15 | ((total_size_of_aggregate_states + align_aggregate_states - 1) / |
311 | 15 | align_aggregate_states) * |
312 | 15 | align_aggregate_states)); |
313 | 15 | agg_method.hash_table.reset(new HashTableType()); |
314 | 15 | return Status::OK(); |
315 | 15 | }}, Unexecuted instantiation: dependency.cpp:_ZZN5doris14AggSharedState16reset_hash_tableEvENK3$_1clINS_16MethodSerializedI9PHHashMapINS_9StringRefEPc11DefaultHashIS5_vEEEEEEDaRT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris14AggSharedState16reset_hash_tableEvENK3$_1clINS_15MethodOneNumberIh9PHHashMapIhPc9HashCRC32IhEEEEEEDaRT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris14AggSharedState16reset_hash_tableEvENK3$_1clINS_15MethodOneNumberIt9PHHashMapItPc9HashCRC32ItEEEEEEDaRT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris14AggSharedState16reset_hash_tableEvENK3$_1clINS_15MethodOneNumberIj9PHHashMapIjPc9HashCRC32IjEEEEEEDaRT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris14AggSharedState16reset_hash_tableEvENK3$_1clINS_15MethodOneNumberIm9PHHashMapImPc9HashCRC32ImEEEEEEDaRT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris14AggSharedState16reset_hash_tableEvENK3$_1clINS_19MethodStringNoCacheINS_13StringHashMapIPcNS_9AllocatorILb1ELb1ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEEEEEDaRT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris14AggSharedState16reset_hash_tableEvENK3$_1clINS_15MethodOneNumberIN4wide7integerILm128EjEE9PHHashMapIS6_Pc9HashCRC32IS6_EEEEEEDaRT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris14AggSharedState16reset_hash_tableEvENK3$_1clINS_15MethodOneNumberIN4wide7integerILm256EjEE9PHHashMapIS6_Pc9HashCRC32IS6_EEEEEEDaRT_ dependency.cpp:_ZZN5doris14AggSharedState16reset_hash_tableEvENK3$_1clINS_15MethodOneNumberIj9PHHashMapIjPc14HashMixWrapperIj9HashCRC32IjEEEEEEEDaRT_ Line | Count | Source | 289 | 15 | [&](auto& agg_method) { | 290 | 15 | auto& hash_table = *agg_method.hash_table; | 291 | 15 | using HashTableType = std::decay_t<decltype(hash_table)>; | 292 | | | 293 | 15 | agg_method.arena.clear(); | 294 | 15 | agg_method.inited_iterator = false; | 295 | | | 296 | 15 | hash_table.for_each_mapped([&](auto& mapped) { | 297 | 15 | if (mapped) { | 298 | 15 | _destroy_agg_status(mapped); | 299 | 15 | mapped = nullptr; | 300 | 15 | } | 301 | 15 | }); | 302 | | | 303 | 15 | if (hash_table.has_null_key_data()) { | 304 | 0 | _destroy_agg_status( | 305 | 0 | hash_table.template get_null_key_data<AggregateDataPtr>()); | 306 | 0 | } | 307 | | | 308 | 15 | aggregate_data_container.reset(new AggregateDataContainer( | 309 | 15 | sizeof(typename HashTableType::key_type), | 310 | 15 | ((total_size_of_aggregate_states + align_aggregate_states - 1) / | 311 | 15 | align_aggregate_states) * | 312 | 15 | align_aggregate_states)); | 313 | 15 | agg_method.hash_table.reset(new HashTableType()); | 314 | 15 | return Status::OK(); | 315 | 15 | }}, |
Unexecuted instantiation: dependency.cpp:_ZZN5doris14AggSharedState16reset_hash_tableEvENK3$_1clINS_15MethodOneNumberIm9PHHashMapImPc14HashMixWrapperIm9HashCRC32ImEEEEEEEDaRT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris14AggSharedState16reset_hash_tableEvENK3$_1clINS_26MethodSingleNullableColumnINS_15MethodOneNumberIhNS_15DataWithNullKeyI9PHHashMapIhPc9HashCRC32IhEEEEEEEEEEDaRT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris14AggSharedState16reset_hash_tableEvENK3$_1clINS_26MethodSingleNullableColumnINS_15MethodOneNumberItNS_15DataWithNullKeyI9PHHashMapItPc9HashCRC32ItEEEEEEEEEEDaRT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris14AggSharedState16reset_hash_tableEvENK3$_1clINS_26MethodSingleNullableColumnINS_15MethodOneNumberIjNS_15DataWithNullKeyI9PHHashMapIjPc9HashCRC32IjEEEEEEEEEEDaRT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris14AggSharedState16reset_hash_tableEvENK3$_1clINS_26MethodSingleNullableColumnINS_15MethodOneNumberImNS_15DataWithNullKeyI9PHHashMapImPc9HashCRC32ImEEEEEEEEEEDaRT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris14AggSharedState16reset_hash_tableEvENK3$_1clINS_26MethodSingleNullableColumnINS_15MethodOneNumberIjNS_15DataWithNullKeyI9PHHashMapIjPc14HashMixWrapperIj9HashCRC32IjEEEEEEEEEEEDaRT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris14AggSharedState16reset_hash_tableEvENK3$_1clINS_26MethodSingleNullableColumnINS_15MethodOneNumberImNS_15DataWithNullKeyI9PHHashMapImPc14HashMixWrapperIm9HashCRC32ImEEEEEEEEEEEDaRT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris14AggSharedState16reset_hash_tableEvENK3$_1clINS_26MethodSingleNullableColumnINS_15MethodOneNumberIN4wide7integerILm128EjEENS_15DataWithNullKeyI9PHHashMapIS7_Pc9HashCRC32IS7_EEEEEEEEEEDaRT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris14AggSharedState16reset_hash_tableEvENK3$_1clINS_26MethodSingleNullableColumnINS_15MethodOneNumberIN4wide7integerILm256EjEENS_15DataWithNullKeyI9PHHashMapIS7_Pc9HashCRC32IS7_EEEEEEEEEEDaRT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris14AggSharedState16reset_hash_tableEvENK3$_1clINS_26MethodSingleNullableColumnINS_19MethodStringNoCacheINS_15DataWithNullKeyINS_13StringHashMapIPcNS_9AllocatorILb1ELb1ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEEEEEEEEEDaRT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris14AggSharedState16reset_hash_tableEvENK3$_1clINS_15MethodKeysFixedI9PHHashMapImPc9HashCRC32ImEEEEEEDaRT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris14AggSharedState16reset_hash_tableEvENK3$_1clINS_15MethodKeysFixedI9PHHashMapINS_6UInt72EPc9HashCRC32IS5_EEEEEEDaRT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris14AggSharedState16reset_hash_tableEvENK3$_1clINS_15MethodKeysFixedI9PHHashMapINS_6UInt96EPc9HashCRC32IS5_EEEEEEDaRT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris14AggSharedState16reset_hash_tableEvENK3$_1clINS_15MethodKeysFixedI9PHHashMapINS_7UInt104EPc9HashCRC32IS5_EEEEEEDaRT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris14AggSharedState16reset_hash_tableEvENK3$_1clINS_15MethodKeysFixedI9PHHashMapIN4wide7integerILm128EjEEPc9HashCRC32IS7_EEEEEEDaRT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris14AggSharedState16reset_hash_tableEvENK3$_1clINS_15MethodKeysFixedI9PHHashMapINS_7UInt136EPc9HashCRC32IS5_EEEEEEDaRT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris14AggSharedState16reset_hash_tableEvENK3$_1clINS_15MethodKeysFixedI9PHHashMapIN4wide7integerILm256EjEEPc9HashCRC32IS7_EEEEEEDaRT_ |
316 | 15 | agg_data->method_variant); |
317 | 15 | } |
318 | | |
319 | 15 | void PartitionedAggSharedState::init_spill_params(size_t spill_partition_count) { |
320 | 15 | partition_count = spill_partition_count; |
321 | 15 | max_partition_index = partition_count - 1; |
322 | | |
323 | 495 | for (int i = 0; i < partition_count; ++i) { |
324 | 480 | spill_partitions.emplace_back(std::make_shared<AggSpillPartition>()); |
325 | 480 | } |
326 | 15 | } |
327 | | |
328 | 4 | void PartitionedAggSharedState::update_spill_stream_profiles(RuntimeProfile* source_profile) { |
329 | 128 | for (auto& partition : spill_partitions) { |
330 | 128 | if (partition->spilling_stream_) { |
331 | 0 | partition->spilling_stream_->update_shared_profiles(source_profile); |
332 | 0 | } |
333 | 128 | for (auto& stream : partition->spill_streams_) { |
334 | 0 | if (stream) { |
335 | 0 | stream->update_shared_profiles(source_profile); |
336 | 0 | } |
337 | 0 | } |
338 | 128 | } |
339 | 4 | } |
340 | | |
341 | | Status AggSpillPartition::get_spill_stream(RuntimeState* state, int node_id, |
342 | 65 | RuntimeProfile* profile, SpillStreamSPtr& spill_stream) { |
343 | 65 | if (spilling_stream_) { |
344 | 16 | spill_stream = spilling_stream_; |
345 | 16 | return Status::OK(); |
346 | 16 | } |
347 | 49 | RETURN_IF_ERROR(ExecEnv::GetInstance()->spill_stream_mgr()->register_spill_stream( |
348 | 49 | state, spilling_stream_, print_id(state->query_id()), "agg", node_id, |
349 | 49 | std::numeric_limits<int32_t>::max(), std::numeric_limits<size_t>::max(), profile)); |
350 | 49 | spill_streams_.emplace_back(spilling_stream_); |
351 | 49 | spill_stream = spilling_stream_; |
352 | 49 | return Status::OK(); |
353 | 49 | } |
354 | 238 | void AggSpillPartition::close() { |
355 | 238 | if (spilling_stream_) { |
356 | 1 | spilling_stream_.reset(); |
357 | 1 | } |
358 | 238 | for (auto& stream : spill_streams_) { |
359 | 5 | (void)ExecEnv::GetInstance()->spill_stream_mgr()->delete_spill_stream(stream); |
360 | 5 | } |
361 | 238 | spill_streams_.clear(); |
362 | 238 | } |
363 | | |
364 | 12 | void PartitionedAggSharedState::close() { |
365 | | // need to use CAS instead of only `if (!is_closed)` statement, |
366 | | // to avoid concurrent entry of close() both pass the if statement |
367 | 12 | bool false_close = false; |
368 | 12 | if (!is_closed.compare_exchange_strong(false_close, true)) { |
369 | 3 | return; |
370 | 3 | } |
371 | 12 | DCHECK(!false_close && is_closed); |
372 | 238 | for (auto partition : spill_partitions) { |
373 | 238 | partition->close(); |
374 | 238 | } |
375 | 9 | spill_partitions.clear(); |
376 | 9 | } |
377 | | |
378 | 16 | void SpillSortSharedState::update_spill_stream_profiles(RuntimeProfile* source_profile) { |
379 | 28 | for (auto& stream : sorted_streams) { |
380 | 28 | if (stream) { |
381 | 28 | stream->update_shared_profiles(source_profile); |
382 | 28 | } |
383 | 28 | } |
384 | 16 | } |
385 | | |
386 | 18 | void SpillSortSharedState::close() { |
387 | | // need to use CAS instead of only `if (!is_closed)` statement, |
388 | | // to avoid concurrent entry of close() both pass the if statement |
389 | 18 | bool false_close = false; |
390 | 18 | if (!is_closed.compare_exchange_strong(false_close, true)) { |
391 | 1 | return; |
392 | 1 | } |
393 | 18 | DCHECK(!false_close && is_closed); |
394 | 17 | for (auto& stream : sorted_streams) { |
395 | 1 | (void)ExecEnv::GetInstance()->spill_stream_mgr()->delete_spill_stream(stream); |
396 | 1 | } |
397 | 17 | sorted_streams.clear(); |
398 | 17 | } |
399 | | |
400 | | MultiCastSharedState::MultiCastSharedState(ObjectPool* pool, int cast_sender_count, int node_id) |
401 | | : multi_cast_data_streamer( |
402 | 3.39k | std::make_unique<MultiCastDataStreamer>(pool, cast_sender_count, node_id)) {} |
403 | | |
404 | 0 | void MultiCastSharedState::update_spill_stream_profiles(RuntimeProfile* source_profile) {} |
405 | | |
406 | 134k | int AggSharedState::get_slot_column_id(const AggFnEvaluator* evaluator) { |
407 | 134k | auto ctxs = evaluator->input_exprs_ctxs(); |
408 | 18.4E | CHECK(ctxs.size() == 1 && ctxs[0]->root()->is_slot_ref()) |
409 | 18.4E | << "input_exprs_ctxs is invalid, input_exprs_ctx[0]=" |
410 | 18.4E | << ctxs[0]->root()->debug_string(); |
411 | 134k | return ((VSlotRef*)ctxs[0]->root().get())->column_id(); |
412 | 134k | } |
413 | | |
414 | 2.45M | void AggSharedState::_destroy_agg_status(AggregateDataPtr data) { |
415 | 5.34M | for (int i = 0; i < aggregate_evaluators.size(); ++i) { |
416 | 2.88M | aggregate_evaluators[i]->function()->destroy(data + offsets_of_aggregate_states[i]); |
417 | 2.88M | } |
418 | 2.45M | } |
419 | | |
420 | 127k | LocalExchangeSharedState::~LocalExchangeSharedState() = default; |
421 | | |
422 | 12.7k | Status SetSharedState::update_build_not_ignore_null(const VExprContextSPtrs& ctxs) { |
423 | 12.7k | if (ctxs.size() > build_not_ignore_null.size()) { |
424 | 0 | return Status::InternalError("build_not_ignore_null not initialized"); |
425 | 0 | } |
426 | | |
427 | 100k | for (int i = 0; i < ctxs.size(); ++i) { |
428 | 88.1k | build_not_ignore_null[i] = build_not_ignore_null[i] || ctxs[i]->root()->is_nullable(); |
429 | 88.1k | } |
430 | | |
431 | 12.7k | return Status::OK(); |
432 | 12.7k | } |
433 | | |
434 | 20.5k | size_t SetSharedState::get_hash_table_size() const { |
435 | 20.5k | size_t hash_table_size = 0; |
436 | 20.5k | std::visit( |
437 | 20.5k | [&](auto&& arg) { |
438 | 20.5k | using HashTableCtxType = std::decay_t<decltype(arg)>; |
439 | 20.5k | if constexpr (!std::is_same_v<HashTableCtxType, std::monostate>) { |
440 | 20.5k | hash_table_size = arg.hash_table->size(); |
441 | 20.5k | } |
442 | 20.5k | }, Unexecuted instantiation: dependency.cpp:_ZZNK5doris14SetSharedState19get_hash_table_sizeEvENK3$_0clIRSt9monostateEEDaOT_ dependency.cpp:_ZZNK5doris14SetSharedState19get_hash_table_sizeEvENK3$_0clIRNS_16MethodSerializedI9PHHashMapINS_9StringRefENS_14RowRefWithFlagE11DefaultHashIS5_vEEEEEEDaOT_ Line | Count | Source | 437 | 18.0k | [&](auto&& arg) { | 438 | 18.0k | using HashTableCtxType = std::decay_t<decltype(arg)>; | 439 | 18.0k | if constexpr (!std::is_same_v<HashTableCtxType, std::monostate>) { | 440 | 18.0k | hash_table_size = arg.hash_table->size(); | 441 | 18.0k | } | 442 | 18.0k | }, |
dependency.cpp:_ZZNK5doris14SetSharedState19get_hash_table_sizeEvENK3$_0clIRNS_19MethodStringNoCacheI9PHHashMapINS_9StringRefENS_14RowRefWithFlagE11DefaultHashIS5_vEEEEEEDaOT_ Line | Count | Source | 437 | 240 | [&](auto&& arg) { | 438 | 240 | using HashTableCtxType = std::decay_t<decltype(arg)>; | 439 | 240 | if constexpr (!std::is_same_v<HashTableCtxType, std::monostate>) { | 440 | 240 | hash_table_size = arg.hash_table->size(); | 441 | 240 | } | 442 | 240 | }, |
dependency.cpp:_ZZNK5doris14SetSharedState19get_hash_table_sizeEvENK3$_0clIRNS_26MethodSingleNullableColumnINS_19MethodStringNoCacheINS_15DataWithNullKeyI9PHHashMapINS_9StringRefENS_14RowRefWithFlagE11DefaultHashIS7_vEEEEEEEEEEDaOT_ Line | Count | Source | 437 | 225 | [&](auto&& arg) { | 438 | 225 | using HashTableCtxType = std::decay_t<decltype(arg)>; | 439 | 225 | if constexpr (!std::is_same_v<HashTableCtxType, std::monostate>) { | 440 | 225 | hash_table_size = arg.hash_table->size(); | 441 | 225 | } | 442 | 225 | }, |
dependency.cpp:_ZZNK5doris14SetSharedState19get_hash_table_sizeEvENK3$_0clIRNS_26MethodSingleNullableColumnINS_15MethodOneNumberIhNS_15DataWithNullKeyI9PHHashMapIhNS_14RowRefWithFlagE9HashCRC32IhEEEEEEEEEEDaOT_ Line | Count | Source | 437 | 68 | [&](auto&& arg) { | 438 | 68 | using HashTableCtxType = std::decay_t<decltype(arg)>; | 439 | 68 | if constexpr (!std::is_same_v<HashTableCtxType, std::monostate>) { | 440 | 68 | hash_table_size = arg.hash_table->size(); | 441 | 68 | } | 442 | 68 | }, |
Unexecuted instantiation: dependency.cpp:_ZZNK5doris14SetSharedState19get_hash_table_sizeEvENK3$_0clIRNS_26MethodSingleNullableColumnINS_15MethodOneNumberItNS_15DataWithNullKeyI9PHHashMapItNS_14RowRefWithFlagE9HashCRC32ItEEEEEEEEEEDaOT_ dependency.cpp:_ZZNK5doris14SetSharedState19get_hash_table_sizeEvENK3$_0clIRNS_26MethodSingleNullableColumnINS_15MethodOneNumberIjNS_15DataWithNullKeyI9PHHashMapIjNS_14RowRefWithFlagE9HashCRC32IjEEEEEEEEEEDaOT_ Line | Count | Source | 437 | 638 | [&](auto&& arg) { | 438 | 638 | using HashTableCtxType = std::decay_t<decltype(arg)>; | 439 | 638 | if constexpr (!std::is_same_v<HashTableCtxType, std::monostate>) { | 440 | 638 | hash_table_size = arg.hash_table->size(); | 441 | 638 | } | 442 | 638 | }, |
dependency.cpp:_ZZNK5doris14SetSharedState19get_hash_table_sizeEvENK3$_0clIRNS_26MethodSingleNullableColumnINS_15MethodOneNumberImNS_15DataWithNullKeyI9PHHashMapImNS_14RowRefWithFlagE9HashCRC32ImEEEEEEEEEEDaOT_ Line | Count | Source | 437 | 574 | [&](auto&& arg) { | 438 | 574 | using HashTableCtxType = std::decay_t<decltype(arg)>; | 439 | 574 | if constexpr (!std::is_same_v<HashTableCtxType, std::monostate>) { | 440 | 574 | hash_table_size = arg.hash_table->size(); | 441 | 574 | } | 442 | 574 | }, |
dependency.cpp:_ZZNK5doris14SetSharedState19get_hash_table_sizeEvENK3$_0clIRNS_26MethodSingleNullableColumnINS_15MethodOneNumberIN4wide7integerILm128EjEENS_15DataWithNullKeyI9PHHashMapIS7_NS_14RowRefWithFlagE9HashCRC32IS7_EEEEEEEEEEDaOT_ Line | Count | Source | 437 | 192 | [&](auto&& arg) { | 438 | 192 | using HashTableCtxType = std::decay_t<decltype(arg)>; | 439 | 192 | if constexpr (!std::is_same_v<HashTableCtxType, std::monostate>) { | 440 | 192 | hash_table_size = arg.hash_table->size(); | 441 | 192 | } | 442 | 192 | }, |
Unexecuted instantiation: dependency.cpp:_ZZNK5doris14SetSharedState19get_hash_table_sizeEvENK3$_0clIRNS_26MethodSingleNullableColumnINS_15MethodOneNumberIN4wide7integerILm256EjEENS_15DataWithNullKeyI9PHHashMapIS7_NS_14RowRefWithFlagE9HashCRC32IS7_EEEEEEEEEEDaOT_ dependency.cpp:_ZZNK5doris14SetSharedState19get_hash_table_sizeEvENK3$_0clIRNS_15MethodOneNumberIh9PHHashMapIhNS_14RowRefWithFlagE9HashCRC32IhEEEEEEDaOT_ Line | Count | Source | 437 | 96 | [&](auto&& arg) { | 438 | 96 | using HashTableCtxType = std::decay_t<decltype(arg)>; | 439 | 96 | if constexpr (!std::is_same_v<HashTableCtxType, std::monostate>) { | 440 | 96 | hash_table_size = arg.hash_table->size(); | 441 | 96 | } | 442 | 96 | }, |
Unexecuted instantiation: dependency.cpp:_ZZNK5doris14SetSharedState19get_hash_table_sizeEvENK3$_0clIRNS_15MethodOneNumberIt9PHHashMapItNS_14RowRefWithFlagE9HashCRC32ItEEEEEEDaOT_ dependency.cpp:_ZZNK5doris14SetSharedState19get_hash_table_sizeEvENK3$_0clIRNS_15MethodOneNumberIj9PHHashMapIjNS_14RowRefWithFlagE9HashCRC32IjEEEEEEDaOT_ Line | Count | Source | 437 | 30 | [&](auto&& arg) { | 438 | 30 | using HashTableCtxType = std::decay_t<decltype(arg)>; | 439 | 30 | if constexpr (!std::is_same_v<HashTableCtxType, std::monostate>) { | 440 | 30 | hash_table_size = arg.hash_table->size(); | 441 | 30 | } | 442 | 30 | }, |
dependency.cpp:_ZZNK5doris14SetSharedState19get_hash_table_sizeEvENK3$_0clIRNS_15MethodOneNumberIm9PHHashMapImNS_14RowRefWithFlagE9HashCRC32ImEEEEEEDaOT_ Line | Count | Source | 437 | 28 | [&](auto&& arg) { | 438 | 28 | using HashTableCtxType = std::decay_t<decltype(arg)>; | 439 | 28 | if constexpr (!std::is_same_v<HashTableCtxType, std::monostate>) { | 440 | 28 | hash_table_size = arg.hash_table->size(); | 441 | 28 | } | 442 | 28 | }, |
Unexecuted instantiation: dependency.cpp:_ZZNK5doris14SetSharedState19get_hash_table_sizeEvENK3$_0clIRNS_15MethodOneNumberIN4wide7integerILm128EjEE9PHHashMapIS6_NS_14RowRefWithFlagE9HashCRC32IS6_EEEEEEDaOT_ Unexecuted instantiation: dependency.cpp:_ZZNK5doris14SetSharedState19get_hash_table_sizeEvENK3$_0clIRNS_15MethodOneNumberIN4wide7integerILm256EjEE9PHHashMapIS6_NS_14RowRefWithFlagE9HashCRC32IS6_EEEEEEDaOT_ dependency.cpp:_ZZNK5doris14SetSharedState19get_hash_table_sizeEvENK3$_0clIRNS_15MethodKeysFixedI9PHHashMapImNS_14RowRefWithFlagE9HashCRC32ImEEEEEEDaOT_ Line | Count | Source | 437 | 129 | [&](auto&& arg) { | 438 | 129 | using HashTableCtxType = std::decay_t<decltype(arg)>; | 439 | 129 | if constexpr (!std::is_same_v<HashTableCtxType, std::monostate>) { | 440 | 129 | hash_table_size = arg.hash_table->size(); | 441 | 129 | } | 442 | 129 | }, |
dependency.cpp:_ZZNK5doris14SetSharedState19get_hash_table_sizeEvENK3$_0clIRNS_15MethodKeysFixedI9PHHashMapINS_6UInt72ENS_14RowRefWithFlagE9HashCRC32IS5_EEEEEEDaOT_ Line | Count | Source | 437 | 49 | [&](auto&& arg) { | 438 | 49 | using HashTableCtxType = std::decay_t<decltype(arg)>; | 439 | 49 | if constexpr (!std::is_same_v<HashTableCtxType, std::monostate>) { | 440 | 49 | hash_table_size = arg.hash_table->size(); | 441 | 49 | } | 442 | 49 | }, |
dependency.cpp:_ZZNK5doris14SetSharedState19get_hash_table_sizeEvENK3$_0clIRNS_15MethodKeysFixedI9PHHashMapINS_6UInt96ENS_14RowRefWithFlagE9HashCRC32IS5_EEEEEEDaOT_ Line | Count | Source | 437 | 42 | [&](auto&& arg) { | 438 | 42 | using HashTableCtxType = std::decay_t<decltype(arg)>; | 439 | 42 | if constexpr (!std::is_same_v<HashTableCtxType, std::monostate>) { | 440 | 42 | hash_table_size = arg.hash_table->size(); | 441 | 42 | } | 442 | 42 | }, |
dependency.cpp:_ZZNK5doris14SetSharedState19get_hash_table_sizeEvENK3$_0clIRNS_15MethodKeysFixedI9PHHashMapINS_7UInt104ENS_14RowRefWithFlagE9HashCRC32IS5_EEEEEEDaOT_ Line | Count | Source | 437 | 45 | [&](auto&& arg) { | 438 | 45 | using HashTableCtxType = std::decay_t<decltype(arg)>; | 439 | 45 | if constexpr (!std::is_same_v<HashTableCtxType, std::monostate>) { | 440 | 45 | hash_table_size = arg.hash_table->size(); | 441 | 45 | } | 442 | 45 | }, |
Unexecuted instantiation: dependency.cpp:_ZZNK5doris14SetSharedState19get_hash_table_sizeEvENK3$_0clIRNS_15MethodKeysFixedI9PHHashMapIN4wide7integerILm128EjEENS_14RowRefWithFlagE9HashCRC32IS7_EEEEEEDaOT_ dependency.cpp:_ZZNK5doris14SetSharedState19get_hash_table_sizeEvENK3$_0clIRNS_15MethodKeysFixedI9PHHashMapIN4wide7integerILm256EjEENS_14RowRefWithFlagE9HashCRC32IS7_EEEEEEDaOT_ Line | Count | Source | 437 | 4 | [&](auto&& arg) { | 438 | 4 | using HashTableCtxType = std::decay_t<decltype(arg)>; | 439 | 4 | if constexpr (!std::is_same_v<HashTableCtxType, std::monostate>) { | 440 | 4 | hash_table_size = arg.hash_table->size(); | 441 | 4 | } | 442 | 4 | }, |
dependency.cpp:_ZZNK5doris14SetSharedState19get_hash_table_sizeEvENK3$_0clIRNS_15MethodKeysFixedI9PHHashMapINS_7UInt136ENS_14RowRefWithFlagE9HashCRC32IS5_EEEEEEDaOT_ Line | Count | Source | 437 | 194 | [&](auto&& arg) { | 438 | 194 | using HashTableCtxType = std::decay_t<decltype(arg)>; | 439 | 194 | if constexpr (!std::is_same_v<HashTableCtxType, std::monostate>) { | 440 | 194 | hash_table_size = arg.hash_table->size(); | 441 | 194 | } | 442 | 194 | }, |
|
443 | 20.5k | hash_table_variants->method_variant); |
444 | 20.5k | return hash_table_size; |
445 | 20.5k | } |
446 | | |
447 | 5.36k | Status SetSharedState::hash_table_init() { |
448 | 5.36k | std::vector<DataTypePtr> data_types; |
449 | 41.1k | for (size_t i = 0; i != child_exprs_lists[0].size(); ++i) { |
450 | 35.8k | auto& ctx = child_exprs_lists[0][i]; |
451 | 35.8k | auto data_type = ctx->root()->data_type(); |
452 | 35.8k | if (build_not_ignore_null[i]) { |
453 | 35.5k | data_type = make_nullable(data_type); |
454 | 35.5k | } |
455 | 35.8k | data_types.emplace_back(std::move(data_type)); |
456 | 35.8k | } |
457 | 5.36k | return init_hash_method<SetDataVariants>(hash_table_variants.get(), data_types, true); |
458 | 5.36k | } |
459 | | |
460 | 246 | void AggSharedState::refresh_top_limit(size_t row_id, const ColumnRawPtrs& key_columns) { |
461 | 787 | for (int j = 0; j < key_columns.size(); ++j) { |
462 | 541 | limit_columns[j]->insert_from(*key_columns[j], row_id); |
463 | 541 | } |
464 | 246 | limit_heap.emplace(limit_columns[0]->size() - 1, limit_columns, order_directions, |
465 | 246 | null_directions); |
466 | | |
467 | 246 | limit_heap.pop(); |
468 | 246 | limit_columns_min = limit_heap.top()._row_id; |
469 | 246 | } |
470 | | |
471 | | } // namespace doris |