/root/doris/be/src/pipeline/dependency.cpp
Line | Count | Source (jump to first uncovered line) |
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 "dependency.h" |
19 | | |
20 | | #include <memory> |
21 | | #include <mutex> |
22 | | |
23 | | #include "common/logging.h" |
24 | | #include "exprs/runtime_filter.h" |
25 | | #include "pipeline/exec/multi_cast_data_streamer.h" |
26 | | #include "pipeline/pipeline_fragment_context.h" |
27 | | #include "pipeline/pipeline_task.h" |
28 | | #include "runtime/exec_env.h" |
29 | | #include "runtime/memory/mem_tracker.h" |
30 | | #include "vec/exprs/vectorized_agg_fn.h" |
31 | | #include "vec/exprs/vslot_ref.h" |
32 | | #include "vec/spill/spill_stream_manager.h" |
33 | | |
34 | | namespace doris::pipeline { |
35 | | |
36 | | Dependency* BasicSharedState::create_source_dependency(int operator_id, int node_id, |
37 | 325k | std::string name) { |
38 | 325k | source_deps.push_back(std::make_shared<Dependency>(operator_id, node_id, name + "_DEPENDENCY")); |
39 | 325k | source_deps.back()->set_shared_state(this); |
40 | 325k | return source_deps.back().get(); |
41 | 325k | } |
42 | | |
43 | 576k | Dependency* BasicSharedState::create_sink_dependency(int dest_id, int node_id, std::string name) { |
44 | 576k | sink_deps.push_back(std::make_shared<Dependency>(dest_id, node_id, name + "_DEPENDENCY", true)); |
45 | 576k | sink_deps.back()->set_shared_state(this); |
46 | 576k | return sink_deps.back().get(); |
47 | 576k | } |
48 | | |
49 | 5.38M | void Dependency::_add_block_task(std::shared_ptr<PipelineTask> task) { |
50 | 18.4E | DCHECK(_blocked_task.empty() || _blocked_task[_blocked_task.size() - 1].lock() == nullptr || |
51 | 18.4E | _blocked_task[_blocked_task.size() - 1].lock().get() != task.get()) |
52 | 18.4E | << "Duplicate task: " << task->debug_string(); |
53 | 5.38M | _blocked_task.push_back(task); |
54 | 5.38M | } |
55 | | |
56 | 19.5M | void Dependency::set_ready() { |
57 | 19.5M | if (_ready) { |
58 | 14.7M | return; |
59 | 14.7M | } |
60 | 4.82M | _watcher.stop(); |
61 | 4.82M | std::vector<std::weak_ptr<PipelineTask>> local_block_task {}; |
62 | 4.82M | { |
63 | 4.82M | std::unique_lock<std::mutex> lc(_task_lock); |
64 | 4.82M | if (_ready) { |
65 | 0 | return; |
66 | 0 | } |
67 | 4.82M | _ready = true; |
68 | 4.82M | local_block_task.swap(_blocked_task); |
69 | 4.82M | } |
70 | 5.39M | for (auto task : local_block_task) { |
71 | 5.40M | if (auto t = task.lock()) { |
72 | 5.40M | std::unique_lock<std::mutex> lc(_task_lock); |
73 | 5.40M | t->wake_up(); |
74 | 5.40M | } |
75 | 5.39M | } |
76 | 4.82M | } |
77 | | |
78 | 48.9M | Dependency* Dependency::is_blocked_by(std::shared_ptr<PipelineTask> task) { |
79 | 48.9M | std::unique_lock<std::mutex> lc(_task_lock); |
80 | 48.9M | auto ready = _ready.load(); |
81 | 48.9M | if (!ready && task) { |
82 | 5.38M | _add_block_task(task); |
83 | 5.38M | } |
84 | 48.9M | return ready ? nullptr : this; |
85 | 48.9M | } |
86 | | |
87 | 2.48k | std::string Dependency::debug_string(int indentation_level) { |
88 | 2.48k | fmt::memory_buffer debug_string_buffer; |
89 | 2.48k | fmt::format_to(debug_string_buffer, |
90 | 2.48k | "{}this={}, {}: id={}, block task = {}, ready={}, _always_ready={}", |
91 | 2.48k | std::string(indentation_level * 2, ' '), (void*)this, _name, _node_id, |
92 | 2.48k | _blocked_task.size(), _ready, _always_ready); |
93 | 2.48k | return fmt::to_string(debug_string_buffer); |
94 | 2.48k | } |
95 | | |
96 | 48 | std::string CountedFinishDependency::debug_string(int indentation_level) { |
97 | 48 | fmt::memory_buffer debug_string_buffer; |
98 | 48 | fmt::format_to(debug_string_buffer, |
99 | 48 | "{}{}: id={}, block_task={}, ready={}, _always_ready={}, count={}", |
100 | 48 | std::string(indentation_level * 2, ' '), _name, _node_id, _blocked_task.size(), |
101 | 48 | _ready, _always_ready, _counter); |
102 | 48 | return fmt::to_string(debug_string_buffer); |
103 | 48 | } |
104 | | |
105 | 17 | std::string RuntimeFilterDependency::debug_string(int indentation_level) { |
106 | 17 | fmt::memory_buffer debug_string_buffer; |
107 | 17 | fmt::format_to(debug_string_buffer, "{}, runtime filter: {}", |
108 | 17 | Dependency::debug_string(indentation_level), _runtime_filter->formatted_state()); |
109 | 17 | return fmt::to_string(debug_string_buffer); |
110 | 17 | } |
111 | | |
112 | 825k | Dependency* RuntimeFilterDependency::is_blocked_by(std::shared_ptr<PipelineTask> task) { |
113 | 825k | std::unique_lock<std::mutex> lc(_task_lock); |
114 | 825k | auto ready = _ready.load(); |
115 | 825k | if (!ready && task) { |
116 | 14.4k | _add_block_task(task); |
117 | 14.4k | task->_blocked_dep = this; |
118 | 14.4k | } |
119 | 825k | return ready ? nullptr : this; |
120 | 825k | } |
121 | | |
122 | 74 | void RuntimeFilterTimer::call_timeout() { |
123 | 74 | _parent->set_ready(); |
124 | 74 | } |
125 | | |
126 | 15.6k | void RuntimeFilterTimer::call_ready() { |
127 | 15.6k | _parent->set_ready(); |
128 | 15.6k | } |
129 | | |
130 | | // should check rf timeout in two case: |
131 | | // 1. the rf is ready just remove the wait queue |
132 | | // 2. if the rf have local dependency, the rf should start wait when all local dependency is ready |
133 | 835k | bool RuntimeFilterTimer::should_be_check_timeout() { |
134 | 835k | if (!_parent->ready() && !_local_runtime_filter_dependencies.empty()) { |
135 | 37.1k | bool all_ready = true; |
136 | 37.1k | for (auto& dep : _local_runtime_filter_dependencies) { |
137 | 37.1k | if (!dep->ready()) { |
138 | 37.1k | all_ready = false; |
139 | 37.1k | break; |
140 | 37.1k | } |
141 | 37.1k | } |
142 | 37.1k | if (all_ready) { |
143 | 0 | _local_runtime_filter_dependencies.clear(); |
144 | 0 | _registration_time = MonotonicMillis(); |
145 | 0 | } |
146 | 37.1k | return all_ready; |
147 | 37.1k | } |
148 | 798k | return true; |
149 | 835k | } |
150 | | |
151 | 7 | void RuntimeFilterTimerQueue::start() { |
152 | 120k | while (!_stop) { |
153 | 120k | std::unique_lock<std::mutex> lk(cv_m); |
154 | | |
155 | 123k | while (_que.empty() && !_stop) { |
156 | 6.36k | cv.wait_for(lk, std::chrono::seconds(3), [this] { return !_que.empty() || _stop; }); |
157 | 3.18k | } |
158 | 120k | if (_stop) { |
159 | 3 | break; |
160 | 3 | } |
161 | 120k | { |
162 | 120k | std::unique_lock<std::mutex> lc(_que_lock); |
163 | 120k | std::list<std::shared_ptr<pipeline::RuntimeFilterTimer>> new_que; |
164 | 835k | for (auto& it : _que) { |
165 | 835k | if (it.use_count() == 1) { |
166 | | // `use_count == 1` means this runtime filter has been released |
167 | 835k | } else if (it->should_be_check_timeout()) { |
168 | 798k | if (it->force_wait_timeout() || it->_parent->is_blocked_by(nullptr)) { |
169 | | // This means runtime filter is not ready, so we call timeout or continue to poll this timer. |
170 | 783k | int64_t ms_since_registration = MonotonicMillis() - it->registration_time(); |
171 | 783k | if (ms_since_registration > it->wait_time_ms()) { |
172 | 74 | it->call_timeout(); |
173 | 782k | } else { |
174 | 782k | new_que.push_back(std::move(it)); |
175 | 782k | } |
176 | 783k | } |
177 | 798k | } else { |
178 | 37.1k | new_que.push_back(std::move(it)); |
179 | 37.1k | } |
180 | 835k | } |
181 | 120k | new_que.swap(_que); |
182 | 120k | } |
183 | 120k | std::this_thread::sleep_for(std::chrono::milliseconds(interval)); |
184 | 120k | } |
185 | 7 | _shutdown = true; |
186 | 7 | } |
187 | | |
188 | 560k | void LocalExchangeSharedState::sub_running_sink_operators() { |
189 | 560k | std::unique_lock<std::mutex> lc(le_lock); |
190 | 560k | if (exchanger->_running_sink_operators.fetch_sub(1) == 1) { |
191 | 172k | _set_always_ready(); |
192 | 172k | } |
193 | 560k | } |
194 | | |
195 | | void LocalExchangeSharedState::sub_running_source_operators( |
196 | 1.01M | LocalExchangeSourceLocalState& local_state) { |
197 | 1.01M | std::unique_lock<std::mutex> lc(le_lock); |
198 | 1.01M | if (exchanger->_running_source_operators.fetch_sub(1) == 1) { |
199 | 172k | _set_always_ready(); |
200 | 172k | exchanger->finalize(local_state); |
201 | 172k | } |
202 | 1.01M | } |
203 | | |
204 | 172k | LocalExchangeSharedState::LocalExchangeSharedState(int num_instances) { |
205 | 172k | source_deps.resize(num_instances, nullptr); |
206 | 172k | mem_counters.resize(num_instances, nullptr); |
207 | 172k | } |
208 | | |
209 | 97 | vectorized::MutableColumns AggSharedState::_get_keys_hash_table() { |
210 | 97 | return std::visit( |
211 | 97 | vectorized::Overload { |
212 | 97 | [&](std::monostate& arg) { |
213 | 0 | throw doris::Exception(ErrorCode::INTERNAL_ERROR, "uninited hash table"); |
214 | 0 | return vectorized::MutableColumns(); |
215 | 0 | }, |
216 | 97 | [&](auto&& agg_method) -> vectorized::MutableColumns { |
217 | 97 | vectorized::MutableColumns key_columns; |
218 | 306 | for (int i = 0; i < probe_expr_ctxs.size(); ++i) { |
219 | 209 | key_columns.emplace_back( |
220 | 209 | probe_expr_ctxs[i]->root()->data_type()->create_column()); |
221 | 209 | } |
222 | 97 | auto& data = *agg_method.hash_table; |
223 | 97 | bool has_null_key = data.has_null_key_data(); |
224 | 97 | const auto size = data.size() - has_null_key; |
225 | 97 | using KeyType = std::decay_t<decltype(agg_method.iterator->get_first())>; |
226 | 97 | std::vector<KeyType> keys(size); |
227 | | |
228 | 97 | size_t num_rows = 0; |
229 | 97 | auto iter = aggregate_data_container->begin(); |
230 | 97 | { |
231 | 18.4k | while (iter != aggregate_data_container->end()) { |
232 | 18.3k | keys[num_rows] = iter.get_key<KeyType>(); |
233 | 18.3k | ++iter; |
234 | 18.3k | ++num_rows; |
235 | 18.3k | } |
236 | 97 | } |
237 | 97 | agg_method.insert_keys_into_columns(keys, key_columns, num_rows); |
238 | 97 | if (has_null_key) { |
239 | 1 | key_columns[0]->insert_data(nullptr, 0); |
240 | 1 | } |
241 | 97 | return key_columns; |
242 | 97 | }}, dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized16MethodSerializedI9PHHashMapINS_9StringRefEPc11DefaultHashIS7_vELb0EEEEEESt6vectorIN3COWINS4_7IColumnEE11mutable_ptrISG_EESaISJ_EEOT_ Line | Count | Source | 216 | 57 | [&](auto&& agg_method) -> vectorized::MutableColumns { | 217 | 57 | vectorized::MutableColumns key_columns; | 218 | 226 | for (int i = 0; i < probe_expr_ctxs.size(); ++i) { | 219 | 169 | key_columns.emplace_back( | 220 | 169 | probe_expr_ctxs[i]->root()->data_type()->create_column()); | 221 | 169 | } | 222 | 57 | auto& data = *agg_method.hash_table; | 223 | 57 | bool has_null_key = data.has_null_key_data(); | 224 | 57 | const auto size = data.size() - has_null_key; | 225 | 57 | using KeyType = std::decay_t<decltype(agg_method.iterator->get_first())>; | 226 | 57 | std::vector<KeyType> keys(size); | 227 | | | 228 | 57 | size_t num_rows = 0; | 229 | 57 | auto iter = aggregate_data_container->begin(); | 230 | 57 | { | 231 | 13.4k | while (iter != aggregate_data_container->end()) { | 232 | 13.3k | keys[num_rows] = iter.get_key<KeyType>(); | 233 | 13.3k | ++iter; | 234 | 13.3k | ++num_rows; | 235 | 13.3k | } | 236 | 57 | } | 237 | 57 | agg_method.insert_keys_into_columns(keys, key_columns, num_rows); | 238 | 57 | if (has_null_key) { | 239 | 0 | key_columns[0]->insert_data(nullptr, 0); | 240 | 0 | } | 241 | 57 | return key_columns; | 242 | 57 | }}, |
Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized15MethodOneNumberIh9PHHashMapIhPc11DefaultHashIhvELb0EEEEEESt6vectorIN3COWINS4_7IColumnEE11mutable_ptrISF_EESaISI_EEOT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized15MethodOneNumberIt9PHHashMapItPc11DefaultHashItvELb0EEEEEESt6vectorIN3COWINS4_7IColumnEE11mutable_ptrISF_EESaISI_EEOT_ dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized15MethodOneNumberIj9PHHashMapIjPc9HashCRC32IjELb0EEEEEESt6vectorIN3COWINS4_7IColumnEE11mutable_ptrISF_EESaISI_EEOT_ Line | Count | Source | 216 | 4 | [&](auto&& agg_method) -> vectorized::MutableColumns { | 217 | 4 | vectorized::MutableColumns key_columns; | 218 | 8 | for (int i = 0; i < probe_expr_ctxs.size(); ++i) { | 219 | 4 | key_columns.emplace_back( | 220 | 4 | probe_expr_ctxs[i]->root()->data_type()->create_column()); | 221 | 4 | } | 222 | 4 | auto& data = *agg_method.hash_table; | 223 | 4 | bool has_null_key = data.has_null_key_data(); | 224 | 4 | const auto size = data.size() - has_null_key; | 225 | 4 | using KeyType = std::decay_t<decltype(agg_method.iterator->get_first())>; | 226 | 4 | std::vector<KeyType> keys(size); | 227 | | | 228 | 4 | size_t num_rows = 0; | 229 | 4 | auto iter = aggregate_data_container->begin(); | 230 | 4 | { | 231 | 12 | while (iter != aggregate_data_container->end()) { | 232 | 8 | keys[num_rows] = iter.get_key<KeyType>(); | 233 | 8 | ++iter; | 234 | 8 | ++num_rows; | 235 | 8 | } | 236 | 4 | } | 237 | 4 | agg_method.insert_keys_into_columns(keys, key_columns, num_rows); | 238 | 4 | if (has_null_key) { | 239 | 0 | key_columns[0]->insert_data(nullptr, 0); | 240 | 0 | } | 241 | 4 | return key_columns; | 242 | 4 | }}, |
dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized15MethodOneNumberIm9PHHashMapImPc9HashCRC32ImELb0EEEEEESt6vectorIN3COWINS4_7IColumnEE11mutable_ptrISF_EESaISI_EEOT_ Line | Count | Source | 216 | 4 | [&](auto&& agg_method) -> vectorized::MutableColumns { | 217 | 4 | vectorized::MutableColumns key_columns; | 218 | 8 | for (int i = 0; i < probe_expr_ctxs.size(); ++i) { | 219 | 4 | key_columns.emplace_back( | 220 | 4 | probe_expr_ctxs[i]->root()->data_type()->create_column()); | 221 | 4 | } | 222 | 4 | auto& data = *agg_method.hash_table; | 223 | 4 | bool has_null_key = data.has_null_key_data(); | 224 | 4 | const auto size = data.size() - has_null_key; | 225 | 4 | using KeyType = std::decay_t<decltype(agg_method.iterator->get_first())>; | 226 | 4 | std::vector<KeyType> keys(size); | 227 | | | 228 | 4 | size_t num_rows = 0; | 229 | 4 | auto iter = aggregate_data_container->begin(); | 230 | 4 | { | 231 | 24 | while (iter != aggregate_data_container->end()) { | 232 | 20 | keys[num_rows] = iter.get_key<KeyType>(); | 233 | 20 | ++iter; | 234 | 20 | ++num_rows; | 235 | 20 | } | 236 | 4 | } | 237 | 4 | agg_method.insert_keys_into_columns(keys, key_columns, num_rows); | 238 | 4 | if (has_null_key) { | 239 | 0 | key_columns[0]->insert_data(nullptr, 0); | 240 | 0 | } | 241 | 4 | return key_columns; | 242 | 4 | }}, |
Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized19MethodStringNoCacheINS_13StringHashMapIPc9AllocatorILb1ELb1ELb0E22DefaultMemoryAllocatorEEEEEEESt6vectorIN3COWINS4_7IColumnEE11mutable_ptrISG_EESaISJ_EEOT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized15MethodOneNumberIN4wide7integerILm128EjEE9PHHashMapIS8_Pc9HashCRC32IS8_ELb0EEEEEESt6vectorIN3COWINS4_7IColumnEE11mutable_ptrISI_EESaISL_EEOT_ dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized15MethodOneNumberIj9PHHashMapIjPc14HashMixWrapperIj9HashCRC32IjEELb0EEEEEESt6vectorIN3COWINS4_7IColumnEE11mutable_ptrISH_EESaISK_EEOT_ Line | Count | Source | 216 | 6 | [&](auto&& agg_method) -> vectorized::MutableColumns { | 217 | 6 | vectorized::MutableColumns key_columns; | 218 | 12 | for (int i = 0; i < probe_expr_ctxs.size(); ++i) { | 219 | 6 | key_columns.emplace_back( | 220 | 6 | probe_expr_ctxs[i]->root()->data_type()->create_column()); | 221 | 6 | } | 222 | 6 | auto& data = *agg_method.hash_table; | 223 | 6 | bool has_null_key = data.has_null_key_data(); | 224 | 6 | const auto size = data.size() - has_null_key; | 225 | 6 | using KeyType = std::decay_t<decltype(agg_method.iterator->get_first())>; | 226 | 6 | std::vector<KeyType> keys(size); | 227 | | | 228 | 6 | size_t num_rows = 0; | 229 | 6 | auto iter = aggregate_data_container->begin(); | 230 | 6 | { | 231 | 12 | while (iter != aggregate_data_container->end()) { | 232 | 6 | keys[num_rows] = iter.get_key<KeyType>(); | 233 | 6 | ++iter; | 234 | 6 | ++num_rows; | 235 | 6 | } | 236 | 6 | } | 237 | 6 | agg_method.insert_keys_into_columns(keys, key_columns, num_rows); | 238 | 6 | if (has_null_key) { | 239 | 0 | key_columns[0]->insert_data(nullptr, 0); | 240 | 0 | } | 241 | 6 | return key_columns; | 242 | 6 | }}, |
dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized15MethodOneNumberIm9PHHashMapImPc14HashMixWrapperIm9HashCRC32ImEELb0EEEEEESt6vectorIN3COWINS4_7IColumnEE11mutable_ptrISH_EESaISK_EEOT_ Line | Count | Source | 216 | 4 | [&](auto&& agg_method) -> vectorized::MutableColumns { | 217 | 4 | vectorized::MutableColumns key_columns; | 218 | 8 | for (int i = 0; i < probe_expr_ctxs.size(); ++i) { | 219 | 4 | key_columns.emplace_back( | 220 | 4 | probe_expr_ctxs[i]->root()->data_type()->create_column()); | 221 | 4 | } | 222 | 4 | auto& data = *agg_method.hash_table; | 223 | 4 | bool has_null_key = data.has_null_key_data(); | 224 | 4 | const auto size = data.size() - has_null_key; | 225 | 4 | using KeyType = std::decay_t<decltype(agg_method.iterator->get_first())>; | 226 | 4 | std::vector<KeyType> keys(size); | 227 | | | 228 | 4 | size_t num_rows = 0; | 229 | 4 | auto iter = aggregate_data_container->begin(); | 230 | 4 | { | 231 | 13 | while (iter != aggregate_data_container->end()) { | 232 | 9 | keys[num_rows] = iter.get_key<KeyType>(); | 233 | 9 | ++iter; | 234 | 9 | ++num_rows; | 235 | 9 | } | 236 | 4 | } | 237 | 4 | agg_method.insert_keys_into_columns(keys, key_columns, num_rows); | 238 | 4 | if (has_null_key) { | 239 | 0 | key_columns[0]->insert_data(nullptr, 0); | 240 | 0 | } | 241 | 4 | return key_columns; | 242 | 4 | }}, |
Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized15MethodOneNumberIN4wide7integerILm128EjEE9PHHashMapIS8_Pc14HashMixWrapperIS8_9HashCRC32IS8_EELb0EEEEEESt6vectorIN3COWINS4_7IColumnEE11mutable_ptrISK_EESaISN_EEOT_ dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberIhNS4_15DataWithNullKeyI9PHHashMapIhPc11DefaultHashIhvELb0EEEEEEEEEESt6vectorIN3COWINS4_7IColumnEE11mutable_ptrISJ_EESaISM_EEOT_ Line | Count | Source | 216 | 3 | [&](auto&& agg_method) -> vectorized::MutableColumns { | 217 | 3 | vectorized::MutableColumns key_columns; | 218 | 6 | for (int i = 0; i < probe_expr_ctxs.size(); ++i) { | 219 | 3 | key_columns.emplace_back( | 220 | 3 | probe_expr_ctxs[i]->root()->data_type()->create_column()); | 221 | 3 | } | 222 | 3 | auto& data = *agg_method.hash_table; | 223 | 3 | bool has_null_key = data.has_null_key_data(); | 224 | 3 | const auto size = data.size() - has_null_key; | 225 | 3 | using KeyType = std::decay_t<decltype(agg_method.iterator->get_first())>; | 226 | 3 | std::vector<KeyType> keys(size); | 227 | | | 228 | 3 | size_t num_rows = 0; | 229 | 3 | auto iter = aggregate_data_container->begin(); | 230 | 3 | { | 231 | 13 | while (iter != aggregate_data_container->end()) { | 232 | 10 | keys[num_rows] = iter.get_key<KeyType>(); | 233 | 10 | ++iter; | 234 | 10 | ++num_rows; | 235 | 10 | } | 236 | 3 | } | 237 | 3 | agg_method.insert_keys_into_columns(keys, key_columns, num_rows); | 238 | 3 | if (has_null_key) { | 239 | 0 | key_columns[0]->insert_data(nullptr, 0); | 240 | 0 | } | 241 | 3 | return key_columns; | 242 | 3 | }}, |
Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberItNS4_15DataWithNullKeyI9PHHashMapItPc11DefaultHashItvELb0EEEEEEEEEESt6vectorIN3COWINS4_7IColumnEE11mutable_ptrISJ_EESaISM_EEOT_ dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberIjNS4_15DataWithNullKeyI9PHHashMapIjPc9HashCRC32IjELb0EEEEEEEEEESt6vectorIN3COWINS4_7IColumnEE11mutable_ptrISJ_EESaISM_EEOT_ Line | Count | Source | 216 | 4 | [&](auto&& agg_method) -> vectorized::MutableColumns { | 217 | 4 | vectorized::MutableColumns key_columns; | 218 | 8 | for (int i = 0; i < probe_expr_ctxs.size(); ++i) { | 219 | 4 | key_columns.emplace_back( | 220 | 4 | probe_expr_ctxs[i]->root()->data_type()->create_column()); | 221 | 4 | } | 222 | 4 | auto& data = *agg_method.hash_table; | 223 | 4 | bool has_null_key = data.has_null_key_data(); | 224 | 4 | const auto size = data.size() - has_null_key; | 225 | 4 | using KeyType = std::decay_t<decltype(agg_method.iterator->get_first())>; | 226 | 4 | std::vector<KeyType> keys(size); | 227 | | | 228 | 4 | size_t num_rows = 0; | 229 | 4 | auto iter = aggregate_data_container->begin(); | 230 | 4 | { | 231 | 2.45k | while (iter != aggregate_data_container->end()) { | 232 | 2.45k | keys[num_rows] = iter.get_key<KeyType>(); | 233 | 2.45k | ++iter; | 234 | 2.45k | ++num_rows; | 235 | 2.45k | } | 236 | 4 | } | 237 | 4 | agg_method.insert_keys_into_columns(keys, key_columns, num_rows); | 238 | 4 | if (has_null_key) { | 239 | 0 | key_columns[0]->insert_data(nullptr, 0); | 240 | 0 | } | 241 | 4 | return key_columns; | 242 | 4 | }}, |
dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberImNS4_15DataWithNullKeyI9PHHashMapImPc9HashCRC32ImELb0EEEEEEEEEESt6vectorIN3COWINS4_7IColumnEE11mutable_ptrISJ_EESaISM_EEOT_ Line | Count | Source | 216 | 4 | [&](auto&& agg_method) -> vectorized::MutableColumns { | 217 | 4 | vectorized::MutableColumns key_columns; | 218 | 8 | for (int i = 0; i < probe_expr_ctxs.size(); ++i) { | 219 | 4 | key_columns.emplace_back( | 220 | 4 | probe_expr_ctxs[i]->root()->data_type()->create_column()); | 221 | 4 | } | 222 | 4 | auto& data = *agg_method.hash_table; | 223 | 4 | bool has_null_key = data.has_null_key_data(); | 224 | 4 | const auto size = data.size() - has_null_key; | 225 | 4 | using KeyType = std::decay_t<decltype(agg_method.iterator->get_first())>; | 226 | 4 | std::vector<KeyType> keys(size); | 227 | | | 228 | 4 | size_t num_rows = 0; | 229 | 4 | auto iter = aggregate_data_container->begin(); | 230 | 4 | { | 231 | 2.45k | while (iter != aggregate_data_container->end()) { | 232 | 2.44k | keys[num_rows] = iter.get_key<KeyType>(); | 233 | 2.44k | ++iter; | 234 | 2.44k | ++num_rows; | 235 | 2.44k | } | 236 | 4 | } | 237 | 4 | agg_method.insert_keys_into_columns(keys, key_columns, num_rows); | 238 | 4 | if (has_null_key) { | 239 | 0 | key_columns[0]->insert_data(nullptr, 0); | 240 | 0 | } | 241 | 4 | return key_columns; | 242 | 4 | }}, |
dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberIjNS4_15DataWithNullKeyI9PHHashMapIjPc14HashMixWrapperIj9HashCRC32IjEELb0EEEEEEEEEESt6vectorIN3COWINS4_7IColumnEE11mutable_ptrISL_EESaISO_EEOT_ Line | Count | Source | 216 | 5 | [&](auto&& agg_method) -> vectorized::MutableColumns { | 217 | 5 | vectorized::MutableColumns key_columns; | 218 | 10 | for (int i = 0; i < probe_expr_ctxs.size(); ++i) { | 219 | 5 | key_columns.emplace_back( | 220 | 5 | probe_expr_ctxs[i]->root()->data_type()->create_column()); | 221 | 5 | } | 222 | 5 | auto& data = *agg_method.hash_table; | 223 | 5 | bool has_null_key = data.has_null_key_data(); | 224 | 5 | const auto size = data.size() - has_null_key; | 225 | 5 | using KeyType = std::decay_t<decltype(agg_method.iterator->get_first())>; | 226 | 5 | std::vector<KeyType> keys(size); | 227 | | | 228 | 5 | size_t num_rows = 0; | 229 | 5 | auto iter = aggregate_data_container->begin(); | 230 | 5 | { | 231 | 17 | while (iter != aggregate_data_container->end()) { | 232 | 12 | keys[num_rows] = iter.get_key<KeyType>(); | 233 | 12 | ++iter; | 234 | 12 | ++num_rows; | 235 | 12 | } | 236 | 5 | } | 237 | 5 | agg_method.insert_keys_into_columns(keys, key_columns, num_rows); | 238 | 5 | if (has_null_key) { | 239 | 1 | key_columns[0]->insert_data(nullptr, 0); | 240 | 1 | } | 241 | 5 | return key_columns; | 242 | 5 | }}, |
dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberImNS4_15DataWithNullKeyI9PHHashMapImPc14HashMixWrapperIm9HashCRC32ImEELb0EEEEEEEEEESt6vectorIN3COWINS4_7IColumnEE11mutable_ptrISL_EESaISO_EEOT_ Line | Count | Source | 216 | 6 | [&](auto&& agg_method) -> vectorized::MutableColumns { | 217 | 6 | vectorized::MutableColumns key_columns; | 218 | 12 | for (int i = 0; i < probe_expr_ctxs.size(); ++i) { | 219 | 6 | key_columns.emplace_back( | 220 | 6 | probe_expr_ctxs[i]->root()->data_type()->create_column()); | 221 | 6 | } | 222 | 6 | auto& data = *agg_method.hash_table; | 223 | 6 | bool has_null_key = data.has_null_key_data(); | 224 | 6 | const auto size = data.size() - has_null_key; | 225 | 6 | using KeyType = std::decay_t<decltype(agg_method.iterator->get_first())>; | 226 | 6 | std::vector<KeyType> keys(size); | 227 | | | 228 | 6 | size_t num_rows = 0; | 229 | 6 | auto iter = aggregate_data_container->begin(); | 230 | 6 | { | 231 | 24 | while (iter != aggregate_data_container->end()) { | 232 | 18 | keys[num_rows] = iter.get_key<KeyType>(); | 233 | 18 | ++iter; | 234 | 18 | ++num_rows; | 235 | 18 | } | 236 | 6 | } | 237 | 6 | agg_method.insert_keys_into_columns(keys, key_columns, num_rows); | 238 | 6 | if (has_null_key) { | 239 | 0 | key_columns[0]->insert_data(nullptr, 0); | 240 | 0 | } | 241 | 6 | return key_columns; | 242 | 6 | }}, |
Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberIN4wide7integerILm128EjEENS4_15DataWithNullKeyI9PHHashMapIS9_Pc9HashCRC32IS9_ELb0EEEEEEEEEESt6vectorIN3COWINS4_7IColumnEE11mutable_ptrISM_EESaISP_EEOT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberIN4wide7integerILm128EjEENS4_15DataWithNullKeyI9PHHashMapIS9_Pc14HashMixWrapperIS9_9HashCRC32IS9_EELb0EEEEEEEEEESt6vectorIN3COWINS4_7IColumnEE11mutable_ptrISO_EESaISR_EEOT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized26MethodSingleNullableColumnINS4_19MethodStringNoCacheINS4_15DataWithNullKeyINS_13StringHashMapIPc9AllocatorILb1ELb1ELb0E22DefaultMemoryAllocatorEEEEEEEEEEESt6vectorIN3COWINS4_7IColumnEE11mutable_ptrISK_EESaISN_EEOT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized15MethodKeysFixedI9PHHashMapImPc9HashCRC32ImELb0EELb0EEEEESt6vectorIN3COWINS4_7IColumnEE11mutable_ptrISF_EESaISI_EEOT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized15MethodKeysFixedI9PHHashMapImPc9HashCRC32ImELb0EELb1EEEEESt6vectorIN3COWINS4_7IColumnEE11mutable_ptrISF_EESaISI_EEOT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized15MethodKeysFixedI9PHHashMapIN4wide7integerILm128EjEEPc9HashCRC32IS9_ELb0EELb0EEEEESt6vectorIN3COWINS4_7IColumnEE11mutable_ptrISI_EESaISL_EEOT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized15MethodKeysFixedI9PHHashMapIN4wide7integerILm128EjEEPc9HashCRC32IS9_ELb0EELb1EEEEESt6vectorIN3COWINS4_7IColumnEE11mutable_ptrISI_EESaISL_EEOT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized15MethodKeysFixedI9PHHashMapIN4wide7integerILm256EjEEPc9HashCRC32IS9_ELb0EELb0EEEEESt6vectorIN3COWINS4_7IColumnEE11mutable_ptrISI_EESaISL_EEOT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized15MethodKeysFixedI9PHHashMapIN4wide7integerILm256EjEEPc9HashCRC32IS9_ELb0EELb1EEEEESt6vectorIN3COWINS4_7IColumnEE11mutable_ptrISI_EESaISL_EEOT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized15MethodKeysFixedI9PHHashMapINS4_7UInt136EPc9HashCRC32IS7_ELb0EELb0EEEEESt6vectorIN3COWINS4_7IColumnEE11mutable_ptrISG_EESaISJ_EEOT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized15MethodKeysFixedI9PHHashMapINS4_7UInt136EPc9HashCRC32IS7_ELb0EELb1EEEEESt6vectorIN3COWINS4_7IColumnEE11mutable_ptrISG_EESaISJ_EEOT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized15MethodKeysFixedI9PHHashMapImPc14HashMixWrapperIm9HashCRC32ImEELb0EELb0EEEEESt6vectorIN3COWINS4_7IColumnEE11mutable_ptrISH_EESaISK_EEOT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized15MethodKeysFixedI9PHHashMapImPc14HashMixWrapperIm9HashCRC32ImEELb0EELb1EEEEESt6vectorIN3COWINS4_7IColumnEE11mutable_ptrISH_EESaISK_EEOT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized15MethodKeysFixedI9PHHashMapIN4wide7integerILm128EjEEPc14HashMixWrapperIS9_9HashCRC32IS9_EELb0EELb0EEEEESt6vectorIN3COWINS4_7IColumnEE11mutable_ptrISK_EESaISN_EEOT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized15MethodKeysFixedI9PHHashMapIN4wide7integerILm128EjEEPc14HashMixWrapperIS9_9HashCRC32IS9_EELb0EELb1EEEEESt6vectorIN3COWINS4_7IColumnEE11mutable_ptrISK_EESaISN_EEOT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized15MethodKeysFixedI9PHHashMapIN4wide7integerILm256EjEEPc14HashMixWrapperIS9_9HashCRC32IS9_EELb0EELb0EEEEESt6vectorIN3COWINS4_7IColumnEE11mutable_ptrISK_EESaISN_EEOT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized15MethodKeysFixedI9PHHashMapIN4wide7integerILm256EjEEPc14HashMixWrapperIS9_9HashCRC32IS9_EELb0EELb1EEEEESt6vectorIN3COWINS4_7IColumnEE11mutable_ptrISK_EESaISN_EEOT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized15MethodKeysFixedI9PHHashMapINS4_7UInt136EPc14HashMixWrapperIS7_9HashCRC32IS7_EELb0EELb0EEEEESt6vectorIN3COWINS4_7IColumnEE11mutable_ptrISI_EESaISL_EEOT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized15MethodKeysFixedI9PHHashMapINS4_7UInt136EPc14HashMixWrapperIS7_9HashCRC32IS7_EELb0EELb1EEEEESt6vectorIN3COWINS4_7IColumnEE11mutable_ptrISI_EESaISL_EEOT_ |
243 | 97 | agg_data->method_variant); |
244 | 97 | } |
245 | | |
246 | 97 | void AggSharedState::build_limit_heap(size_t hash_table_size) { |
247 | 97 | limit_columns = _get_keys_hash_table(); |
248 | 18.4k | for (size_t i = 0; i < hash_table_size; ++i) { |
249 | 18.3k | limit_heap.emplace(i, limit_columns, order_directions, null_directions); |
250 | 18.3k | } |
251 | 18.1k | while (hash_table_size > limit) { |
252 | 18.0k | limit_heap.pop(); |
253 | 18.0k | hash_table_size--; |
254 | 18.0k | } |
255 | 97 | limit_columns_min = limit_heap.top()._row_id; |
256 | 97 | } |
257 | | |
258 | | bool AggSharedState::do_limit_filter(vectorized::Block* block, size_t num_rows, |
259 | 209 | const std::vector<int>* key_locs) { |
260 | 209 | if (num_rows) { |
261 | 209 | cmp_res.resize(num_rows); |
262 | 209 | need_computes.resize(num_rows); |
263 | 209 | memset(need_computes.data(), 0, need_computes.size()); |
264 | 209 | memset(cmp_res.data(), 0, cmp_res.size()); |
265 | | |
266 | 209 | const auto key_size = null_directions.size(); |
267 | 701 | for (int i = 0; i < key_size; i++) { |
268 | 492 | block->get_by_position(key_locs ? key_locs->operator[](i) : i) |
269 | 492 | .column->compare_internal(limit_columns_min, *limit_columns[i], |
270 | 492 | null_directions[i], order_directions[i], cmp_res, |
271 | 492 | need_computes.data()); |
272 | 492 | } |
273 | | |
274 | 209 | auto set_computes_arr = [](auto* __restrict res, auto* __restrict computes, int rows) { |
275 | 418k | for (int i = 0; i < rows; ++i) { |
276 | 418k | computes[i] = computes[i] == res[i]; |
277 | 418k | } |
278 | 209 | }; |
279 | 209 | set_computes_arr(cmp_res.data(), need_computes.data(), num_rows); |
280 | | |
281 | 209 | return std::find(need_computes.begin(), need_computes.end(), 0) != need_computes.end(); |
282 | 209 | } |
283 | | |
284 | 0 | return false; |
285 | 209 | } |
286 | | |
287 | 0 | Status AggSharedState::reset_hash_table() { |
288 | 0 | return std::visit( |
289 | 0 | vectorized::Overload { |
290 | 0 | [&](std::monostate& arg) -> Status { |
291 | 0 | return Status::InternalError("Uninited hash table"); |
292 | 0 | }, |
293 | 0 | [&](auto& agg_method) { |
294 | 0 | auto& hash_table = *agg_method.hash_table; |
295 | 0 | using HashTableType = std::decay_t<decltype(hash_table)>; |
296 | |
|
297 | 0 | agg_method.reset(); |
298 | |
|
299 | 0 | hash_table.for_each_mapped([&](auto& mapped) { |
300 | 0 | if (mapped) { |
301 | 0 | static_cast<void>(_destroy_agg_status(mapped)); |
302 | 0 | mapped = nullptr; |
303 | 0 | } |
304 | 0 | }); Unexecuted instantiation: dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized16MethodSerializedI9PHHashMapINS_9StringRefEPc11DefaultHashIS7_vELb0EEEEEEDaRT_ENKUlSE_E_clIS8_EEDaSE_ Unexecuted instantiation: dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodOneNumberIh9PHHashMapIhPc11DefaultHashIhvELb0EEEEEEDaRT_ENKUlSD_E_clIS7_EEDaSD_ Unexecuted instantiation: dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodOneNumberIt9PHHashMapItPc11DefaultHashItvELb0EEEEEEDaRT_ENKUlSD_E_clIS7_EEDaSD_ Unexecuted instantiation: dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodOneNumberIj9PHHashMapIjPc9HashCRC32IjELb0EEEEEEDaRT_ENKUlSD_E_clIS7_EEDaSD_ Unexecuted instantiation: dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodOneNumberIm9PHHashMapImPc9HashCRC32ImELb0EEEEEEDaRT_ENKUlSD_E_clIS7_EEDaSD_ Unexecuted instantiation: dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized19MethodStringNoCacheINS_13StringHashMapIPc9AllocatorILb1ELb1ELb0E22DefaultMemoryAllocatorEEEEEEEDaRT_ENKUlSE_E_clIS7_EEDaSE_ Unexecuted instantiation: dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodOneNumberIN4wide7integerILm128EjEE9PHHashMapIS8_Pc9HashCRC32IS8_ELb0EEEEEEDaRT_ENKUlSG_E_clISA_EEDaSG_ Unexecuted instantiation: dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodOneNumberIj9PHHashMapIjPc14HashMixWrapperIj9HashCRC32IjEELb0EEEEEEDaRT_ENKUlSF_E_clIS7_EEDaSF_ Unexecuted instantiation: dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodOneNumberIm9PHHashMapImPc14HashMixWrapperIm9HashCRC32ImEELb0EEEEEEDaRT_ENKUlSF_E_clIS7_EEDaSF_ Unexecuted instantiation: dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodOneNumberIN4wide7integerILm128EjEE9PHHashMapIS8_Pc14HashMixWrapperIS8_9HashCRC32IS8_EELb0EEEEEEDaRT_ENKUlSI_E_clISA_EEDaSI_ Unexecuted instantiation: dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberIhNS4_15DataWithNullKeyI9PHHashMapIhPc11DefaultHashIhvELb0EEEEEEEEEEDaRT_ENKUlSH_E_clIS9_EEDaSH_ Unexecuted instantiation: dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberItNS4_15DataWithNullKeyI9PHHashMapItPc11DefaultHashItvELb0EEEEEEEEEEDaRT_ENKUlSH_E_clIS9_EEDaSH_ Unexecuted instantiation: dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberIjNS4_15DataWithNullKeyI9PHHashMapIjPc9HashCRC32IjELb0EEEEEEEEEEDaRT_ENKUlSH_E_clIS9_EEDaSH_ Unexecuted instantiation: dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberImNS4_15DataWithNullKeyI9PHHashMapImPc9HashCRC32ImELb0EEEEEEEEEEDaRT_ENKUlSH_E_clIS9_EEDaSH_ Unexecuted instantiation: dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberIjNS4_15DataWithNullKeyI9PHHashMapIjPc14HashMixWrapperIj9HashCRC32IjEELb0EEEEEEEEEEDaRT_ENKUlSJ_E_clIS9_EEDaSJ_ Unexecuted instantiation: dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberImNS4_15DataWithNullKeyI9PHHashMapImPc14HashMixWrapperIm9HashCRC32ImEELb0EEEEEEEEEEDaRT_ENKUlSJ_E_clIS9_EEDaSJ_ Unexecuted instantiation: dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberIN4wide7integerILm128EjEENS4_15DataWithNullKeyI9PHHashMapIS9_Pc9HashCRC32IS9_ELb0EEEEEEEEEEDaRT_ENKUlSK_E_clISC_EEDaSK_ Unexecuted instantiation: dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberIN4wide7integerILm128EjEENS4_15DataWithNullKeyI9PHHashMapIS9_Pc14HashMixWrapperIS9_9HashCRC32IS9_EELb0EEEEEEEEEEDaRT_ENKUlSM_E_clISC_EEDaSM_ Unexecuted instantiation: dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_19MethodStringNoCacheINS4_15DataWithNullKeyINS_13StringHashMapIPc9AllocatorILb1ELb1ELb0E22DefaultMemoryAllocatorEEEEEEEEEEEDaRT_ENKUlSI_E_clIS9_EEDaSI_ Unexecuted instantiation: dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodKeysFixedI9PHHashMapImPc9HashCRC32ImELb0EELb0EEEEEDaRT_ENKUlSD_E_clIS7_EEDaSD_ Unexecuted instantiation: dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodKeysFixedI9PHHashMapImPc9HashCRC32ImELb0EELb1EEEEEDaRT_ENKUlSD_E_clIS7_EEDaSD_ Unexecuted instantiation: dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodKeysFixedI9PHHashMapIN4wide7integerILm128EjEEPc9HashCRC32IS9_ELb0EELb0EEEEEDaRT_ENKUlSG_E_clISA_EEDaSG_ Unexecuted instantiation: dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodKeysFixedI9PHHashMapIN4wide7integerILm128EjEEPc9HashCRC32IS9_ELb0EELb1EEEEEDaRT_ENKUlSG_E_clISA_EEDaSG_ Unexecuted instantiation: dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodKeysFixedI9PHHashMapIN4wide7integerILm256EjEEPc9HashCRC32IS9_ELb0EELb0EEEEEDaRT_ENKUlSG_E_clISA_EEDaSG_ Unexecuted instantiation: dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodKeysFixedI9PHHashMapIN4wide7integerILm256EjEEPc9HashCRC32IS9_ELb0EELb1EEEEEDaRT_ENKUlSG_E_clISA_EEDaSG_ Unexecuted instantiation: dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodKeysFixedI9PHHashMapINS4_7UInt136EPc9HashCRC32IS7_ELb0EELb0EEEEEDaRT_ENKUlSE_E_clIS8_EEDaSE_ Unexecuted instantiation: dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodKeysFixedI9PHHashMapINS4_7UInt136EPc9HashCRC32IS7_ELb0EELb1EEEEEDaRT_ENKUlSE_E_clIS8_EEDaSE_ Unexecuted instantiation: dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodKeysFixedI9PHHashMapImPc14HashMixWrapperIm9HashCRC32ImEELb0EELb0EEEEEDaRT_ENKUlSF_E_clIS7_EEDaSF_ Unexecuted instantiation: dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodKeysFixedI9PHHashMapImPc14HashMixWrapperIm9HashCRC32ImEELb0EELb1EEEEEDaRT_ENKUlSF_E_clIS7_EEDaSF_ Unexecuted instantiation: dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodKeysFixedI9PHHashMapIN4wide7integerILm128EjEEPc14HashMixWrapperIS9_9HashCRC32IS9_EELb0EELb0EEEEEDaRT_ENKUlSI_E_clISA_EEDaSI_ Unexecuted instantiation: dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodKeysFixedI9PHHashMapIN4wide7integerILm128EjEEPc14HashMixWrapperIS9_9HashCRC32IS9_EELb0EELb1EEEEEDaRT_ENKUlSI_E_clISA_EEDaSI_ Unexecuted instantiation: dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodKeysFixedI9PHHashMapIN4wide7integerILm256EjEEPc14HashMixWrapperIS9_9HashCRC32IS9_EELb0EELb0EEEEEDaRT_ENKUlSI_E_clISA_EEDaSI_ Unexecuted instantiation: dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodKeysFixedI9PHHashMapIN4wide7integerILm256EjEEPc14HashMixWrapperIS9_9HashCRC32IS9_EELb0EELb1EEEEEDaRT_ENKUlSI_E_clISA_EEDaSI_ Unexecuted instantiation: dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodKeysFixedI9PHHashMapINS4_7UInt136EPc14HashMixWrapperIS7_9HashCRC32IS7_EELb0EELb0EEEEEDaRT_ENKUlSG_E_clIS8_EEDaSG_ Unexecuted instantiation: dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodKeysFixedI9PHHashMapINS4_7UInt136EPc14HashMixWrapperIS7_9HashCRC32IS7_EELb0EELb1EEEEEDaRT_ENKUlSG_E_clIS8_EEDaSG_ |
305 | |
|
306 | 0 | if (hash_table.has_null_key_data()) { |
307 | 0 | auto st = _destroy_agg_status(hash_table.template get_null_key_data< |
308 | 0 | vectorized::AggregateDataPtr>()); |
309 | 0 | RETURN_IF_ERROR(st); |
310 | 0 | } |
311 | | |
312 | 0 | aggregate_data_container.reset(new AggregateDataContainer( |
313 | 0 | sizeof(typename HashTableType::key_type), |
314 | 0 | ((total_size_of_aggregate_states + align_aggregate_states - 1) / |
315 | 0 | align_aggregate_states) * |
316 | 0 | align_aggregate_states)); |
317 | 0 | agg_method.hash_table.reset(new HashTableType()); |
318 | 0 | agg_arena_pool.reset(new vectorized::Arena); |
319 | 0 | return Status::OK(); |
320 | 0 | }}, Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized16MethodSerializedI9PHHashMapINS_9StringRefEPc11DefaultHashIS7_vELb0EEEEEEDaRT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodOneNumberIh9PHHashMapIhPc11DefaultHashIhvELb0EEEEEEDaRT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodOneNumberIt9PHHashMapItPc11DefaultHashItvELb0EEEEEEDaRT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodOneNumberIj9PHHashMapIjPc9HashCRC32IjELb0EEEEEEDaRT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodOneNumberIm9PHHashMapImPc9HashCRC32ImELb0EEEEEEDaRT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized19MethodStringNoCacheINS_13StringHashMapIPc9AllocatorILb1ELb1ELb0E22DefaultMemoryAllocatorEEEEEEEDaRT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodOneNumberIN4wide7integerILm128EjEE9PHHashMapIS8_Pc9HashCRC32IS8_ELb0EEEEEEDaRT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodOneNumberIj9PHHashMapIjPc14HashMixWrapperIj9HashCRC32IjEELb0EEEEEEDaRT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodOneNumberIm9PHHashMapImPc14HashMixWrapperIm9HashCRC32ImEELb0EEEEEEDaRT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodOneNumberIN4wide7integerILm128EjEE9PHHashMapIS8_Pc14HashMixWrapperIS8_9HashCRC32IS8_EELb0EEEEEEDaRT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberIhNS4_15DataWithNullKeyI9PHHashMapIhPc11DefaultHashIhvELb0EEEEEEEEEEDaRT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberItNS4_15DataWithNullKeyI9PHHashMapItPc11DefaultHashItvELb0EEEEEEEEEEDaRT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberIjNS4_15DataWithNullKeyI9PHHashMapIjPc9HashCRC32IjELb0EEEEEEEEEEDaRT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberImNS4_15DataWithNullKeyI9PHHashMapImPc9HashCRC32ImELb0EEEEEEEEEEDaRT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberIjNS4_15DataWithNullKeyI9PHHashMapIjPc14HashMixWrapperIj9HashCRC32IjEELb0EEEEEEEEEEDaRT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberImNS4_15DataWithNullKeyI9PHHashMapImPc14HashMixWrapperIm9HashCRC32ImEELb0EEEEEEEEEEDaRT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberIN4wide7integerILm128EjEENS4_15DataWithNullKeyI9PHHashMapIS9_Pc9HashCRC32IS9_ELb0EEEEEEEEEEDaRT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberIN4wide7integerILm128EjEENS4_15DataWithNullKeyI9PHHashMapIS9_Pc14HashMixWrapperIS9_9HashCRC32IS9_EELb0EEEEEEEEEEDaRT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_19MethodStringNoCacheINS4_15DataWithNullKeyINS_13StringHashMapIPc9AllocatorILb1ELb1ELb0E22DefaultMemoryAllocatorEEEEEEEEEEEDaRT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodKeysFixedI9PHHashMapImPc9HashCRC32ImELb0EELb0EEEEEDaRT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodKeysFixedI9PHHashMapImPc9HashCRC32ImELb0EELb1EEEEEDaRT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodKeysFixedI9PHHashMapIN4wide7integerILm128EjEEPc9HashCRC32IS9_ELb0EELb0EEEEEDaRT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodKeysFixedI9PHHashMapIN4wide7integerILm128EjEEPc9HashCRC32IS9_ELb0EELb1EEEEEDaRT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodKeysFixedI9PHHashMapIN4wide7integerILm256EjEEPc9HashCRC32IS9_ELb0EELb0EEEEEDaRT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodKeysFixedI9PHHashMapIN4wide7integerILm256EjEEPc9HashCRC32IS9_ELb0EELb1EEEEEDaRT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodKeysFixedI9PHHashMapINS4_7UInt136EPc9HashCRC32IS7_ELb0EELb0EEEEEDaRT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodKeysFixedI9PHHashMapINS4_7UInt136EPc9HashCRC32IS7_ELb0EELb1EEEEEDaRT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodKeysFixedI9PHHashMapImPc14HashMixWrapperIm9HashCRC32ImEELb0EELb0EEEEEDaRT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodKeysFixedI9PHHashMapImPc14HashMixWrapperIm9HashCRC32ImEELb0EELb1EEEEEDaRT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodKeysFixedI9PHHashMapIN4wide7integerILm128EjEEPc14HashMixWrapperIS9_9HashCRC32IS9_EELb0EELb0EEEEEDaRT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodKeysFixedI9PHHashMapIN4wide7integerILm128EjEEPc14HashMixWrapperIS9_9HashCRC32IS9_EELb0EELb1EEEEEDaRT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodKeysFixedI9PHHashMapIN4wide7integerILm256EjEEPc14HashMixWrapperIS9_9HashCRC32IS9_EELb0EELb0EEEEEDaRT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodKeysFixedI9PHHashMapIN4wide7integerILm256EjEEPc14HashMixWrapperIS9_9HashCRC32IS9_EELb0EELb1EEEEEDaRT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodKeysFixedI9PHHashMapINS4_7UInt136EPc14HashMixWrapperIS7_9HashCRC32IS7_EELb0EELb0EEEEEDaRT_ Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodKeysFixedI9PHHashMapINS4_7UInt136EPc14HashMixWrapperIS7_9HashCRC32IS7_EELb0EELb1EEEEEDaRT_ |
321 | 0 | agg_data->method_variant); |
322 | 0 | } |
323 | | |
324 | 6 | void PartitionedAggSharedState::init_spill_params(size_t spill_partition_count_bits) { |
325 | 6 | partition_count_bits = spill_partition_count_bits; |
326 | 6 | partition_count = (1 << spill_partition_count_bits); |
327 | 6 | max_partition_index = partition_count - 1; |
328 | | |
329 | 102 | for (int i = 0; i < partition_count; ++i) { |
330 | 96 | spill_partitions.emplace_back(std::make_shared<AggSpillPartition>()); |
331 | 96 | } |
332 | 6 | } |
333 | | |
334 | | Status AggSpillPartition::get_spill_stream(RuntimeState* state, int node_id, |
335 | | RuntimeProfile* profile, |
336 | 0 | vectorized::SpillStreamSPtr& spill_stream) { |
337 | 0 | if (spilling_stream_) { |
338 | 0 | spill_stream = spilling_stream_; |
339 | 0 | return Status::OK(); |
340 | 0 | } |
341 | 0 | RETURN_IF_ERROR(ExecEnv::GetInstance()->spill_stream_mgr()->register_spill_stream( |
342 | 0 | state, spilling_stream_, print_id(state->query_id()), "agg", node_id, |
343 | 0 | std::numeric_limits<int32_t>::max(), std::numeric_limits<size_t>::max(), profile)); |
344 | 0 | spill_streams_.emplace_back(spilling_stream_); |
345 | 0 | spill_stream = spilling_stream_; |
346 | 0 | return Status::OK(); |
347 | 0 | } |
348 | 96 | void AggSpillPartition::close() { |
349 | 96 | if (spilling_stream_) { |
350 | 0 | spilling_stream_.reset(); |
351 | 0 | } |
352 | 96 | for (auto& stream : spill_streams_) { |
353 | 0 | (void)ExecEnv::GetInstance()->spill_stream_mgr()->delete_spill_stream(stream); |
354 | 0 | } |
355 | 96 | spill_streams_.clear(); |
356 | 96 | } |
357 | | |
358 | 6 | void PartitionedAggSharedState::close() { |
359 | | // need to use CAS instead of only `if (!is_closed)` statement, |
360 | | // to avoid concurrent entry of close() both pass the if statement |
361 | 6 | bool false_close = false; |
362 | 6 | if (!is_closed.compare_exchange_strong(false_close, true)) { |
363 | 0 | return; |
364 | 0 | } |
365 | 6 | DCHECK(!false_close && is_closed); |
366 | 96 | for (auto partition : spill_partitions) { |
367 | 96 | partition->close(); |
368 | 96 | } |
369 | 6 | spill_partitions.clear(); |
370 | 6 | } |
371 | | |
372 | 0 | void SpillSortSharedState::close() { |
373 | | // need to use CAS instead of only `if (!is_closed)` statement, |
374 | | // to avoid concurrent entry of close() both pass the if statement |
375 | 0 | bool false_close = false; |
376 | 0 | if (!is_closed.compare_exchange_strong(false_close, true)) { |
377 | 0 | return; |
378 | 0 | } |
379 | 0 | DCHECK(!false_close && is_closed); |
380 | 0 | for (auto& stream : sorted_streams) { |
381 | 0 | (void)ExecEnv::GetInstance()->spill_stream_mgr()->delete_spill_stream(stream); |
382 | 0 | } |
383 | 0 | sorted_streams.clear(); |
384 | 0 | } |
385 | | |
386 | | MultiCastSharedState::MultiCastSharedState(const RowDescriptor& row_desc, ObjectPool* pool, |
387 | | int cast_sender_count) |
388 | | : multi_cast_data_streamer(std::make_unique<pipeline::MultiCastDataStreamer>( |
389 | 1.25k | row_desc, pool, cast_sender_count, true)) {} |
390 | | |
391 | 126k | int AggSharedState::get_slot_column_id(const vectorized::AggFnEvaluator* evaluator) { |
392 | 126k | auto ctxs = evaluator->input_exprs_ctxs(); |
393 | 18.4E | CHECK(ctxs.size() == 1 && ctxs[0]->root()->is_slot_ref()) |
394 | 18.4E | << "input_exprs_ctxs is invalid, input_exprs_ctx[0]=" |
395 | 18.4E | << ctxs[0]->root()->debug_string(); |
396 | 126k | return ((vectorized::VSlotRef*)ctxs[0]->root().get())->column_id(); |
397 | 126k | } |
398 | | |
399 | 17.8M | Status AggSharedState::_destroy_agg_status(vectorized::AggregateDataPtr data) { |
400 | 40.6M | for (int i = 0; i < aggregate_evaluators.size(); ++i) { |
401 | 22.7M | aggregate_evaluators[i]->function()->destroy(data + offsets_of_aggregate_states[i]); |
402 | 22.7M | } |
403 | 17.8M | return Status::OK(); |
404 | 17.8M | } |
405 | | |
406 | | void AggSharedState::refresh_top_limit(size_t row_id, |
407 | 51 | const vectorized::ColumnRawPtrs& key_columns) { |
408 | 231 | for (int j = 0; j < key_columns.size(); ++j) { |
409 | 180 | limit_columns[j]->insert_from(*key_columns[j], row_id); |
410 | 180 | } |
411 | 51 | limit_heap.emplace(limit_columns[0]->size() - 1, limit_columns, order_directions, |
412 | 51 | null_directions); |
413 | | |
414 | 51 | limit_heap.pop(); |
415 | 51 | limit_columns_min = limit_heap.top()._row_id; |
416 | 51 | } |
417 | | |
418 | 172k | LocalExchangeSharedState::~LocalExchangeSharedState() = default; |
419 | | |
420 | | } // namespace doris::pipeline |