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 | 656k | const std::string& name) { |
43 | 656k | source_deps.push_back(std::make_shared<Dependency>(operator_id, node_id, name + "_DEPENDENCY")); |
44 | 656k | source_deps.back()->set_shared_state(this); |
45 | 656k | return source_deps.back().get(); |
46 | 656k | } |
47 | | |
48 | | void BasicSharedState::create_source_dependencies(int num_sources, int operator_id, int node_id, |
49 | 139k | const std::string& name) { |
50 | 139k | source_deps.resize(num_sources, nullptr); |
51 | 988k | for (auto& source_dep : source_deps) { |
52 | 988k | source_dep = std::make_shared<Dependency>(operator_id, node_id, name + "_DEPENDENCY"); |
53 | 988k | source_dep->set_shared_state(this); |
54 | 988k | } |
55 | 139k | } |
56 | | |
57 | | Dependency* BasicSharedState::create_sink_dependency(int dest_id, int node_id, |
58 | 1.35M | const std::string& name) { |
59 | 1.35M | sink_deps.push_back(std::make_shared<Dependency>(dest_id, node_id, name + "_DEPENDENCY", true)); |
60 | 1.35M | sink_deps.back()->set_shared_state(this); |
61 | 1.35M | return sink_deps.back().get(); |
62 | 1.35M | } |
63 | | |
64 | 5.89M | 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.89M | _blocked_task.push_back(task); |
69 | 5.89M | } |
70 | | |
71 | 36.3M | void Dependency::set_ready() { |
72 | 36.3M | if (_ready) { |
73 | 31.9M | return; |
74 | 31.9M | } |
75 | 4.41M | std::vector<std::weak_ptr<PipelineTask>> local_block_task {}; |
76 | 4.41M | { |
77 | 4.41M | std::unique_lock<std::mutex> lc(_task_lock); |
78 | 4.41M | if (_ready) { |
79 | 14 | return; |
80 | 14 | } |
81 | 4.41M | _watcher.stop(); |
82 | 4.41M | _ready = true; |
83 | 4.41M | local_block_task.swap(_blocked_task); |
84 | 4.41M | } |
85 | 5.91M | for (auto task : local_block_task) { |
86 | 5.91M | if (auto t = task.lock()) { |
87 | 5.91M | std::unique_lock<std::mutex> lc(_task_lock); |
88 | 5.91M | THROW_IF_ERROR(t->wake_up(this, lc)); |
89 | 5.91M | } |
90 | 5.91M | } |
91 | 4.41M | } |
92 | | |
93 | 146M | Dependency* Dependency::is_blocked_by(std::shared_ptr<PipelineTask> task) { |
94 | 146M | std::unique_lock<std::mutex> lc(_task_lock); |
95 | 146M | auto ready = _ready.load(); |
96 | 146M | if (!ready && task) { |
97 | 5.91M | _add_block_task(task); |
98 | 5.91M | start_watcher(); |
99 | 5.91M | THROW_IF_ERROR(task->blocked(this, lc)); |
100 | 5.91M | } |
101 | 146M | return ready ? nullptr : this; |
102 | 146M | } |
103 | | |
104 | 362k | std::string Dependency::debug_string(int indentation_level) { |
105 | 362k | fmt::memory_buffer debug_string_buffer; |
106 | 362k | fmt::format_to(debug_string_buffer, "{}{}: id={}, block task = {}, ready={}, _always_ready={}", |
107 | 362k | std::string(indentation_level * 2, ' '), _name, _node_id, _blocked_task.size(), |
108 | 362k | _ready, _always_ready); |
109 | 362k | return fmt::to_string(debug_string_buffer); |
110 | 362k | } |
111 | | |
112 | 240 | std::string CountedFinishDependency::debug_string(int indentation_level) { |
113 | 240 | fmt::memory_buffer debug_string_buffer; |
114 | 240 | fmt::format_to(debug_string_buffer, |
115 | 240 | "{}{}: id={}, block_task={}, ready={}, _always_ready={}, count={}", |
116 | 240 | std::string(indentation_level * 2, ' '), _name, _node_id, _blocked_task.size(), |
117 | 240 | _ready, _always_ready, _counter); |
118 | 240 | return fmt::to_string(debug_string_buffer); |
119 | 240 | } |
120 | | |
121 | 841 | void RuntimeFilterTimer::call_timeout() { |
122 | 841 | _parent->set_ready(); |
123 | 841 | } |
124 | | |
125 | 77.9k | void RuntimeFilterTimer::call_ready() { |
126 | 77.9k | _parent->set_ready(); |
127 | 77.9k | } |
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 | 9.02M | bool RuntimeFilterTimer::should_be_check_timeout() { |
133 | 9.02M | if (!_parent->ready() && !_local_runtime_filter_dependencies.empty()) { |
134 | 737k | bool all_ready = true; |
135 | 737k | for (auto& dep : _local_runtime_filter_dependencies) { |
136 | 737k | if (!dep->ready()) { |
137 | 737k | all_ready = false; |
138 | 737k | break; |
139 | 737k | } |
140 | 737k | } |
141 | 737k | if (all_ready) { |
142 | 12 | _local_runtime_filter_dependencies.clear(); |
143 | 12 | _registration_time = MonotonicMillis(); |
144 | 12 | } |
145 | 737k | return all_ready; |
146 | 737k | } |
147 | 8.29M | return true; |
148 | 9.02M | } |
149 | | |
150 | 8 | void RuntimeFilterTimerQueue::start() { |
151 | 238k | while (!_stop) { |
152 | 238k | std::unique_lock<std::mutex> lk(cv_m); |
153 | | |
154 | 244k | while (_que.empty() && !_stop) { |
155 | 11.5k | cv.wait_for(lk, std::chrono::seconds(3), [this] { return !_que.empty() || _stop; }); |
156 | 5.76k | } |
157 | 238k | if (_stop) { |
158 | 3 | break; |
159 | 3 | } |
160 | 238k | { |
161 | 238k | std::unique_lock<std::mutex> lc(_que_lock); |
162 | 238k | std::list<std::shared_ptr<RuntimeFilterTimer>> new_que; |
163 | 9.02M | for (auto& it : _que) { |
164 | 9.02M | if (it.use_count() == 1) { |
165 | | // `use_count == 1` means this runtime filter has been released |
166 | 9.02M | } else if (it->should_be_check_timeout()) { |
167 | 8.29M | 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 | 8.21M | int64_t ms_since_registration = MonotonicMillis() - it->registration_time(); |
170 | 8.21M | if (ms_since_registration > it->wait_time_ms()) { |
171 | 841 | it->call_timeout(); |
172 | 8.21M | } else { |
173 | 8.21M | new_que.push_back(std::move(it)); |
174 | 8.21M | } |
175 | 8.21M | } |
176 | 8.29M | } else { |
177 | 737k | new_que.push_back(std::move(it)); |
178 | 737k | } |
179 | 9.02M | } |
180 | 238k | new_que.swap(_que); |
181 | 238k | } |
182 | 238k | std::this_thread::sleep_for(std::chrono::milliseconds(interval)); |
183 | 238k | } |
184 | 8 | _shutdown = true; |
185 | 8 | } |
186 | | |
187 | 435k | void LocalExchangeSharedState::sub_running_sink_operators() { |
188 | 435k | std::unique_lock<std::mutex> lc(le_lock); |
189 | 435k | if (exchanger->_running_sink_operators.fetch_sub(1) == 1) { |
190 | 136k | _set_always_ready(); |
191 | 136k | } |
192 | 435k | } |
193 | | |
194 | 960k | void LocalExchangeSharedState::sub_running_source_operators() { |
195 | 960k | std::unique_lock<std::mutex> lc(le_lock); |
196 | 960k | if (exchanger->_running_source_operators.fetch_sub(1) == 1) { |
197 | 136k | _set_always_ready(); |
198 | 136k | exchanger->finalize(); |
199 | 136k | } |
200 | 960k | } |
201 | | |
202 | 136k | LocalExchangeSharedState::LocalExchangeSharedState(int num_instances) { |
203 | 136k | source_deps.resize(num_instances, nullptr); |
204 | 136k | mem_counters.resize(num_instances, nullptr); |
205 | 136k | } |
206 | | |
207 | 234 | MutableColumns AggSharedState::_get_keys_hash_table() { |
208 | 234 | return std::visit( |
209 | 234 | Overload {[&](std::monostate& arg) { |
210 | 0 | throw doris::Exception(ErrorCode::INTERNAL_ERROR, "uninited hash table"); |
211 | 0 | return MutableColumns(); |
212 | 0 | }, |
213 | 234 | [&](auto&& agg_method) -> MutableColumns { |
214 | 234 | MutableColumns key_columns; |
215 | 568 | for (int i = 0; i < probe_expr_ctxs.size(); ++i) { |
216 | 334 | key_columns.emplace_back( |
217 | 334 | probe_expr_ctxs[i]->root()->data_type()->create_column()); |
218 | 334 | } |
219 | 234 | auto& data = *agg_method.hash_table; |
220 | 234 | bool has_null_key = data.has_null_key_data(); |
221 | 234 | const auto size = data.size() - has_null_key; |
222 | 234 | using KeyType = std::decay_t<decltype(agg_method)>::Key; |
223 | 234 | std::vector<KeyType> keys(size); |
224 | | |
225 | 234 | uint32_t num_rows = 0; |
226 | 234 | auto iter = aggregate_data_container->begin(); |
227 | 234 | { |
228 | 36.4k | while (iter != aggregate_data_container->end()) { |
229 | 36.2k | keys[num_rows] = iter.get_key<KeyType>(); |
230 | 36.2k | ++iter; |
231 | 36.2k | ++num_rows; |
232 | 36.2k | } |
233 | 234 | } |
234 | 234 | agg_method.insert_keys_into_columns(keys, key_columns, num_rows); |
235 | 234 | if (has_null_key) { |
236 | 4 | key_columns[0]->insert_data(nullptr, 0); |
237 | 4 | } |
238 | 234 | return key_columns; |
239 | 234 | }}, dependency.cpp:_ZZN5doris14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_16MethodSerializedI9PHHashMapINS_9StringRefEPc11DefaultHashIS5_vEEEEEESt6vectorINS_3COWINS_7IColumnEE11mutable_ptrISE_EESaISH_EEOT_ Line | Count | Source | 213 | 22 | [&](auto&& agg_method) -> MutableColumns { | 214 | 22 | MutableColumns key_columns; | 215 | 78 | for (int i = 0; i < probe_expr_ctxs.size(); ++i) { | 216 | 56 | key_columns.emplace_back( | 217 | 56 | probe_expr_ctxs[i]->root()->data_type()->create_column()); | 218 | 56 | } | 219 | 22 | auto& data = *agg_method.hash_table; | 220 | 22 | bool has_null_key = data.has_null_key_data(); | 221 | 22 | const auto size = data.size() - has_null_key; | 222 | 22 | using KeyType = std::decay_t<decltype(agg_method)>::Key; | 223 | 22 | std::vector<KeyType> keys(size); | 224 | | | 225 | 22 | uint32_t num_rows = 0; | 226 | 22 | auto iter = aggregate_data_container->begin(); | 227 | 22 | { | 228 | 17.1k | while (iter != aggregate_data_container->end()) { | 229 | 17.1k | keys[num_rows] = iter.get_key<KeyType>(); | 230 | 17.1k | ++iter; | 231 | 17.1k | ++num_rows; | 232 | 17.1k | } | 233 | 22 | } | 234 | 22 | agg_method.insert_keys_into_columns(keys, key_columns, num_rows); | 235 | 22 | if (has_null_key) { | 236 | 0 | key_columns[0]->insert_data(nullptr, 0); | 237 | 0 | } | 238 | 22 | return key_columns; | 239 | 22 | }}, |
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 | 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 | 5 | while (iter != aggregate_data_container->end()) { | 229 | 4 | keys[num_rows] = iter.get_key<KeyType>(); | 230 | 4 | ++iter; | 231 | 4 | ++num_rows; | 232 | 4 | } | 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_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 | 10 | [&](auto&& agg_method) -> MutableColumns { | 214 | 10 | MutableColumns key_columns; | 215 | 20 | for (int i = 0; i < probe_expr_ctxs.size(); ++i) { | 216 | 10 | key_columns.emplace_back( | 217 | 10 | probe_expr_ctxs[i]->root()->data_type()->create_column()); | 218 | 10 | } | 219 | 10 | auto& data = *agg_method.hash_table; | 220 | 10 | bool has_null_key = data.has_null_key_data(); | 221 | 10 | const auto size = data.size() - has_null_key; | 222 | 10 | using KeyType = std::decay_t<decltype(agg_method)>::Key; | 223 | 10 | std::vector<KeyType> keys(size); | 224 | | | 225 | 10 | uint32_t num_rows = 0; | 226 | 10 | auto iter = aggregate_data_container->begin(); | 227 | 10 | { | 228 | 20 | 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 | 10 | } | 234 | 10 | agg_method.insert_keys_into_columns(keys, key_columns, num_rows); | 235 | 10 | if (has_null_key) { | 236 | 0 | key_columns[0]->insert_data(nullptr, 0); | 237 | 0 | } | 238 | 10 | return key_columns; | 239 | 10 | }}, |
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 | 28 | while (iter != aggregate_data_container->end()) { | 229 | 22 | keys[num_rows] = iter.get_key<KeyType>(); | 230 | 22 | ++iter; | 231 | 22 | ++num_rows; | 232 | 22 | } | 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 | 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 | 8 | 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 | 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_26MethodSingleNullableColumnINS_15MethodOneNumberItNS_15DataWithNullKeyI9PHHashMapItPc9HashCRC32ItEEEEEEEEEESt6vectorINS_3COWINS_7IColumnEE11mutable_ptrISH_EESaISK_EEOT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_26MethodSingleNullableColumnINS_15MethodOneNumberIjNS_15DataWithNullKeyI9PHHashMapIjPc9HashCRC32IjEEEEEEEEEESt6vectorINS_3COWINS_7IColumnEE11mutable_ptrISH_EESaISK_EEOT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_26MethodSingleNullableColumnINS_15MethodOneNumberImNS_15DataWithNullKeyI9PHHashMapImPc9HashCRC32ImEEEEEEEEEESt6vectorINS_3COWINS_7IColumnEE11mutable_ptrISH_EESaISK_EEOT_ dependency.cpp:_ZZN5doris14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_26MethodSingleNullableColumnINS_15MethodOneNumberIjNS_15DataWithNullKeyI9PHHashMapIjPc14HashMixWrapperIj9HashCRC32IjEEEEEEEEEEESt6vectorINS_3COWINS_7IColumnEE11mutable_ptrISJ_EESaISM_EEOT_ Line | Count | Source | 213 | 67 | [&](auto&& agg_method) -> MutableColumns { | 214 | 67 | MutableColumns key_columns; | 215 | 134 | for (int i = 0; i < probe_expr_ctxs.size(); ++i) { | 216 | 67 | key_columns.emplace_back( | 217 | 67 | probe_expr_ctxs[i]->root()->data_type()->create_column()); | 218 | 67 | } | 219 | 67 | auto& data = *agg_method.hash_table; | 220 | 67 | bool has_null_key = data.has_null_key_data(); | 221 | 67 | const auto size = data.size() - has_null_key; | 222 | 67 | using KeyType = std::decay_t<decltype(agg_method)>::Key; | 223 | 67 | std::vector<KeyType> keys(size); | 224 | | | 225 | 67 | uint32_t num_rows = 0; | 226 | 67 | auto iter = aggregate_data_container->begin(); | 227 | 67 | { | 228 | 5.97k | while (iter != aggregate_data_container->end()) { | 229 | 5.90k | keys[num_rows] = iter.get_key<KeyType>(); | 230 | 5.90k | ++iter; | 231 | 5.90k | ++num_rows; | 232 | 5.90k | } | 233 | 67 | } | 234 | 67 | agg_method.insert_keys_into_columns(keys, key_columns, num_rows); | 235 | 67 | if (has_null_key) { | 236 | 3 | key_columns[0]->insert_data(nullptr, 0); | 237 | 3 | } | 238 | 67 | return key_columns; | 239 | 67 | }}, |
dependency.cpp:_ZZN5doris14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_26MethodSingleNullableColumnINS_15MethodOneNumberImNS_15DataWithNullKeyI9PHHashMapImPc14HashMixWrapperIm9HashCRC32ImEEEEEEEEEEESt6vectorINS_3COWINS_7IColumnEE11mutable_ptrISJ_EESaISM_EEOT_ Line | Count | Source | 213 | 57 | [&](auto&& agg_method) -> MutableColumns { | 214 | 57 | MutableColumns key_columns; | 215 | 114 | for (int i = 0; i < probe_expr_ctxs.size(); ++i) { | 216 | 57 | key_columns.emplace_back( | 217 | 57 | probe_expr_ctxs[i]->root()->data_type()->create_column()); | 218 | 57 | } | 219 | 57 | auto& data = *agg_method.hash_table; | 220 | 57 | bool has_null_key = data.has_null_key_data(); | 221 | 57 | const auto size = data.size() - has_null_key; | 222 | 57 | using KeyType = std::decay_t<decltype(agg_method)>::Key; | 223 | 57 | std::vector<KeyType> keys(size); | 224 | | | 225 | 57 | uint32_t num_rows = 0; | 226 | 57 | auto iter = aggregate_data_container->begin(); | 227 | 57 | { | 228 | 9.81k | while (iter != aggregate_data_container->end()) { | 229 | 9.75k | keys[num_rows] = iter.get_key<KeyType>(); | 230 | 9.75k | ++iter; | 231 | 9.75k | ++num_rows; | 232 | 9.75k | } | 233 | 57 | } | 234 | 57 | agg_method.insert_keys_into_columns(keys, key_columns, num_rows); | 235 | 57 | if (has_null_key) { | 236 | 1 | key_columns[0]->insert_data(nullptr, 0); | 237 | 1 | } | 238 | 57 | return key_columns; | 239 | 57 | }}, |
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_ Unexecuted instantiation: dependency.cpp:_ZZN5doris14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_15MethodKeysFixedI9PHHashMapINS_6UInt72EPc9HashCRC32IS5_EEEEEESt6vectorINS_3COWINS_7IColumnEE11mutable_ptrISE_EESaISH_EEOT_ 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 | 36 | [&](auto&& agg_method) -> MutableColumns { | 214 | 36 | MutableColumns key_columns; | 215 | 138 | for (int i = 0; i < probe_expr_ctxs.size(); ++i) { | 216 | 102 | key_columns.emplace_back( | 217 | 102 | probe_expr_ctxs[i]->root()->data_type()->create_column()); | 218 | 102 | } | 219 | 36 | auto& data = *agg_method.hash_table; | 220 | 36 | bool has_null_key = data.has_null_key_data(); | 221 | 36 | const auto size = data.size() - has_null_key; | 222 | 36 | using KeyType = std::decay_t<decltype(agg_method)>::Key; | 223 | 36 | std::vector<KeyType> keys(size); | 224 | | | 225 | 36 | uint32_t num_rows = 0; | 226 | 36 | auto iter = aggregate_data_container->begin(); | 227 | 36 | { | 228 | 1.99k | while (iter != aggregate_data_container->end()) { | 229 | 1.95k | keys[num_rows] = iter.get_key<KeyType>(); | 230 | 1.95k | ++iter; | 231 | 1.95k | ++num_rows; | 232 | 1.95k | } | 233 | 36 | } | 234 | 36 | agg_method.insert_keys_into_columns(keys, key_columns, num_rows); | 235 | 36 | if (has_null_key) { | 236 | 0 | key_columns[0]->insert_data(nullptr, 0); | 237 | 0 | } | 238 | 36 | return key_columns; | 239 | 36 | }}, |
|
240 | 234 | agg_data->method_variant); |
241 | 234 | } |
242 | | |
243 | 234 | void AggSharedState::build_limit_heap(size_t hash_table_size) { |
244 | 234 | limit_columns = _get_keys_hash_table(); |
245 | 35.2k | for (size_t i = 0; i < hash_table_size; ++i) { |
246 | 35.0k | limit_heap.emplace(i, limit_columns, order_directions, null_directions); |
247 | 35.0k | } |
248 | 34.7k | while (hash_table_size > limit) { |
249 | 34.4k | limit_heap.pop(); |
250 | 34.4k | hash_table_size--; |
251 | 34.4k | } |
252 | 234 | limit_columns_min = limit_heap.top()._row_id; |
253 | 234 | } |
254 | | |
255 | | bool AggSharedState::do_limit_filter(Block* block, size_t num_rows, |
256 | 612 | const std::vector<int>* key_locs) { |
257 | 612 | if (num_rows) { |
258 | 612 | cmp_res.resize(num_rows); |
259 | 612 | need_computes.resize(num_rows); |
260 | 612 | memset(need_computes.data(), 0, need_computes.size()); |
261 | 612 | memset(cmp_res.data(), 0, cmp_res.size()); |
262 | | |
263 | 612 | const auto key_size = null_directions.size(); |
264 | 1.77k | for (int i = 0; i < key_size; i++) { |
265 | 1.16k | block->get_by_position(key_locs ? key_locs->operator[](i) : i) |
266 | 1.16k | .column->compare_internal(limit_columns_min, *limit_columns[i], |
267 | 1.16k | null_directions[i], order_directions[i], cmp_res, |
268 | 1.16k | need_computes.data()); |
269 | 1.16k | } |
270 | | |
271 | 612 | auto set_computes_arr = [](auto* __restrict res, auto* __restrict computes, size_t rows) { |
272 | 191k | for (size_t i = 0; i < rows; ++i) { |
273 | 190k | computes[i] = computes[i] == res[i]; |
274 | 190k | } |
275 | 612 | }; |
276 | 612 | set_computes_arr(cmp_res.data(), need_computes.data(), num_rows); |
277 | | |
278 | 612 | return std::find(need_computes.begin(), need_computes.end(), 0) != need_computes.end(); |
279 | 612 | } |
280 | | |
281 | 0 | return false; |
282 | 612 | } |
283 | | |
284 | 2.76k | Status AggSharedState::reset_hash_table() { |
285 | 2.76k | return std::visit( |
286 | 2.76k | Overload {[&](std::monostate& arg) -> Status { |
287 | 0 | return Status::InternalError("Uninited hash table"); |
288 | 0 | }, |
289 | 2.76k | [&](auto& agg_method) { |
290 | 2.76k | auto& hash_table = *agg_method.hash_table; |
291 | 2.76k | using HashTableType = std::decay_t<decltype(hash_table)>; |
292 | | |
293 | 2.76k | agg_method.arena.clear(); |
294 | 2.76k | agg_method.inited_iterator = false; |
295 | | |
296 | 1.22M | hash_table.for_each_mapped([&](auto& mapped) { |
297 | 1.22M | if (mapped) { |
298 | 1.22M | _destroy_agg_status(mapped); |
299 | 1.22M | mapped = nullptr; |
300 | 1.22M | } |
301 | 1.22M | }); 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_ dependency.cpp:_ZZZN5doris14AggSharedState16reset_hash_tableEvENK3$_1clINS_15MethodOneNumberIt9PHHashMapItPc9HashCRC32ItEEEEEEDaRT_ENKUlSB_E_clIS5_EEDaSB_ Line | Count | Source | 296 | 302 | hash_table.for_each_mapped([&](auto& mapped) { | 297 | 302 | if (mapped) { | 298 | 302 | _destroy_agg_status(mapped); | 299 | 302 | mapped = nullptr; | 300 | 302 | } | 301 | 302 | }); |
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_ dependency.cpp:_ZZZN5doris14AggSharedState16reset_hash_tableEvENK3$_1clINS_15MethodOneNumberIN4wide7integerILm128EjEE9PHHashMapIS6_Pc9HashCRC32IS6_EEEEEEDaRT_ENKUlSE_E_clIS8_EEDaSE_ Line | Count | Source | 296 | 552 | hash_table.for_each_mapped([&](auto& mapped) { | 297 | 552 | if (mapped) { | 298 | 552 | _destroy_agg_status(mapped); | 299 | 552 | mapped = nullptr; | 300 | 552 | } | 301 | 552 | }); |
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 | }); |
dependency.cpp:_ZZZN5doris14AggSharedState16reset_hash_tableEvENK3$_1clINS_15MethodOneNumberIm9PHHashMapImPc14HashMixWrapperIm9HashCRC32ImEEEEEEEDaRT_ENKUlSD_E_clIS5_EEDaSD_ Line | Count | Source | 296 | 854 | hash_table.for_each_mapped([&](auto& mapped) { | 297 | 854 | if (mapped) { | 298 | 854 | _destroy_agg_status(mapped); | 299 | 854 | mapped = nullptr; | 300 | 854 | } | 301 | 854 | }); |
dependency.cpp:_ZZZN5doris14AggSharedState16reset_hash_tableEvENK3$_1clINS_26MethodSingleNullableColumnINS_15MethodOneNumberIhNS_15DataWithNullKeyI9PHHashMapIhPc9HashCRC32IhEEEEEEEEEEDaRT_ENKUlSF_E_clIS7_EEDaSF_ Line | Count | Source | 296 | 12 | hash_table.for_each_mapped([&](auto& mapped) { | 297 | 12 | if (mapped) { | 298 | 12 | _destroy_agg_status(mapped); | 299 | 12 | mapped = nullptr; | 300 | 12 | } | 301 | 12 | }); |
Unexecuted instantiation: dependency.cpp:_ZZZN5doris14AggSharedState16reset_hash_tableEvENK3$_1clINS_26MethodSingleNullableColumnINS_15MethodOneNumberItNS_15DataWithNullKeyI9PHHashMapItPc9HashCRC32ItEEEEEEEEEEDaRT_ENKUlSF_E_clIS7_EEDaSF_ dependency.cpp:_ZZZN5doris14AggSharedState16reset_hash_tableEvENK3$_1clINS_26MethodSingleNullableColumnINS_15MethodOneNumberIjNS_15DataWithNullKeyI9PHHashMapIjPc9HashCRC32IjEEEEEEEEEEDaRT_ENKUlSF_E_clIS7_EEDaSF_ Line | Count | Source | 296 | 32.3k | hash_table.for_each_mapped([&](auto& mapped) { | 297 | 32.3k | if (mapped) { | 298 | 32.3k | _destroy_agg_status(mapped); | 299 | 32.3k | mapped = nullptr; | 300 | 32.3k | } | 301 | 32.3k | }); |
dependency.cpp:_ZZZN5doris14AggSharedState16reset_hash_tableEvENK3$_1clINS_26MethodSingleNullableColumnINS_15MethodOneNumberImNS_15DataWithNullKeyI9PHHashMapImPc9HashCRC32ImEEEEEEEEEEDaRT_ENKUlSF_E_clIS7_EEDaSF_ Line | Count | Source | 296 | 728 | hash_table.for_each_mapped([&](auto& mapped) { | 297 | 728 | if (mapped) { | 298 | 728 | _destroy_agg_status(mapped); | 299 | 728 | mapped = nullptr; | 300 | 728 | } | 301 | 728 | }); |
dependency.cpp:_ZZZN5doris14AggSharedState16reset_hash_tableEvENK3$_1clINS_26MethodSingleNullableColumnINS_15MethodOneNumberIjNS_15DataWithNullKeyI9PHHashMapIjPc14HashMixWrapperIj9HashCRC32IjEEEEEEEEEEEDaRT_ENKUlSH_E_clIS7_EEDaSH_ Line | Count | Source | 296 | 138k | hash_table.for_each_mapped([&](auto& mapped) { | 297 | 138k | if (mapped) { | 298 | 138k | _destroy_agg_status(mapped); | 299 | 138k | mapped = nullptr; | 300 | 138k | } | 301 | 138k | }); |
dependency.cpp:_ZZZN5doris14AggSharedState16reset_hash_tableEvENK3$_1clINS_26MethodSingleNullableColumnINS_15MethodOneNumberImNS_15DataWithNullKeyI9PHHashMapImPc14HashMixWrapperIm9HashCRC32ImEEEEEEEEEEEDaRT_ENKUlSH_E_clIS7_EEDaSH_ Line | Count | Source | 296 | 874 | hash_table.for_each_mapped([&](auto& mapped) { | 297 | 874 | if (mapped) { | 298 | 874 | _destroy_agg_status(mapped); | 299 | 874 | mapped = nullptr; | 300 | 874 | } | 301 | 874 | }); |
dependency.cpp:_ZZZN5doris14AggSharedState16reset_hash_tableEvENK3$_1clINS_26MethodSingleNullableColumnINS_15MethodOneNumberIN4wide7integerILm128EjEENS_15DataWithNullKeyI9PHHashMapIS7_Pc9HashCRC32IS7_EEEEEEEEEEDaRT_ENKUlSI_E_clISA_EEDaSI_ Line | Count | Source | 296 | 450 | hash_table.for_each_mapped([&](auto& mapped) { | 297 | 450 | if (mapped) { | 298 | 450 | _destroy_agg_status(mapped); | 299 | 450 | mapped = nullptr; | 300 | 450 | } | 301 | 450 | }); |
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 | 2.76k | 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 | 2.76k | aggregate_data_container.reset(new AggregateDataContainer( |
309 | 2.76k | sizeof(typename HashTableType::key_type), |
310 | 2.76k | ((total_size_of_aggregate_states + align_aggregate_states - 1) / |
311 | 2.76k | align_aggregate_states) * |
312 | 2.76k | align_aggregate_states)); |
313 | 2.76k | agg_method.hash_table.reset(new HashTableType()); |
314 | 2.76k | return Status::OK(); |
315 | 2.76k | }}, Unexecuted instantiation: dependency.cpp:_ZZN5doris14AggSharedState16reset_hash_tableEvENK3$_1clINS_16MethodSerializedI9PHHashMapINS_9StringRefEPc11DefaultHashIS5_vEEEEEEDaRT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris14AggSharedState16reset_hash_tableEvENK3$_1clINS_15MethodOneNumberIh9PHHashMapIhPc9HashCRC32IhEEEEEEDaRT_ dependency.cpp:_ZZN5doris14AggSharedState16reset_hash_tableEvENK3$_1clINS_15MethodOneNumberIt9PHHashMapItPc9HashCRC32ItEEEEEEDaRT_ Line | Count | Source | 289 | 78 | [&](auto& agg_method) { | 290 | 78 | auto& hash_table = *agg_method.hash_table; | 291 | 78 | using HashTableType = std::decay_t<decltype(hash_table)>; | 292 | | | 293 | 78 | agg_method.arena.clear(); | 294 | 78 | agg_method.inited_iterator = false; | 295 | | | 296 | 78 | hash_table.for_each_mapped([&](auto& mapped) { | 297 | 78 | if (mapped) { | 298 | 78 | _destroy_agg_status(mapped); | 299 | 78 | mapped = nullptr; | 300 | 78 | } | 301 | 78 | }); | 302 | | | 303 | 78 | 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 | 78 | aggregate_data_container.reset(new AggregateDataContainer( | 309 | 78 | sizeof(typename HashTableType::key_type), | 310 | 78 | ((total_size_of_aggregate_states + align_aggregate_states - 1) / | 311 | 78 | align_aggregate_states) * | 312 | 78 | align_aggregate_states)); | 313 | 78 | agg_method.hash_table.reset(new HashTableType()); | 314 | 78 | return Status::OK(); | 315 | 78 | }}, |
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_ dependency.cpp:_ZZN5doris14AggSharedState16reset_hash_tableEvENK3$_1clINS_15MethodOneNumberIN4wide7integerILm128EjEE9PHHashMapIS6_Pc9HashCRC32IS6_EEEEEEDaRT_ Line | Count | Source | 289 | 152 | [&](auto& agg_method) { | 290 | 152 | auto& hash_table = *agg_method.hash_table; | 291 | 152 | using HashTableType = std::decay_t<decltype(hash_table)>; | 292 | | | 293 | 152 | agg_method.arena.clear(); | 294 | 152 | agg_method.inited_iterator = false; | 295 | | | 296 | 152 | hash_table.for_each_mapped([&](auto& mapped) { | 297 | 152 | if (mapped) { | 298 | 152 | _destroy_agg_status(mapped); | 299 | 152 | mapped = nullptr; | 300 | 152 | } | 301 | 152 | }); | 302 | | | 303 | 152 | 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 | 152 | aggregate_data_container.reset(new AggregateDataContainer( | 309 | 152 | sizeof(typename HashTableType::key_type), | 310 | 152 | ((total_size_of_aggregate_states + align_aggregate_states - 1) / | 311 | 152 | align_aggregate_states) * | 312 | 152 | align_aggregate_states)); | 313 | 152 | agg_method.hash_table.reset(new HashTableType()); | 314 | 152 | return Status::OK(); | 315 | 152 | }}, |
Unexecuted instantiation: dependency.cpp:_ZZN5doris14AggSharedState16reset_hash_tableEvENK3$_1clINS_15MethodOneNumberIN4wide7integerILm256EjEE9PHHashMapIS6_Pc9HashCRC32IS6_EEEEEEDaRT_ dependency.cpp:_ZZN5doris14AggSharedState16reset_hash_tableEvENK3$_1clINS_15MethodOneNumberIj9PHHashMapIjPc14HashMixWrapperIj9HashCRC32IjEEEEEEEDaRT_ Line | Count | Source | 289 | 275 | [&](auto& agg_method) { | 290 | 275 | auto& hash_table = *agg_method.hash_table; | 291 | 275 | using HashTableType = std::decay_t<decltype(hash_table)>; | 292 | | | 293 | 275 | agg_method.arena.clear(); | 294 | 275 | agg_method.inited_iterator = false; | 295 | | | 296 | 275 | hash_table.for_each_mapped([&](auto& mapped) { | 297 | 275 | if (mapped) { | 298 | 275 | _destroy_agg_status(mapped); | 299 | 275 | mapped = nullptr; | 300 | 275 | } | 301 | 275 | }); | 302 | | | 303 | 275 | 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 | 275 | aggregate_data_container.reset(new AggregateDataContainer( | 309 | 275 | sizeof(typename HashTableType::key_type), | 310 | 275 | ((total_size_of_aggregate_states + align_aggregate_states - 1) / | 311 | 275 | align_aggregate_states) * | 312 | 275 | align_aggregate_states)); | 313 | 275 | agg_method.hash_table.reset(new HashTableType()); | 314 | 275 | return Status::OK(); | 315 | 275 | }}, |
dependency.cpp:_ZZN5doris14AggSharedState16reset_hash_tableEvENK3$_1clINS_15MethodOneNumberIm9PHHashMapImPc14HashMixWrapperIm9HashCRC32ImEEEEEEEDaRT_ Line | Count | Source | 289 | 258 | [&](auto& agg_method) { | 290 | 258 | auto& hash_table = *agg_method.hash_table; | 291 | 258 | using HashTableType = std::decay_t<decltype(hash_table)>; | 292 | | | 293 | 258 | agg_method.arena.clear(); | 294 | 258 | agg_method.inited_iterator = false; | 295 | | | 296 | 258 | hash_table.for_each_mapped([&](auto& mapped) { | 297 | 258 | if (mapped) { | 298 | 258 | _destroy_agg_status(mapped); | 299 | 258 | mapped = nullptr; | 300 | 258 | } | 301 | 258 | }); | 302 | | | 303 | 258 | 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 | 258 | aggregate_data_container.reset(new AggregateDataContainer( | 309 | 258 | sizeof(typename HashTableType::key_type), | 310 | 258 | ((total_size_of_aggregate_states + align_aggregate_states - 1) / | 311 | 258 | align_aggregate_states) * | 312 | 258 | align_aggregate_states)); | 313 | 258 | agg_method.hash_table.reset(new HashTableType()); | 314 | 258 | return Status::OK(); | 315 | 258 | }}, |
dependency.cpp:_ZZN5doris14AggSharedState16reset_hash_tableEvENK3$_1clINS_26MethodSingleNullableColumnINS_15MethodOneNumberIhNS_15DataWithNullKeyI9PHHashMapIhPc9HashCRC32IhEEEEEEEEEEDaRT_ Line | Count | Source | 289 | 12 | [&](auto& agg_method) { | 290 | 12 | auto& hash_table = *agg_method.hash_table; | 291 | 12 | using HashTableType = std::decay_t<decltype(hash_table)>; | 292 | | | 293 | 12 | agg_method.arena.clear(); | 294 | 12 | agg_method.inited_iterator = false; | 295 | | | 296 | 12 | hash_table.for_each_mapped([&](auto& mapped) { | 297 | 12 | if (mapped) { | 298 | 12 | _destroy_agg_status(mapped); | 299 | 12 | mapped = nullptr; | 300 | 12 | } | 301 | 12 | }); | 302 | | | 303 | 12 | 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 | 12 | aggregate_data_container.reset(new AggregateDataContainer( | 309 | 12 | sizeof(typename HashTableType::key_type), | 310 | 12 | ((total_size_of_aggregate_states + align_aggregate_states - 1) / | 311 | 12 | align_aggregate_states) * | 312 | 12 | align_aggregate_states)); | 313 | 12 | agg_method.hash_table.reset(new HashTableType()); | 314 | 12 | return Status::OK(); | 315 | 12 | }}, |
Unexecuted instantiation: dependency.cpp:_ZZN5doris14AggSharedState16reset_hash_tableEvENK3$_1clINS_26MethodSingleNullableColumnINS_15MethodOneNumberItNS_15DataWithNullKeyI9PHHashMapItPc9HashCRC32ItEEEEEEEEEEDaRT_ dependency.cpp:_ZZN5doris14AggSharedState16reset_hash_tableEvENK3$_1clINS_26MethodSingleNullableColumnINS_15MethodOneNumberIjNS_15DataWithNullKeyI9PHHashMapIjPc9HashCRC32IjEEEEEEEEEEDaRT_ Line | Count | Source | 289 | 510 | [&](auto& agg_method) { | 290 | 510 | auto& hash_table = *agg_method.hash_table; | 291 | 510 | using HashTableType = std::decay_t<decltype(hash_table)>; | 292 | | | 293 | 510 | agg_method.arena.clear(); | 294 | 510 | agg_method.inited_iterator = false; | 295 | | | 296 | 510 | hash_table.for_each_mapped([&](auto& mapped) { | 297 | 510 | if (mapped) { | 298 | 510 | _destroy_agg_status(mapped); | 299 | 510 | mapped = nullptr; | 300 | 510 | } | 301 | 510 | }); | 302 | | | 303 | 510 | 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 | 510 | aggregate_data_container.reset(new AggregateDataContainer( | 309 | 510 | sizeof(typename HashTableType::key_type), | 310 | 510 | ((total_size_of_aggregate_states + align_aggregate_states - 1) / | 311 | 510 | align_aggregate_states) * | 312 | 510 | align_aggregate_states)); | 313 | 510 | agg_method.hash_table.reset(new HashTableType()); | 314 | 510 | return Status::OK(); | 315 | 510 | }}, |
dependency.cpp:_ZZN5doris14AggSharedState16reset_hash_tableEvENK3$_1clINS_26MethodSingleNullableColumnINS_15MethodOneNumberImNS_15DataWithNullKeyI9PHHashMapImPc9HashCRC32ImEEEEEEEEEEDaRT_ Line | Count | Source | 289 | 214 | [&](auto& agg_method) { | 290 | 214 | auto& hash_table = *agg_method.hash_table; | 291 | 214 | using HashTableType = std::decay_t<decltype(hash_table)>; | 292 | | | 293 | 214 | agg_method.arena.clear(); | 294 | 214 | agg_method.inited_iterator = false; | 295 | | | 296 | 214 | hash_table.for_each_mapped([&](auto& mapped) { | 297 | 214 | if (mapped) { | 298 | 214 | _destroy_agg_status(mapped); | 299 | 214 | mapped = nullptr; | 300 | 214 | } | 301 | 214 | }); | 302 | | | 303 | 214 | 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 | 214 | aggregate_data_container.reset(new AggregateDataContainer( | 309 | 214 | sizeof(typename HashTableType::key_type), | 310 | 214 | ((total_size_of_aggregate_states + align_aggregate_states - 1) / | 311 | 214 | align_aggregate_states) * | 312 | 214 | align_aggregate_states)); | 313 | 214 | agg_method.hash_table.reset(new HashTableType()); | 314 | 214 | return Status::OK(); | 315 | 214 | }}, |
dependency.cpp:_ZZN5doris14AggSharedState16reset_hash_tableEvENK3$_1clINS_26MethodSingleNullableColumnINS_15MethodOneNumberIjNS_15DataWithNullKeyI9PHHashMapIjPc14HashMixWrapperIj9HashCRC32IjEEEEEEEEEEEDaRT_ Line | Count | Source | 289 | 716 | [&](auto& agg_method) { | 290 | 716 | auto& hash_table = *agg_method.hash_table; | 291 | 716 | using HashTableType = std::decay_t<decltype(hash_table)>; | 292 | | | 293 | 716 | agg_method.arena.clear(); | 294 | 716 | agg_method.inited_iterator = false; | 295 | | | 296 | 716 | hash_table.for_each_mapped([&](auto& mapped) { | 297 | 716 | if (mapped) { | 298 | 716 | _destroy_agg_status(mapped); | 299 | 716 | mapped = nullptr; | 300 | 716 | } | 301 | 716 | }); | 302 | | | 303 | 716 | 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 | 716 | aggregate_data_container.reset(new AggregateDataContainer( | 309 | 716 | sizeof(typename HashTableType::key_type), | 310 | 716 | ((total_size_of_aggregate_states + align_aggregate_states - 1) / | 311 | 716 | align_aggregate_states) * | 312 | 716 | align_aggregate_states)); | 313 | 716 | agg_method.hash_table.reset(new HashTableType()); | 314 | 716 | return Status::OK(); | 315 | 716 | }}, |
dependency.cpp:_ZZN5doris14AggSharedState16reset_hash_tableEvENK3$_1clINS_26MethodSingleNullableColumnINS_15MethodOneNumberImNS_15DataWithNullKeyI9PHHashMapImPc14HashMixWrapperIm9HashCRC32ImEEEEEEEEEEEDaRT_ Line | Count | Source | 289 | 396 | [&](auto& agg_method) { | 290 | 396 | auto& hash_table = *agg_method.hash_table; | 291 | 396 | using HashTableType = std::decay_t<decltype(hash_table)>; | 292 | | | 293 | 396 | agg_method.arena.clear(); | 294 | 396 | agg_method.inited_iterator = false; | 295 | | | 296 | 396 | hash_table.for_each_mapped([&](auto& mapped) { | 297 | 396 | if (mapped) { | 298 | 396 | _destroy_agg_status(mapped); | 299 | 396 | mapped = nullptr; | 300 | 396 | } | 301 | 396 | }); | 302 | | | 303 | 396 | 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 | 396 | aggregate_data_container.reset(new AggregateDataContainer( | 309 | 396 | sizeof(typename HashTableType::key_type), | 310 | 396 | ((total_size_of_aggregate_states + align_aggregate_states - 1) / | 311 | 396 | align_aggregate_states) * | 312 | 396 | align_aggregate_states)); | 313 | 396 | agg_method.hash_table.reset(new HashTableType()); | 314 | 396 | return Status::OK(); | 315 | 396 | }}, |
dependency.cpp:_ZZN5doris14AggSharedState16reset_hash_tableEvENK3$_1clINS_26MethodSingleNullableColumnINS_15MethodOneNumberIN4wide7integerILm128EjEENS_15DataWithNullKeyI9PHHashMapIS7_Pc9HashCRC32IS7_EEEEEEEEEEDaRT_ Line | Count | Source | 289 | 149 | [&](auto& agg_method) { | 290 | 149 | auto& hash_table = *agg_method.hash_table; | 291 | 149 | using HashTableType = std::decay_t<decltype(hash_table)>; | 292 | | | 293 | 149 | agg_method.arena.clear(); | 294 | 149 | agg_method.inited_iterator = false; | 295 | | | 296 | 149 | hash_table.for_each_mapped([&](auto& mapped) { | 297 | 149 | if (mapped) { | 298 | 149 | _destroy_agg_status(mapped); | 299 | 149 | mapped = nullptr; | 300 | 149 | } | 301 | 149 | }); | 302 | | | 303 | 149 | 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 | 149 | aggregate_data_container.reset(new AggregateDataContainer( | 309 | 149 | sizeof(typename HashTableType::key_type), | 310 | 149 | ((total_size_of_aggregate_states + align_aggregate_states - 1) / | 311 | 149 | align_aggregate_states) * | 312 | 149 | align_aggregate_states)); | 313 | 149 | agg_method.hash_table.reset(new HashTableType()); | 314 | 149 | return Status::OK(); | 315 | 149 | }}, |
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 | 2.76k | agg_data->method_variant); |
317 | 2.76k | } |
318 | | |
319 | 277 | void PartitionedAggSharedState::init_spill_params(size_t spill_partition_count) { |
320 | 277 | partition_count = spill_partition_count; |
321 | 277 | max_partition_index = partition_count - 1; |
322 | | |
323 | 9.14k | for (int i = 0; i < partition_count; ++i) { |
324 | 8.86k | spill_partitions.emplace_back(std::make_shared<AggSpillPartition>()); |
325 | 8.86k | } |
326 | 277 | } |
327 | | |
328 | 266 | void PartitionedAggSharedState::update_spill_stream_profiles(RuntimeProfile* source_profile) { |
329 | 8.51k | for (auto& partition : spill_partitions) { |
330 | 8.51k | if (partition->spilling_stream_) { |
331 | 0 | partition->spilling_stream_->update_shared_profiles(source_profile); |
332 | 0 | } |
333 | 8.51k | for (auto& stream : partition->spill_streams_) { |
334 | 1.73k | if (stream) { |
335 | 1.73k | stream->update_shared_profiles(source_profile); |
336 | 1.73k | } |
337 | 1.73k | } |
338 | 8.51k | } |
339 | 266 | } |
340 | | |
341 | | Status AggSpillPartition::get_spill_stream(RuntimeState* state, int node_id, |
342 | 11.5k | RuntimeProfile* profile, SpillStreamSPtr& spill_stream) { |
343 | 11.5k | if (spilling_stream_) { |
344 | 9.80k | spill_stream = spilling_stream_; |
345 | 9.80k | return Status::OK(); |
346 | 9.80k | } |
347 | 1.77k | RETURN_IF_ERROR(ExecEnv::GetInstance()->spill_stream_mgr()->register_spill_stream( |
348 | 1.77k | state, spilling_stream_, print_id(state->query_id()), "agg", node_id, |
349 | 1.77k | std::numeric_limits<int32_t>::max(), std::numeric_limits<size_t>::max(), profile)); |
350 | 1.77k | spill_streams_.emplace_back(spilling_stream_); |
351 | 1.77k | spill_stream = spilling_stream_; |
352 | 1.77k | return Status::OK(); |
353 | 1.77k | } |
354 | 6.15k | void AggSpillPartition::close() { |
355 | 6.15k | if (spilling_stream_) { |
356 | 1 | spilling_stream_.reset(); |
357 | 1 | } |
358 | 6.15k | for (auto& stream : spill_streams_) { |
359 | 5 | (void)ExecEnv::GetInstance()->spill_stream_mgr()->delete_spill_stream(stream); |
360 | 5 | } |
361 | 6.15k | spill_streams_.clear(); |
362 | 6.15k | } |
363 | | |
364 | 309 | 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 | 309 | bool false_close = false; |
368 | 309 | if (!is_closed.compare_exchange_strong(false_close, true)) { |
369 | 38 | return; |
370 | 38 | } |
371 | 309 | DCHECK(!false_close && is_closed); |
372 | 6.15k | for (auto partition : spill_partitions) { |
373 | 6.15k | partition->close(); |
374 | 6.15k | } |
375 | 271 | spill_partitions.clear(); |
376 | 271 | } |
377 | | |
378 | 15 | 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 | 15 | } |
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 | 5.49k | std::make_unique<MultiCastDataStreamer>(pool, cast_sender_count, node_id)) {} |
403 | | |
404 | 0 | void MultiCastSharedState::update_spill_stream_profiles(RuntimeProfile* source_profile) {} |
405 | | |
406 | 139k | int AggSharedState::get_slot_column_id(const AggFnEvaluator* evaluator) { |
407 | 139k | 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 | 139k | return ((VSlotRef*)ctxs[0]->root().get())->column_id(); |
412 | 139k | } |
413 | | |
414 | 2.81M | void AggSharedState::_destroy_agg_status(AggregateDataPtr data) { |
415 | 6.39M | for (int i = 0; i < aggregate_evaluators.size(); ++i) { |
416 | 3.57M | aggregate_evaluators[i]->function()->destroy(data + offsets_of_aggregate_states[i]); |
417 | 3.57M | } |
418 | 2.81M | } |
419 | | |
420 | 136k | LocalExchangeSharedState::~LocalExchangeSharedState() = default; |
421 | | |
422 | 12.2k | Status SetSharedState::update_build_not_ignore_null(const VExprContextSPtrs& ctxs) { |
423 | 12.2k | 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.0k | build_not_ignore_null[i] = build_not_ignore_null[i] || ctxs[i]->root()->is_nullable(); |
429 | 88.0k | } |
430 | | |
431 | 12.2k | return Status::OK(); |
432 | 12.2k | } |
433 | | |
434 | 19.6k | size_t SetSharedState::get_hash_table_size() const { |
435 | 19.6k | size_t hash_table_size = 0; |
436 | 19.6k | std::visit( |
437 | 19.6k | [&](auto&& arg) { |
438 | 19.6k | using HashTableCtxType = std::decay_t<decltype(arg)>; |
439 | 19.6k | if constexpr (!std::is_same_v<HashTableCtxType, std::monostate>) { |
440 | 19.6k | hash_table_size = arg.hash_table->size(); |
441 | 19.6k | } |
442 | 19.6k | }, Unexecuted instantiation: dependency.cpp:_ZZNK5doris14SetSharedState19get_hash_table_sizeEvENK3$_0clIRSt9monostateEEDaOT_ dependency.cpp:_ZZNK5doris14SetSharedState19get_hash_table_sizeEvENK3$_0clIRNS_16MethodSerializedI9PHHashMapINS_9StringRefENS_14RowRefWithFlagE11DefaultHashIS5_vEEEEEEDaOT_ Line | Count | Source | 437 | 17.6k | [&](auto&& arg) { | 438 | 17.6k | using HashTableCtxType = std::decay_t<decltype(arg)>; | 439 | 17.6k | if constexpr (!std::is_same_v<HashTableCtxType, std::monostate>) { | 440 | 17.6k | hash_table_size = arg.hash_table->size(); | 441 | 17.6k | } | 442 | 17.6k | }, |
dependency.cpp:_ZZNK5doris14SetSharedState19get_hash_table_sizeEvENK3$_0clIRNS_19MethodStringNoCacheI9PHHashMapINS_9StringRefENS_14RowRefWithFlagE11DefaultHashIS5_vEEEEEEDaOT_ Line | Count | Source | 437 | 220 | [&](auto&& arg) { | 438 | 220 | using HashTableCtxType = std::decay_t<decltype(arg)>; | 439 | 220 | if constexpr (!std::is_same_v<HashTableCtxType, std::monostate>) { | 440 | 220 | hash_table_size = arg.hash_table->size(); | 441 | 220 | } | 442 | 220 | }, |
dependency.cpp:_ZZNK5doris14SetSharedState19get_hash_table_sizeEvENK3$_0clIRNS_26MethodSingleNullableColumnINS_19MethodStringNoCacheINS_15DataWithNullKeyI9PHHashMapINS_9StringRefENS_14RowRefWithFlagE11DefaultHashIS7_vEEEEEEEEEEDaOT_ Line | Count | Source | 437 | 213 | [&](auto&& arg) { | 438 | 213 | using HashTableCtxType = std::decay_t<decltype(arg)>; | 439 | 213 | if constexpr (!std::is_same_v<HashTableCtxType, std::monostate>) { | 440 | 213 | hash_table_size = arg.hash_table->size(); | 441 | 213 | } | 442 | 213 | }, |
dependency.cpp:_ZZNK5doris14SetSharedState19get_hash_table_sizeEvENK3$_0clIRNS_26MethodSingleNullableColumnINS_15MethodOneNumberIhNS_15DataWithNullKeyI9PHHashMapIhNS_14RowRefWithFlagE9HashCRC32IhEEEEEEEEEEDaOT_ 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_26MethodSingleNullableColumnINS_15MethodOneNumberItNS_15DataWithNullKeyI9PHHashMapItNS_14RowRefWithFlagE9HashCRC32ItEEEEEEEEEEDaOT_ dependency.cpp:_ZZNK5doris14SetSharedState19get_hash_table_sizeEvENK3$_0clIRNS_26MethodSingleNullableColumnINS_15MethodOneNumberIjNS_15DataWithNullKeyI9PHHashMapIjNS_14RowRefWithFlagE9HashCRC32IjEEEEEEEEEEDaOT_ Line | Count | Source | 437 | 542 | [&](auto&& arg) { | 438 | 542 | using HashTableCtxType = std::decay_t<decltype(arg)>; | 439 | 542 | if constexpr (!std::is_same_v<HashTableCtxType, std::monostate>) { | 440 | 542 | hash_table_size = arg.hash_table->size(); | 441 | 542 | } | 442 | 542 | }, |
dependency.cpp:_ZZNK5doris14SetSharedState19get_hash_table_sizeEvENK3$_0clIRNS_26MethodSingleNullableColumnINS_15MethodOneNumberImNS_15DataWithNullKeyI9PHHashMapImNS_14RowRefWithFlagE9HashCRC32ImEEEEEEEEEEDaOT_ Line | Count | Source | 437 | 415 | [&](auto&& arg) { | 438 | 415 | using HashTableCtxType = std::decay_t<decltype(arg)>; | 439 | 415 | if constexpr (!std::is_same_v<HashTableCtxType, std::monostate>) { | 440 | 415 | hash_table_size = arg.hash_table->size(); | 441 | 415 | } | 442 | 415 | }, |
dependency.cpp:_ZZNK5doris14SetSharedState19get_hash_table_sizeEvENK3$_0clIRNS_26MethodSingleNullableColumnINS_15MethodOneNumberIN4wide7integerILm128EjEENS_15DataWithNullKeyI9PHHashMapIS7_NS_14RowRefWithFlagE9HashCRC32IS7_EEEEEEEEEEDaOT_ Line | Count | Source | 437 | 72 | [&](auto&& arg) { | 438 | 72 | using HashTableCtxType = std::decay_t<decltype(arg)>; | 439 | 72 | if constexpr (!std::is_same_v<HashTableCtxType, std::monostate>) { | 440 | 72 | hash_table_size = arg.hash_table->size(); | 441 | 72 | } | 442 | 72 | }, |
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 | 123 | [&](auto&& arg) { | 438 | 123 | using HashTableCtxType = std::decay_t<decltype(arg)>; | 439 | 123 | if constexpr (!std::is_same_v<HashTableCtxType, std::monostate>) { | 440 | 123 | hash_table_size = arg.hash_table->size(); | 441 | 123 | } | 442 | 123 | }, |
dependency.cpp:_ZZNK5doris14SetSharedState19get_hash_table_sizeEvENK3$_0clIRNS_15MethodKeysFixedI9PHHashMapINS_6UInt72ENS_14RowRefWithFlagE9HashCRC32IS5_EEEEEEDaOT_ Line | Count | Source | 437 | 51 | [&](auto&& arg) { | 438 | 51 | using HashTableCtxType = std::decay_t<decltype(arg)>; | 439 | 51 | if constexpr (!std::is_same_v<HashTableCtxType, std::monostate>) { | 440 | 51 | hash_table_size = arg.hash_table->size(); | 441 | 51 | } | 442 | 51 | }, |
dependency.cpp:_ZZNK5doris14SetSharedState19get_hash_table_sizeEvENK3$_0clIRNS_15MethodKeysFixedI9PHHashMapINS_6UInt96ENS_14RowRefWithFlagE9HashCRC32IS5_EEEEEEDaOT_ Line | Count | Source | 437 | 12 | [&](auto&& arg) { | 438 | 12 | using HashTableCtxType = std::decay_t<decltype(arg)>; | 439 | 12 | if constexpr (!std::is_same_v<HashTableCtxType, std::monostate>) { | 440 | 12 | hash_table_size = arg.hash_table->size(); | 441 | 12 | } | 442 | 12 | }, |
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 | 62 | [&](auto&& arg) { | 438 | 62 | using HashTableCtxType = std::decay_t<decltype(arg)>; | 439 | 62 | if constexpr (!std::is_same_v<HashTableCtxType, std::monostate>) { | 440 | 62 | hash_table_size = arg.hash_table->size(); | 441 | 62 | } | 442 | 62 | }, |
|
443 | 19.6k | hash_table_variants->method_variant); |
444 | 19.6k | return hash_table_size; |
445 | 19.6k | } |
446 | | |
447 | 5.03k | Status SetSharedState::hash_table_init() { |
448 | 5.03k | std::vector<DataTypePtr> data_types; |
449 | 40.3k | for (size_t i = 0; i != child_exprs_lists[0].size(); ++i) { |
450 | 35.3k | auto& ctx = child_exprs_lists[0][i]; |
451 | 35.3k | auto data_type = ctx->root()->data_type(); |
452 | 35.3k | if (build_not_ignore_null[i]) { |
453 | 35.1k | data_type = make_nullable(data_type); |
454 | 35.1k | } |
455 | 35.3k | data_types.emplace_back(std::move(data_type)); |
456 | 35.3k | } |
457 | 5.03k | return init_hash_method<SetDataVariants>(hash_table_variants.get(), data_types, true); |
458 | 5.03k | } |
459 | | |
460 | 294 | void AggSharedState::refresh_top_limit(size_t row_id, const ColumnRawPtrs& key_columns) { |
461 | 903 | for (int j = 0; j < key_columns.size(); ++j) { |
462 | 609 | limit_columns[j]->insert_from(*key_columns[j], row_id); |
463 | 609 | } |
464 | 294 | limit_heap.emplace(limit_columns[0]->size() - 1, limit_columns, order_directions, |
465 | 294 | null_directions); |
466 | | |
467 | 294 | limit_heap.pop(); |
468 | 294 | limit_columns_min = limit_heap.top()._row_id; |
469 | 294 | } |
470 | | |
471 | | } // namespace doris |