Coverage Report

Created: 2026-03-04 17:27

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/root/doris/be/src/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 "dependency.h"
19
20
#include <memory>
21
#include <mutex>
22
23
#include "common/logging.h"
24
#include "exec/rowid_fetcher.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 "runtime_filter/runtime_filter_consumer.h"
31
#include "util/brpc_client_cache.h"
32
#include "vec/exec/scan/file_scanner.h"
33
#include "vec/exprs/vectorized_agg_fn.h"
34
#include "vec/exprs/vslot_ref.h"
35
#include "vec/spill/spill_stream_manager.h"
36
#include "vec/utils/util.hpp"
37
38
namespace doris::pipeline {
39
#include "common/compile_check_begin.h"
40
41
Dependency* BasicSharedState::create_source_dependency(int operator_id, int node_id,
42
539k
                                                       const std::string& name) {
43
539k
    source_deps.push_back(std::make_shared<Dependency>(operator_id, node_id, name + "_DEPENDENCY"));
44
539k
    source_deps.back()->set_shared_state(this);
45
539k
    return source_deps.back().get();
46
539k
}
47
48
void BasicSharedState::create_source_dependencies(int num_sources, int operator_id, int node_id,
49
107k
                                                  const std::string& name) {
50
107k
    source_deps.resize(num_sources, nullptr);
51
752k
    for (auto& source_dep : source_deps) {
52
752k
        source_dep = std::make_shared<Dependency>(operator_id, node_id, name + "_DEPENDENCY");
53
752k
        source_dep->set_shared_state(this);
54
752k
    }
55
107k
}
56
57
Dependency* BasicSharedState::create_sink_dependency(int dest_id, int node_id,
58
1.10M
                                                     const std::string& name) {
59
1.10M
    sink_deps.push_back(std::make_shared<Dependency>(dest_id, node_id, name + "_DEPENDENCY", true));
60
1.10M
    sink_deps.back()->set_shared_state(this);
61
1.10M
    return sink_deps.back().get();
62
1.10M
}
63
64
4.80M
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
4.80M
    _blocked_task.push_back(task);
69
4.80M
}
70
71
68.4M
void Dependency::set_ready() {
72
68.4M
    if (_ready) {
73
65.9M
        return;
74
65.9M
    }
75
2.54M
    std::vector<std::weak_ptr<PipelineTask>> local_block_task {};
76
2.54M
    {
77
2.54M
        std::unique_lock<std::mutex> lc(_task_lock);
78
2.54M
        if (_ready) {
79
166
            return;
80
166
        }
81
2.54M
        _watcher.stop();
82
2.54M
        _ready = true;
83
2.54M
        local_block_task.swap(_blocked_task);
84
2.54M
    }
85
4.82M
    for (auto task : local_block_task) {
86
4.82M
        if (auto t = task.lock()) {
87
4.82M
            std::unique_lock<std::mutex> lc(_task_lock);
88
4.82M
            THROW_IF_ERROR(t->wake_up(this, lc));
89
4.82M
        }
90
4.82M
    }
91
2.54M
}
92
93
91.5M
Dependency* Dependency::is_blocked_by(std::shared_ptr<PipelineTask> task) {
94
91.5M
    std::unique_lock<std::mutex> lc(_task_lock);
95
91.5M
    auto ready = _ready.load();
96
91.5M
    if (!ready && task) {
97
4.82M
        _add_block_task(task);
98
4.82M
        start_watcher();
99
4.82M
        THROW_IF_ERROR(task->blocked(this, lc));
100
4.82M
    }
101
91.5M
    return ready ? nullptr : this;
102
91.5M
}
103
104
234k
std::string Dependency::debug_string(int indentation_level) {
105
234k
    fmt::memory_buffer debug_string_buffer;
106
234k
    fmt::format_to(debug_string_buffer, "{}{}: id={}, block task = {}, ready={}, _always_ready={}",
107
234k
                   std::string(indentation_level * 2, ' '), _name, _node_id, _blocked_task.size(),
108
234k
                   _ready, _always_ready);
109
234k
    return fmt::to_string(debug_string_buffer);
110
234k
}
111
112
36
std::string CountedFinishDependency::debug_string(int indentation_level) {
113
36
    fmt::memory_buffer debug_string_buffer;
114
36
    fmt::format_to(debug_string_buffer,
115
36
                   "{}{}: id={}, block_task={}, ready={}, _always_ready={}, count={}",
116
36
                   std::string(indentation_level * 2, ' '), _name, _node_id, _blocked_task.size(),
117
36
                   _ready, _always_ready, _counter);
118
36
    return fmt::to_string(debug_string_buffer);
119
36
}
120
121
1.46k
void RuntimeFilterTimer::call_timeout() {
122
1.46k
    _parent->set_ready();
123
1.46k
}
124
125
74.0k
void RuntimeFilterTimer::call_ready() {
126
74.0k
    _parent->set_ready();
127
74.0k
}
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.04M
bool RuntimeFilterTimer::should_be_check_timeout() {
133
9.04M
    if (!_parent->ready() && !_local_runtime_filter_dependencies.empty()) {
134
703k
        bool all_ready = true;
135
703k
        for (auto& dep : _local_runtime_filter_dependencies) {
136
703k
            if (!dep->ready()) {
137
703k
                all_ready = false;
138
703k
                break;
139
703k
            }
140
703k
        }
141
703k
        if (all_ready) {
142
8
            _local_runtime_filter_dependencies.clear();
143
8
            _registration_time = MonotonicMillis();
144
8
        }
145
703k
        return all_ready;
146
703k
    }
147
8.33M
    return true;
148
9.04M
}
149
150
8
void RuntimeFilterTimerQueue::start() {
151
280k
    while (!_stop) {
152
280k
        std::unique_lock<std::mutex> lk(cv_m);
153
154
283k
        while (_que.empty() && !_stop) {
155
5.49k
            cv.wait_for(lk, std::chrono::seconds(3), [this] { return !_que.empty() || _stop; });
156
2.74k
        }
157
280k
        if (_stop) {
158
3
            break;
159
3
        }
160
280k
        {
161
280k
            std::unique_lock<std::mutex> lc(_que_lock);
162
280k
            std::list<std::shared_ptr<pipeline::RuntimeFilterTimer>> new_que;
163
9.04M
            for (auto& it : _que) {
164
9.04M
                if (it.use_count() == 1) {
165
                    // `use_count == 1` means this runtime filter has been released
166
9.04M
                } else if (it->should_be_check_timeout()) {
167
8.33M
                    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.26M
                        int64_t ms_since_registration = MonotonicMillis() - it->registration_time();
170
8.26M
                        if (ms_since_registration > it->wait_time_ms()) {
171
1.46k
                            it->call_timeout();
172
8.26M
                        } else {
173
8.26M
                            new_que.push_back(std::move(it));
174
8.26M
                        }
175
8.26M
                    }
176
8.33M
                } else {
177
703k
                    new_que.push_back(std::move(it));
178
703k
                }
179
9.04M
            }
180
280k
            new_que.swap(_que);
181
280k
        }
182
280k
        std::this_thread::sleep_for(std::chrono::milliseconds(interval));
183
280k
    }
184
8
    _shutdown = true;
185
8
}
186
187
324k
void LocalExchangeSharedState::sub_running_sink_operators() {
188
324k
    std::unique_lock<std::mutex> lc(le_lock);
189
324k
    if (exchanger->_running_sink_operators.fetch_sub(1) == 1) {
190
105k
        _set_always_ready();
191
105k
    }
192
324k
}
193
194
736k
void LocalExchangeSharedState::sub_running_source_operators() {
195
736k
    std::unique_lock<std::mutex> lc(le_lock);
196
736k
    if (exchanger->_running_source_operators.fetch_sub(1) == 1) {
197
105k
        _set_always_ready();
198
105k
        exchanger->finalize();
199
105k
    }
200
736k
}
201
202
105k
LocalExchangeSharedState::LocalExchangeSharedState(int num_instances) {
203
105k
    source_deps.resize(num_instances, nullptr);
204
105k
    mem_counters.resize(num_instances, nullptr);
205
105k
}
206
207
115
vectorized::MutableColumns AggSharedState::_get_keys_hash_table() {
208
115
    return std::visit(
209
115
            vectorized::Overload {
210
115
                    [&](std::monostate& arg) {
211
0
                        throw doris::Exception(ErrorCode::INTERNAL_ERROR, "uninited hash table");
212
0
                        return vectorized::MutableColumns();
213
0
                    },
214
115
                    [&](auto&& agg_method) -> vectorized::MutableColumns {
215
115
                        vectorized::MutableColumns key_columns;
216
370
                        for (int i = 0; i < probe_expr_ctxs.size(); ++i) {
217
255
                            key_columns.emplace_back(
218
255
                                    probe_expr_ctxs[i]->root()->data_type()->create_column());
219
255
                        }
220
115
                        auto& data = *agg_method.hash_table;
221
115
                        bool has_null_key = data.has_null_key_data();
222
115
                        const auto size = data.size() - has_null_key;
223
115
                        using KeyType = std::decay_t<decltype(agg_method)>::Key;
224
115
                        std::vector<KeyType> keys(size);
225
226
115
                        uint32_t num_rows = 0;
227
115
                        auto iter = aggregate_data_container->begin();
228
115
                        {
229
14.5k
                            while (iter != aggregate_data_container->end()) {
230
14.4k
                                keys[num_rows] = iter.get_key<KeyType>();
231
14.4k
                                ++iter;
232
14.4k
                                ++num_rows;
233
14.4k
                            }
234
115
                        }
235
115
                        agg_method.insert_keys_into_columns(keys, key_columns, num_rows);
236
115
                        if (has_null_key) {
237
2
                            key_columns[0]->insert_data(nullptr, 0);
238
2
                        }
239
115
                        return key_columns;
240
115
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized16MethodSerializedI9PHHashMapINS_9StringRefEPc11DefaultHashIS7_vEEEEEESt6vectorINS_3COWINS4_7IColumnEE11mutable_ptrISG_EESaISJ_EEOT_
Line
Count
Source
214
10
                    [&](auto&& agg_method) -> vectorized::MutableColumns {
215
10
                        vectorized::MutableColumns key_columns;
216
50
                        for (int i = 0; i < probe_expr_ctxs.size(); ++i) {
217
40
                            key_columns.emplace_back(
218
40
                                    probe_expr_ctxs[i]->root()->data_type()->create_column());
219
40
                        }
220
10
                        auto& data = *agg_method.hash_table;
221
10
                        bool has_null_key = data.has_null_key_data();
222
10
                        const auto size = data.size() - has_null_key;
223
10
                        using KeyType = std::decay_t<decltype(agg_method)>::Key;
224
10
                        std::vector<KeyType> keys(size);
225
226
10
                        uint32_t num_rows = 0;
227
10
                        auto iter = aggregate_data_container->begin();
228
10
                        {
229
7.66k
                            while (iter != aggregate_data_container->end()) {
230
7.65k
                                keys[num_rows] = iter.get_key<KeyType>();
231
7.65k
                                ++iter;
232
7.65k
                                ++num_rows;
233
7.65k
                            }
234
10
                        }
235
10
                        agg_method.insert_keys_into_columns(keys, key_columns, num_rows);
236
10
                        if (has_null_key) {
237
0
                            key_columns[0]->insert_data(nullptr, 0);
238
0
                        }
239
10
                        return key_columns;
240
10
                    }},
Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized15MethodOneNumberIh9PHHashMapIhPc9HashCRC32IhEEEEEESt6vectorINS_3COWINS4_7IColumnEE11mutable_ptrISF_EESaISI_EEOT_
Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized15MethodOneNumberIt9PHHashMapItPc9HashCRC32ItEEEEEESt6vectorINS_3COWINS4_7IColumnEE11mutable_ptrISF_EESaISI_EEOT_
dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized15MethodOneNumberIj9PHHashMapIjPc9HashCRC32IjEEEEEESt6vectorINS_3COWINS4_7IColumnEE11mutable_ptrISF_EESaISI_EEOT_
Line
Count
Source
214
4
                    [&](auto&& agg_method) -> vectorized::MutableColumns {
215
4
                        vectorized::MutableColumns key_columns;
216
8
                        for (int i = 0; i < probe_expr_ctxs.size(); ++i) {
217
4
                            key_columns.emplace_back(
218
4
                                    probe_expr_ctxs[i]->root()->data_type()->create_column());
219
4
                        }
220
4
                        auto& data = *agg_method.hash_table;
221
4
                        bool has_null_key = data.has_null_key_data();
222
4
                        const auto size = data.size() - has_null_key;
223
4
                        using KeyType = std::decay_t<decltype(agg_method)>::Key;
224
4
                        std::vector<KeyType> keys(size);
225
226
4
                        uint32_t num_rows = 0;
227
4
                        auto iter = aggregate_data_container->begin();
228
4
                        {
229
12
                            while (iter != aggregate_data_container->end()) {
230
8
                                keys[num_rows] = iter.get_key<KeyType>();
231
8
                                ++iter;
232
8
                                ++num_rows;
233
8
                            }
234
4
                        }
235
4
                        agg_method.insert_keys_into_columns(keys, key_columns, num_rows);
236
4
                        if (has_null_key) {
237
0
                            key_columns[0]->insert_data(nullptr, 0);
238
0
                        }
239
4
                        return key_columns;
240
4
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized15MethodOneNumberIm9PHHashMapImPc9HashCRC32ImEEEEEESt6vectorINS_3COWINS4_7IColumnEE11mutable_ptrISF_EESaISI_EEOT_
Line
Count
Source
214
2
                    [&](auto&& agg_method) -> vectorized::MutableColumns {
215
2
                        vectorized::MutableColumns key_columns;
216
4
                        for (int i = 0; i < probe_expr_ctxs.size(); ++i) {
217
2
                            key_columns.emplace_back(
218
2
                                    probe_expr_ctxs[i]->root()->data_type()->create_column());
219
2
                        }
220
2
                        auto& data = *agg_method.hash_table;
221
2
                        bool has_null_key = data.has_null_key_data();
222
2
                        const auto size = data.size() - has_null_key;
223
2
                        using KeyType = std::decay_t<decltype(agg_method)>::Key;
224
2
                        std::vector<KeyType> keys(size);
225
226
2
                        uint32_t num_rows = 0;
227
2
                        auto iter = aggregate_data_container->begin();
228
2
                        {
229
12
                            while (iter != aggregate_data_container->end()) {
230
10
                                keys[num_rows] = iter.get_key<KeyType>();
231
10
                                ++iter;
232
10
                                ++num_rows;
233
10
                            }
234
2
                        }
235
2
                        agg_method.insert_keys_into_columns(keys, key_columns, num_rows);
236
2
                        if (has_null_key) {
237
0
                            key_columns[0]->insert_data(nullptr, 0);
238
0
                        }
239
2
                        return key_columns;
240
2
                    }},
Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized19MethodStringNoCacheINS_13StringHashMapIPcNS_9AllocatorILb1ELb1ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEEEEESt6vectorINS_3COWINS4_7IColumnEE11mutable_ptrISG_EESaISJ_EEOT_
Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized15MethodOneNumberIN4wide7integerILm128EjEE9PHHashMapIS8_Pc9HashCRC32IS8_EEEEEESt6vectorINS_3COWINS4_7IColumnEE11mutable_ptrISI_EESaISL_EEOT_
Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized15MethodOneNumberIN4wide7integerILm256EjEE9PHHashMapIS8_Pc9HashCRC32IS8_EEEEEESt6vectorINS_3COWINS4_7IColumnEE11mutable_ptrISI_EESaISL_EEOT_
dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized15MethodOneNumberIj9PHHashMapIjPc14HashMixWrapperIj9HashCRC32IjEEEEEEESt6vectorINS_3COWINS4_7IColumnEE11mutable_ptrISH_EESaISK_EEOT_
Line
Count
Source
214
4
                    [&](auto&& agg_method) -> vectorized::MutableColumns {
215
4
                        vectorized::MutableColumns key_columns;
216
8
                        for (int i = 0; i < probe_expr_ctxs.size(); ++i) {
217
4
                            key_columns.emplace_back(
218
4
                                    probe_expr_ctxs[i]->root()->data_type()->create_column());
219
4
                        }
220
4
                        auto& data = *agg_method.hash_table;
221
4
                        bool has_null_key = data.has_null_key_data();
222
4
                        const auto size = data.size() - has_null_key;
223
4
                        using KeyType = std::decay_t<decltype(agg_method)>::Key;
224
4
                        std::vector<KeyType> keys(size);
225
226
4
                        uint32_t num_rows = 0;
227
4
                        auto iter = aggregate_data_container->begin();
228
4
                        {
229
8
                            while (iter != aggregate_data_container->end()) {
230
4
                                keys[num_rows] = iter.get_key<KeyType>();
231
4
                                ++iter;
232
4
                                ++num_rows;
233
4
                            }
234
4
                        }
235
4
                        agg_method.insert_keys_into_columns(keys, key_columns, num_rows);
236
4
                        if (has_null_key) {
237
0
                            key_columns[0]->insert_data(nullptr, 0);
238
0
                        }
239
4
                        return key_columns;
240
4
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized15MethodOneNumberIm9PHHashMapImPc14HashMixWrapperIm9HashCRC32ImEEEEEEESt6vectorINS_3COWINS4_7IColumnEE11mutable_ptrISH_EESaISK_EEOT_
Line
Count
Source
214
6
                    [&](auto&& agg_method) -> vectorized::MutableColumns {
215
6
                        vectorized::MutableColumns key_columns;
216
12
                        for (int i = 0; i < probe_expr_ctxs.size(); ++i) {
217
6
                            key_columns.emplace_back(
218
6
                                    probe_expr_ctxs[i]->root()->data_type()->create_column());
219
6
                        }
220
6
                        auto& data = *agg_method.hash_table;
221
6
                        bool has_null_key = data.has_null_key_data();
222
6
                        const auto size = data.size() - has_null_key;
223
6
                        using KeyType = std::decay_t<decltype(agg_method)>::Key;
224
6
                        std::vector<KeyType> keys(size);
225
226
6
                        uint32_t num_rows = 0;
227
6
                        auto iter = aggregate_data_container->begin();
228
6
                        {
229
29
                            while (iter != aggregate_data_container->end()) {
230
23
                                keys[num_rows] = iter.get_key<KeyType>();
231
23
                                ++iter;
232
23
                                ++num_rows;
233
23
                            }
234
6
                        }
235
6
                        agg_method.insert_keys_into_columns(keys, key_columns, num_rows);
236
6
                        if (has_null_key) {
237
0
                            key_columns[0]->insert_data(nullptr, 0);
238
0
                        }
239
6
                        return key_columns;
240
6
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberIhNS4_15DataWithNullKeyI9PHHashMapIhPc9HashCRC32IhEEEEEEEEEESt6vectorINS_3COWINS4_7IColumnEE11mutable_ptrISJ_EESaISM_EEOT_
Line
Count
Source
214
3
                    [&](auto&& agg_method) -> vectorized::MutableColumns {
215
3
                        vectorized::MutableColumns key_columns;
216
6
                        for (int i = 0; i < probe_expr_ctxs.size(); ++i) {
217
3
                            key_columns.emplace_back(
218
3
                                    probe_expr_ctxs[i]->root()->data_type()->create_column());
219
3
                        }
220
3
                        auto& data = *agg_method.hash_table;
221
3
                        bool has_null_key = data.has_null_key_data();
222
3
                        const auto size = data.size() - has_null_key;
223
3
                        using KeyType = std::decay_t<decltype(agg_method)>::Key;
224
3
                        std::vector<KeyType> keys(size);
225
226
3
                        uint32_t num_rows = 0;
227
3
                        auto iter = aggregate_data_container->begin();
228
3
                        {
229
13
                            while (iter != aggregate_data_container->end()) {
230
10
                                keys[num_rows] = iter.get_key<KeyType>();
231
10
                                ++iter;
232
10
                                ++num_rows;
233
10
                            }
234
3
                        }
235
3
                        agg_method.insert_keys_into_columns(keys, key_columns, num_rows);
236
3
                        if (has_null_key) {
237
0
                            key_columns[0]->insert_data(nullptr, 0);
238
0
                        }
239
3
                        return key_columns;
240
3
                    }},
Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberItNS4_15DataWithNullKeyI9PHHashMapItPc9HashCRC32ItEEEEEEEEEESt6vectorINS_3COWINS4_7IColumnEE11mutable_ptrISJ_EESaISM_EEOT_
dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberIjNS4_15DataWithNullKeyI9PHHashMapIjPc9HashCRC32IjEEEEEEEEEESt6vectorINS_3COWINS4_7IColumnEE11mutable_ptrISJ_EESaISM_EEOT_
Line
Count
Source
214
5
                    [&](auto&& agg_method) -> vectorized::MutableColumns {
215
5
                        vectorized::MutableColumns key_columns;
216
10
                        for (int i = 0; i < probe_expr_ctxs.size(); ++i) {
217
5
                            key_columns.emplace_back(
218
5
                                    probe_expr_ctxs[i]->root()->data_type()->create_column());
219
5
                        }
220
5
                        auto& data = *agg_method.hash_table;
221
5
                        bool has_null_key = data.has_null_key_data();
222
5
                        const auto size = data.size() - has_null_key;
223
5
                        using KeyType = std::decay_t<decltype(agg_method)>::Key;
224
5
                        std::vector<KeyType> keys(size);
225
226
5
                        uint32_t num_rows = 0;
227
5
                        auto iter = aggregate_data_container->begin();
228
5
                        {
229
2.35k
                            while (iter != aggregate_data_container->end()) {
230
2.34k
                                keys[num_rows] = iter.get_key<KeyType>();
231
2.34k
                                ++iter;
232
2.34k
                                ++num_rows;
233
2.34k
                            }
234
5
                        }
235
5
                        agg_method.insert_keys_into_columns(keys, key_columns, num_rows);
236
5
                        if (has_null_key) {
237
0
                            key_columns[0]->insert_data(nullptr, 0);
238
0
                        }
239
5
                        return key_columns;
240
5
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberImNS4_15DataWithNullKeyI9PHHashMapImPc9HashCRC32ImEEEEEEEEEESt6vectorINS_3COWINS4_7IColumnEE11mutable_ptrISJ_EESaISM_EEOT_
Line
Count
Source
214
5
                    [&](auto&& agg_method) -> vectorized::MutableColumns {
215
5
                        vectorized::MutableColumns key_columns;
216
10
                        for (int i = 0; i < probe_expr_ctxs.size(); ++i) {
217
5
                            key_columns.emplace_back(
218
5
                                    probe_expr_ctxs[i]->root()->data_type()->create_column());
219
5
                        }
220
5
                        auto& data = *agg_method.hash_table;
221
5
                        bool has_null_key = data.has_null_key_data();
222
5
                        const auto size = data.size() - has_null_key;
223
5
                        using KeyType = std::decay_t<decltype(agg_method)>::Key;
224
5
                        std::vector<KeyType> keys(size);
225
226
5
                        uint32_t num_rows = 0;
227
5
                        auto iter = aggregate_data_container->begin();
228
5
                        {
229
2.00k
                            while (iter != aggregate_data_container->end()) {
230
1.99k
                                keys[num_rows] = iter.get_key<KeyType>();
231
1.99k
                                ++iter;
232
1.99k
                                ++num_rows;
233
1.99k
                            }
234
5
                        }
235
5
                        agg_method.insert_keys_into_columns(keys, key_columns, num_rows);
236
5
                        if (has_null_key) {
237
0
                            key_columns[0]->insert_data(nullptr, 0);
238
0
                        }
239
5
                        return key_columns;
240
5
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberIjNS4_15DataWithNullKeyI9PHHashMapIjPc14HashMixWrapperIj9HashCRC32IjEEEEEEEEEEESt6vectorINS_3COWINS4_7IColumnEE11mutable_ptrISL_EESaISO_EEOT_
Line
Count
Source
214
7
                    [&](auto&& agg_method) -> vectorized::MutableColumns {
215
7
                        vectorized::MutableColumns key_columns;
216
14
                        for (int i = 0; i < probe_expr_ctxs.size(); ++i) {
217
7
                            key_columns.emplace_back(
218
7
                                    probe_expr_ctxs[i]->root()->data_type()->create_column());
219
7
                        }
220
7
                        auto& data = *agg_method.hash_table;
221
7
                        bool has_null_key = data.has_null_key_data();
222
7
                        const auto size = data.size() - has_null_key;
223
7
                        using KeyType = std::decay_t<decltype(agg_method)>::Key;
224
7
                        std::vector<KeyType> keys(size);
225
226
7
                        uint32_t num_rows = 0;
227
7
                        auto iter = aggregate_data_container->begin();
228
7
                        {
229
23
                            while (iter != aggregate_data_container->end()) {
230
16
                                keys[num_rows] = iter.get_key<KeyType>();
231
16
                                ++iter;
232
16
                                ++num_rows;
233
16
                            }
234
7
                        }
235
7
                        agg_method.insert_keys_into_columns(keys, key_columns, num_rows);
236
7
                        if (has_null_key) {
237
1
                            key_columns[0]->insert_data(nullptr, 0);
238
1
                        }
239
7
                        return key_columns;
240
7
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberImNS4_15DataWithNullKeyI9PHHashMapImPc14HashMixWrapperIm9HashCRC32ImEEEEEEEEEEESt6vectorINS_3COWINS4_7IColumnEE11mutable_ptrISL_EESaISO_EEOT_
Line
Count
Source
214
8
                    [&](auto&& agg_method) -> vectorized::MutableColumns {
215
8
                        vectorized::MutableColumns key_columns;
216
16
                        for (int i = 0; i < probe_expr_ctxs.size(); ++i) {
217
8
                            key_columns.emplace_back(
218
8
                                    probe_expr_ctxs[i]->root()->data_type()->create_column());
219
8
                        }
220
8
                        auto& data = *agg_method.hash_table;
221
8
                        bool has_null_key = data.has_null_key_data();
222
8
                        const auto size = data.size() - has_null_key;
223
8
                        using KeyType = std::decay_t<decltype(agg_method)>::Key;
224
8
                        std::vector<KeyType> keys(size);
225
226
8
                        uint32_t num_rows = 0;
227
8
                        auto iter = aggregate_data_container->begin();
228
8
                        {
229
37
                            while (iter != aggregate_data_container->end()) {
230
29
                                keys[num_rows] = iter.get_key<KeyType>();
231
29
                                ++iter;
232
29
                                ++num_rows;
233
29
                            }
234
8
                        }
235
8
                        agg_method.insert_keys_into_columns(keys, key_columns, num_rows);
236
8
                        if (has_null_key) {
237
1
                            key_columns[0]->insert_data(nullptr, 0);
238
1
                        }
239
8
                        return key_columns;
240
8
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberIN4wide7integerILm128EjEENS4_15DataWithNullKeyI9PHHashMapIS9_Pc9HashCRC32IS9_EEEEEEEEEESt6vectorINS_3COWINS4_7IColumnEE11mutable_ptrISM_EESaISP_EEOT_
Line
Count
Source
214
1
                    [&](auto&& agg_method) -> vectorized::MutableColumns {
215
1
                        vectorized::MutableColumns key_columns;
216
2
                        for (int i = 0; i < probe_expr_ctxs.size(); ++i) {
217
1
                            key_columns.emplace_back(
218
1
                                    probe_expr_ctxs[i]->root()->data_type()->create_column());
219
1
                        }
220
1
                        auto& data = *agg_method.hash_table;
221
1
                        bool has_null_key = data.has_null_key_data();
222
1
                        const auto size = data.size() - has_null_key;
223
1
                        using KeyType = std::decay_t<decltype(agg_method)>::Key;
224
1
                        std::vector<KeyType> keys(size);
225
226
1
                        uint32_t num_rows = 0;
227
1
                        auto iter = aggregate_data_container->begin();
228
1
                        {
229
4
                            while (iter != aggregate_data_container->end()) {
230
3
                                keys[num_rows] = iter.get_key<KeyType>();
231
3
                                ++iter;
232
3
                                ++num_rows;
233
3
                            }
234
1
                        }
235
1
                        agg_method.insert_keys_into_columns(keys, key_columns, num_rows);
236
1
                        if (has_null_key) {
237
0
                            key_columns[0]->insert_data(nullptr, 0);
238
0
                        }
239
1
                        return key_columns;
240
1
                    }},
Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberIN4wide7integerILm256EjEENS4_15DataWithNullKeyI9PHHashMapIS9_Pc9HashCRC32IS9_EEEEEEEEEESt6vectorINS_3COWINS4_7IColumnEE11mutable_ptrISM_EESaISP_EEOT_
Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized26MethodSingleNullableColumnINS4_19MethodStringNoCacheINS4_15DataWithNullKeyINS_13StringHashMapIPcNS_9AllocatorILb1ELb1ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEEEEEEEEESt6vectorINS_3COWINS4_7IColumnEE11mutable_ptrISK_EESaISN_EEOT_
Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized15MethodKeysFixedI9PHHashMapImPc9HashCRC32ImEEEEEESt6vectorINS_3COWINS4_7IColumnEE11mutable_ptrISF_EESaISI_EEOT_
Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized15MethodKeysFixedI9PHHashMapINS4_6UInt72EPc9HashCRC32IS7_EEEEEESt6vectorINS_3COWINS4_7IColumnEE11mutable_ptrISG_EESaISJ_EEOT_
Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized15MethodKeysFixedI9PHHashMapINS4_6UInt96EPc9HashCRC32IS7_EEEEEESt6vectorINS_3COWINS4_7IColumnEE11mutable_ptrISG_EESaISJ_EEOT_
Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized15MethodKeysFixedI9PHHashMapINS4_7UInt104EPc9HashCRC32IS7_EEEEEESt6vectorINS_3COWINS4_7IColumnEE11mutable_ptrISG_EESaISJ_EEOT_
Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized15MethodKeysFixedI9PHHashMapIN4wide7integerILm128EjEEPc9HashCRC32IS9_EEEEEESt6vectorINS_3COWINS4_7IColumnEE11mutable_ptrISI_EESaISL_EEOT_
Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized15MethodKeysFixedI9PHHashMapINS4_7UInt136EPc9HashCRC32IS7_EEEEEESt6vectorINS_3COWINS4_7IColumnEE11mutable_ptrISG_EESaISJ_EEOT_
dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized15MethodKeysFixedI9PHHashMapIN4wide7integerILm256EjEEPc9HashCRC32IS9_EEEEEESt6vectorINS_3COWINS4_7IColumnEE11mutable_ptrISI_EESaISL_EEOT_
Line
Count
Source
214
60
                    [&](auto&& agg_method) -> vectorized::MutableColumns {
215
60
                        vectorized::MutableColumns key_columns;
216
230
                        for (int i = 0; i < probe_expr_ctxs.size(); ++i) {
217
170
                            key_columns.emplace_back(
218
170
                                    probe_expr_ctxs[i]->root()->data_type()->create_column());
219
170
                        }
220
60
                        auto& data = *agg_method.hash_table;
221
60
                        bool has_null_key = data.has_null_key_data();
222
60
                        const auto size = data.size() - has_null_key;
223
60
                        using KeyType = std::decay_t<decltype(agg_method)>::Key;
224
60
                        std::vector<KeyType> keys(size);
225
226
60
                        uint32_t num_rows = 0;
227
60
                        auto iter = aggregate_data_container->begin();
228
60
                        {
229
2.39k
                            while (iter != aggregate_data_container->end()) {
230
2.33k
                                keys[num_rows] = iter.get_key<KeyType>();
231
2.33k
                                ++iter;
232
2.33k
                                ++num_rows;
233
2.33k
                            }
234
60
                        }
235
60
                        agg_method.insert_keys_into_columns(keys, key_columns, num_rows);
236
60
                        if (has_null_key) {
237
0
                            key_columns[0]->insert_data(nullptr, 0);
238
0
                        }
239
60
                        return key_columns;
240
60
                    }},
241
115
            agg_data->method_variant);
242
115
}
243
244
115
void AggSharedState::build_limit_heap(size_t hash_table_size) {
245
115
    limit_columns = _get_keys_hash_table();
246
15.1k
    for (size_t i = 0; i < hash_table_size; ++i) {
247
15.0k
        limit_heap.emplace(i, limit_columns, order_directions, null_directions);
248
15.0k
    }
249
14.9k
    while (hash_table_size > limit) {
250
14.8k
        limit_heap.pop();
251
14.8k
        hash_table_size--;
252
14.8k
    }
253
115
    limit_columns_min = limit_heap.top()._row_id;
254
115
}
255
256
bool AggSharedState::do_limit_filter(vectorized::Block* block, size_t num_rows,
257
451
                                     const std::vector<int>* key_locs) {
258
451
    if (num_rows) {
259
451
        cmp_res.resize(num_rows);
260
451
        need_computes.resize(num_rows);
261
451
        memset(need_computes.data(), 0, need_computes.size());
262
451
        memset(cmp_res.data(), 0, cmp_res.size());
263
264
451
        const auto key_size = null_directions.size();
265
1.53k
        for (int i = 0; i < key_size; i++) {
266
1.08k
            block->get_by_position(key_locs ? key_locs->operator[](i) : i)
267
1.08k
                    .column->compare_internal(limit_columns_min, *limit_columns[i],
268
1.08k
                                              null_directions[i], order_directions[i], cmp_res,
269
1.08k
                                              need_computes.data());
270
1.08k
        }
271
272
452
        auto set_computes_arr = [](auto* __restrict res, auto* __restrict computes, size_t rows) {
273
478k
            for (size_t i = 0; i < rows; ++i) {
274
478k
                computes[i] = computes[i] == res[i];
275
478k
            }
276
452
        };
277
451
        set_computes_arr(cmp_res.data(), need_computes.data(), num_rows);
278
279
451
        return std::find(need_computes.begin(), need_computes.end(), 0) != need_computes.end();
280
451
    }
281
282
0
    return false;
283
451
}
284
285
2.54k
Status AggSharedState::reset_hash_table() {
286
2.54k
    return std::visit(
287
2.54k
            vectorized::Overload {
288
2.54k
                    [&](std::monostate& arg) -> Status {
289
0
                        return Status::InternalError("Uninited hash table");
290
0
                    },
291
2.54k
                    [&](auto& agg_method) {
292
2.54k
                        auto& hash_table = *agg_method.hash_table;
293
2.54k
                        using HashTableType = std::decay_t<decltype(hash_table)>;
294
295
2.54k
                        agg_method.arena.clear();
296
2.54k
                        agg_method.inited_iterator = false;
297
298
2.23M
                        hash_table.for_each_mapped([&](auto& mapped) {
299
2.23M
                            if (mapped) {
300
2.23M
                                _destroy_agg_status(mapped);
301
2.23M
                                mapped = nullptr;
302
2.23M
                            }
303
2.23M
                        });
Unexecuted instantiation: dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized16MethodSerializedI9PHHashMapINS_9StringRefEPc11DefaultHashIS7_vEEEEEEDaRT_ENKUlSE_E_clIS8_EEDaSE_
dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodOneNumberIh9PHHashMapIhPc9HashCRC32IhEEEEEEDaRT_ENKUlSD_E_clIS7_EEDaSD_
Line
Count
Source
298
44
                        hash_table.for_each_mapped([&](auto& mapped) {
299
44
                            if (mapped) {
300
44
                                _destroy_agg_status(mapped);
301
44
                                mapped = nullptr;
302
44
                            }
303
44
                        });
dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodOneNumberIt9PHHashMapItPc9HashCRC32ItEEEEEEDaRT_ENKUlSD_E_clIS7_EEDaSD_
Line
Count
Source
298
316
                        hash_table.for_each_mapped([&](auto& mapped) {
299
316
                            if (mapped) {
300
316
                                _destroy_agg_status(mapped);
301
316
                                mapped = nullptr;
302
316
                            }
303
316
                        });
Unexecuted instantiation: dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodOneNumberIj9PHHashMapIjPc9HashCRC32IjEEEEEEDaRT_ENKUlSD_E_clIS7_EEDaSD_
dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodOneNumberIm9PHHashMapImPc9HashCRC32ImEEEEEEDaRT_ENKUlSD_E_clIS7_EEDaSD_
Line
Count
Source
298
522
                        hash_table.for_each_mapped([&](auto& mapped) {
299
522
                            if (mapped) {
300
522
                                _destroy_agg_status(mapped);
301
522
                                mapped = nullptr;
302
522
                            }
303
522
                        });
Unexecuted instantiation: dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized19MethodStringNoCacheINS_13StringHashMapIPcNS_9AllocatorILb1ELb1ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEEEEEDaRT_ENKUlSE_E_clIS7_EEDaSE_
dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodOneNumberIN4wide7integerILm128EjEE9PHHashMapIS8_Pc9HashCRC32IS8_EEEEEEDaRT_ENKUlSG_E_clISA_EEDaSG_
Line
Count
Source
298
526
                        hash_table.for_each_mapped([&](auto& mapped) {
299
526
                            if (mapped) {
300
526
                                _destroy_agg_status(mapped);
301
526
                                mapped = nullptr;
302
526
                            }
303
526
                        });
Unexecuted instantiation: dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodOneNumberIN4wide7integerILm256EjEE9PHHashMapIS8_Pc9HashCRC32IS8_EEEEEEDaRT_ENKUlSG_E_clISA_EEDaSG_
dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodOneNumberIj9PHHashMapIjPc14HashMixWrapperIj9HashCRC32IjEEEEEEEDaRT_ENKUlSF_E_clIS7_EEDaSF_
Line
Count
Source
298
1.04M
                        hash_table.for_each_mapped([&](auto& mapped) {
299
1.04M
                            if (mapped) {
300
1.04M
                                _destroy_agg_status(mapped);
301
1.04M
                                mapped = nullptr;
302
1.04M
                            }
303
1.04M
                        });
dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodOneNumberIm9PHHashMapImPc14HashMixWrapperIm9HashCRC32ImEEEEEEEDaRT_ENKUlSF_E_clIS7_EEDaSF_
Line
Count
Source
298
1.43k
                        hash_table.for_each_mapped([&](auto& mapped) {
299
1.43k
                            if (mapped) {
300
1.43k
                                _destroy_agg_status(mapped);
301
1.43k
                                mapped = nullptr;
302
1.43k
                            }
303
1.43k
                        });
dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberIhNS4_15DataWithNullKeyI9PHHashMapIhPc9HashCRC32IhEEEEEEEEEEDaRT_ENKUlSH_E_clIS9_EEDaSH_
Line
Count
Source
298
194
                        hash_table.for_each_mapped([&](auto& mapped) {
299
194
                            if (mapped) {
300
194
                                _destroy_agg_status(mapped);
301
194
                                mapped = nullptr;
302
194
                            }
303
194
                        });
Unexecuted instantiation: dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberItNS4_15DataWithNullKeyI9PHHashMapItPc9HashCRC32ItEEEEEEEEEEDaRT_ENKUlSH_E_clIS9_EEDaSH_
dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberIjNS4_15DataWithNullKeyI9PHHashMapIjPc9HashCRC32IjEEEEEEEEEEDaRT_ENKUlSH_E_clIS9_EEDaSH_
Line
Count
Source
298
393k
                        hash_table.for_each_mapped([&](auto& mapped) {
299
393k
                            if (mapped) {
300
393k
                                _destroy_agg_status(mapped);
301
393k
                                mapped = nullptr;
302
393k
                            }
303
393k
                        });
dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberImNS4_15DataWithNullKeyI9PHHashMapImPc9HashCRC32ImEEEEEEEEEEDaRT_ENKUlSH_E_clIS9_EEDaSH_
Line
Count
Source
298
730
                        hash_table.for_each_mapped([&](auto& mapped) {
299
730
                            if (mapped) {
300
730
                                _destroy_agg_status(mapped);
301
730
                                mapped = nullptr;
302
730
                            }
303
730
                        });
dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberIjNS4_15DataWithNullKeyI9PHHashMapIjPc14HashMixWrapperIj9HashCRC32IjEEEEEEEEEEEDaRT_ENKUlSJ_E_clIS9_EEDaSJ_
Line
Count
Source
298
787k
                        hash_table.for_each_mapped([&](auto& mapped) {
299
787k
                            if (mapped) {
300
787k
                                _destroy_agg_status(mapped);
301
787k
                                mapped = nullptr;
302
787k
                            }
303
787k
                        });
dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberImNS4_15DataWithNullKeyI9PHHashMapImPc14HashMixWrapperIm9HashCRC32ImEEEEEEEEEEEDaRT_ENKUlSJ_E_clIS9_EEDaSJ_
Line
Count
Source
298
1.23k
                        hash_table.for_each_mapped([&](auto& mapped) {
299
1.23k
                            if (mapped) {
300
1.23k
                                _destroy_agg_status(mapped);
301
1.23k
                                mapped = nullptr;
302
1.23k
                            }
303
1.23k
                        });
Unexecuted instantiation: dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberIN4wide7integerILm128EjEENS4_15DataWithNullKeyI9PHHashMapIS9_Pc9HashCRC32IS9_EEEEEEEEEEDaRT_ENKUlSK_E_clISC_EEDaSK_
Unexecuted instantiation: dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberIN4wide7integerILm256EjEENS4_15DataWithNullKeyI9PHHashMapIS9_Pc9HashCRC32IS9_EEEEEEEEEEDaRT_ENKUlSK_E_clISC_EEDaSK_
Unexecuted instantiation: dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_19MethodStringNoCacheINS4_15DataWithNullKeyINS_13StringHashMapIPcNS_9AllocatorILb1ELb1ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEEEEEEEEEDaRT_ENKUlSI_E_clIS9_EEDaSI_
Unexecuted instantiation: dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodKeysFixedI9PHHashMapImPc9HashCRC32ImEEEEEEDaRT_ENKUlSD_E_clIS7_EEDaSD_
Unexecuted instantiation: dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodKeysFixedI9PHHashMapINS4_6UInt72EPc9HashCRC32IS7_EEEEEEDaRT_ENKUlSE_E_clIS8_EEDaSE_
Unexecuted instantiation: dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodKeysFixedI9PHHashMapINS4_6UInt96EPc9HashCRC32IS7_EEEEEEDaRT_ENKUlSE_E_clIS8_EEDaSE_
Unexecuted instantiation: dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodKeysFixedI9PHHashMapINS4_7UInt104EPc9HashCRC32IS7_EEEEEEDaRT_ENKUlSE_E_clIS8_EEDaSE_
Unexecuted instantiation: dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodKeysFixedI9PHHashMapIN4wide7integerILm128EjEEPc9HashCRC32IS9_EEEEEEDaRT_ENKUlSG_E_clISA_EEDaSG_
Unexecuted instantiation: dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodKeysFixedI9PHHashMapINS4_7UInt136EPc9HashCRC32IS7_EEEEEEDaRT_ENKUlSE_E_clIS8_EEDaSE_
Unexecuted instantiation: dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodKeysFixedI9PHHashMapIN4wide7integerILm256EjEEPc9HashCRC32IS9_EEEEEEDaRT_ENKUlSG_E_clISA_EEDaSG_
304
305
2.54k
                        if (hash_table.has_null_key_data()) {
306
0
                            _destroy_agg_status(hash_table.template get_null_key_data<
307
0
                                                vectorized::AggregateDataPtr>());
308
0
                        }
309
310
2.54k
                        aggregate_data_container.reset(new AggregateDataContainer(
311
2.54k
                                sizeof(typename HashTableType::key_type),
312
2.54k
                                ((total_size_of_aggregate_states + align_aggregate_states - 1) /
313
2.54k
                                 align_aggregate_states) *
314
2.54k
                                        align_aggregate_states));
315
2.54k
                        agg_method.hash_table.reset(new HashTableType());
316
2.54k
                        return Status::OK();
317
2.54k
                    }},
Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized16MethodSerializedI9PHHashMapINS_9StringRefEPc11DefaultHashIS7_vEEEEEEDaRT_
dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodOneNumberIh9PHHashMapIhPc9HashCRC32IhEEEEEEDaRT_
Line
Count
Source
291
26
                    [&](auto& agg_method) {
292
26
                        auto& hash_table = *agg_method.hash_table;
293
26
                        using HashTableType = std::decay_t<decltype(hash_table)>;
294
295
26
                        agg_method.arena.clear();
296
26
                        agg_method.inited_iterator = false;
297
298
26
                        hash_table.for_each_mapped([&](auto& mapped) {
299
26
                            if (mapped) {
300
26
                                _destroy_agg_status(mapped);
301
26
                                mapped = nullptr;
302
26
                            }
303
26
                        });
304
305
26
                        if (hash_table.has_null_key_data()) {
306
0
                            _destroy_agg_status(hash_table.template get_null_key_data<
307
0
                                                vectorized::AggregateDataPtr>());
308
0
                        }
309
310
26
                        aggregate_data_container.reset(new AggregateDataContainer(
311
26
                                sizeof(typename HashTableType::key_type),
312
26
                                ((total_size_of_aggregate_states + align_aggregate_states - 1) /
313
26
                                 align_aggregate_states) *
314
26
                                        align_aggregate_states));
315
26
                        agg_method.hash_table.reset(new HashTableType());
316
26
                        return Status::OK();
317
26
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodOneNumberIt9PHHashMapItPc9HashCRC32ItEEEEEEDaRT_
Line
Count
Source
291
76
                    [&](auto& agg_method) {
292
76
                        auto& hash_table = *agg_method.hash_table;
293
76
                        using HashTableType = std::decay_t<decltype(hash_table)>;
294
295
76
                        agg_method.arena.clear();
296
76
                        agg_method.inited_iterator = false;
297
298
76
                        hash_table.for_each_mapped([&](auto& mapped) {
299
76
                            if (mapped) {
300
76
                                _destroy_agg_status(mapped);
301
76
                                mapped = nullptr;
302
76
                            }
303
76
                        });
304
305
76
                        if (hash_table.has_null_key_data()) {
306
0
                            _destroy_agg_status(hash_table.template get_null_key_data<
307
0
                                                vectorized::AggregateDataPtr>());
308
0
                        }
309
310
76
                        aggregate_data_container.reset(new AggregateDataContainer(
311
76
                                sizeof(typename HashTableType::key_type),
312
76
                                ((total_size_of_aggregate_states + align_aggregate_states - 1) /
313
76
                                 align_aggregate_states) *
314
76
                                        align_aggregate_states));
315
76
                        agg_method.hash_table.reset(new HashTableType());
316
76
                        return Status::OK();
317
76
                    }},
Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodOneNumberIj9PHHashMapIjPc9HashCRC32IjEEEEEEDaRT_
dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodOneNumberIm9PHHashMapImPc9HashCRC32ImEEEEEEDaRT_
Line
Count
Source
291
144
                    [&](auto& agg_method) {
292
144
                        auto& hash_table = *agg_method.hash_table;
293
144
                        using HashTableType = std::decay_t<decltype(hash_table)>;
294
295
144
                        agg_method.arena.clear();
296
144
                        agg_method.inited_iterator = false;
297
298
144
                        hash_table.for_each_mapped([&](auto& mapped) {
299
144
                            if (mapped) {
300
144
                                _destroy_agg_status(mapped);
301
144
                                mapped = nullptr;
302
144
                            }
303
144
                        });
304
305
144
                        if (hash_table.has_null_key_data()) {
306
0
                            _destroy_agg_status(hash_table.template get_null_key_data<
307
0
                                                vectorized::AggregateDataPtr>());
308
0
                        }
309
310
144
                        aggregate_data_container.reset(new AggregateDataContainer(
311
144
                                sizeof(typename HashTableType::key_type),
312
144
                                ((total_size_of_aggregate_states + align_aggregate_states - 1) /
313
144
                                 align_aggregate_states) *
314
144
                                        align_aggregate_states));
315
144
                        agg_method.hash_table.reset(new HashTableType());
316
144
                        return Status::OK();
317
144
                    }},
Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized19MethodStringNoCacheINS_13StringHashMapIPcNS_9AllocatorILb1ELb1ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEEEEEDaRT_
dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodOneNumberIN4wide7integerILm128EjEE9PHHashMapIS8_Pc9HashCRC32IS8_EEEEEEDaRT_
Line
Count
Source
291
154
                    [&](auto& agg_method) {
292
154
                        auto& hash_table = *agg_method.hash_table;
293
154
                        using HashTableType = std::decay_t<decltype(hash_table)>;
294
295
154
                        agg_method.arena.clear();
296
154
                        agg_method.inited_iterator = false;
297
298
154
                        hash_table.for_each_mapped([&](auto& mapped) {
299
154
                            if (mapped) {
300
154
                                _destroy_agg_status(mapped);
301
154
                                mapped = nullptr;
302
154
                            }
303
154
                        });
304
305
154
                        if (hash_table.has_null_key_data()) {
306
0
                            _destroy_agg_status(hash_table.template get_null_key_data<
307
0
                                                vectorized::AggregateDataPtr>());
308
0
                        }
309
310
154
                        aggregate_data_container.reset(new AggregateDataContainer(
311
154
                                sizeof(typename HashTableType::key_type),
312
154
                                ((total_size_of_aggregate_states + align_aggregate_states - 1) /
313
154
                                 align_aggregate_states) *
314
154
                                        align_aggregate_states));
315
154
                        agg_method.hash_table.reset(new HashTableType());
316
154
                        return Status::OK();
317
154
                    }},
Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodOneNumberIN4wide7integerILm256EjEE9PHHashMapIS8_Pc9HashCRC32IS8_EEEEEEDaRT_
dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodOneNumberIj9PHHashMapIjPc14HashMixWrapperIj9HashCRC32IjEEEEEEEDaRT_
Line
Count
Source
291
309
                    [&](auto& agg_method) {
292
309
                        auto& hash_table = *agg_method.hash_table;
293
309
                        using HashTableType = std::decay_t<decltype(hash_table)>;
294
295
309
                        agg_method.arena.clear();
296
309
                        agg_method.inited_iterator = false;
297
298
309
                        hash_table.for_each_mapped([&](auto& mapped) {
299
309
                            if (mapped) {
300
309
                                _destroy_agg_status(mapped);
301
309
                                mapped = nullptr;
302
309
                            }
303
309
                        });
304
305
309
                        if (hash_table.has_null_key_data()) {
306
0
                            _destroy_agg_status(hash_table.template get_null_key_data<
307
0
                                                vectorized::AggregateDataPtr>());
308
0
                        }
309
310
309
                        aggregate_data_container.reset(new AggregateDataContainer(
311
309
                                sizeof(typename HashTableType::key_type),
312
309
                                ((total_size_of_aggregate_states + align_aggregate_states - 1) /
313
309
                                 align_aggregate_states) *
314
309
                                        align_aggregate_states));
315
309
                        agg_method.hash_table.reset(new HashTableType());
316
309
                        return Status::OK();
317
309
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodOneNumberIm9PHHashMapImPc14HashMixWrapperIm9HashCRC32ImEEEEEEEDaRT_
Line
Count
Source
291
516
                    [&](auto& agg_method) {
292
516
                        auto& hash_table = *agg_method.hash_table;
293
516
                        using HashTableType = std::decay_t<decltype(hash_table)>;
294
295
516
                        agg_method.arena.clear();
296
516
                        agg_method.inited_iterator = false;
297
298
516
                        hash_table.for_each_mapped([&](auto& mapped) {
299
516
                            if (mapped) {
300
516
                                _destroy_agg_status(mapped);
301
516
                                mapped = nullptr;
302
516
                            }
303
516
                        });
304
305
516
                        if (hash_table.has_null_key_data()) {
306
0
                            _destroy_agg_status(hash_table.template get_null_key_data<
307
0
                                                vectorized::AggregateDataPtr>());
308
0
                        }
309
310
516
                        aggregate_data_container.reset(new AggregateDataContainer(
311
516
                                sizeof(typename HashTableType::key_type),
312
516
                                ((total_size_of_aggregate_states + align_aggregate_states - 1) /
313
516
                                 align_aggregate_states) *
314
516
                                        align_aggregate_states));
315
516
                        agg_method.hash_table.reset(new HashTableType());
316
516
                        return Status::OK();
317
516
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberIhNS4_15DataWithNullKeyI9PHHashMapIhPc9HashCRC32IhEEEEEEEEEEDaRT_
Line
Count
Source
291
86
                    [&](auto& agg_method) {
292
86
                        auto& hash_table = *agg_method.hash_table;
293
86
                        using HashTableType = std::decay_t<decltype(hash_table)>;
294
295
86
                        agg_method.arena.clear();
296
86
                        agg_method.inited_iterator = false;
297
298
86
                        hash_table.for_each_mapped([&](auto& mapped) {
299
86
                            if (mapped) {
300
86
                                _destroy_agg_status(mapped);
301
86
                                mapped = nullptr;
302
86
                            }
303
86
                        });
304
305
86
                        if (hash_table.has_null_key_data()) {
306
0
                            _destroy_agg_status(hash_table.template get_null_key_data<
307
0
                                                vectorized::AggregateDataPtr>());
308
0
                        }
309
310
86
                        aggregate_data_container.reset(new AggregateDataContainer(
311
86
                                sizeof(typename HashTableType::key_type),
312
86
                                ((total_size_of_aggregate_states + align_aggregate_states - 1) /
313
86
                                 align_aggregate_states) *
314
86
                                        align_aggregate_states));
315
86
                        agg_method.hash_table.reset(new HashTableType());
316
86
                        return Status::OK();
317
86
                    }},
Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberItNS4_15DataWithNullKeyI9PHHashMapItPc9HashCRC32ItEEEEEEEEEEDaRT_
dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberIjNS4_15DataWithNullKeyI9PHHashMapIjPc9HashCRC32IjEEEEEEEEEEDaRT_
Line
Count
Source
291
150
                    [&](auto& agg_method) {
292
150
                        auto& hash_table = *agg_method.hash_table;
293
150
                        using HashTableType = std::decay_t<decltype(hash_table)>;
294
295
150
                        agg_method.arena.clear();
296
150
                        agg_method.inited_iterator = false;
297
298
150
                        hash_table.for_each_mapped([&](auto& mapped) {
299
150
                            if (mapped) {
300
150
                                _destroy_agg_status(mapped);
301
150
                                mapped = nullptr;
302
150
                            }
303
150
                        });
304
305
150
                        if (hash_table.has_null_key_data()) {
306
0
                            _destroy_agg_status(hash_table.template get_null_key_data<
307
0
                                                vectorized::AggregateDataPtr>());
308
0
                        }
309
310
150
                        aggregate_data_container.reset(new AggregateDataContainer(
311
150
                                sizeof(typename HashTableType::key_type),
312
150
                                ((total_size_of_aggregate_states + align_aggregate_states - 1) /
313
150
                                 align_aggregate_states) *
314
150
                                        align_aggregate_states));
315
150
                        agg_method.hash_table.reset(new HashTableType());
316
150
                        return Status::OK();
317
150
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberImNS4_15DataWithNullKeyI9PHHashMapImPc9HashCRC32ImEEEEEEEEEEDaRT_
Line
Count
Source
291
209
                    [&](auto& agg_method) {
292
209
                        auto& hash_table = *agg_method.hash_table;
293
209
                        using HashTableType = std::decay_t<decltype(hash_table)>;
294
295
209
                        agg_method.arena.clear();
296
209
                        agg_method.inited_iterator = false;
297
298
209
                        hash_table.for_each_mapped([&](auto& mapped) {
299
209
                            if (mapped) {
300
209
                                _destroy_agg_status(mapped);
301
209
                                mapped = nullptr;
302
209
                            }
303
209
                        });
304
305
209
                        if (hash_table.has_null_key_data()) {
306
0
                            _destroy_agg_status(hash_table.template get_null_key_data<
307
0
                                                vectorized::AggregateDataPtr>());
308
0
                        }
309
310
209
                        aggregate_data_container.reset(new AggregateDataContainer(
311
209
                                sizeof(typename HashTableType::key_type),
312
209
                                ((total_size_of_aggregate_states + align_aggregate_states - 1) /
313
209
                                 align_aggregate_states) *
314
209
                                        align_aggregate_states));
315
209
                        agg_method.hash_table.reset(new HashTableType());
316
209
                        return Status::OK();
317
209
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberIjNS4_15DataWithNullKeyI9PHHashMapIjPc14HashMixWrapperIj9HashCRC32IjEEEEEEEEEEEDaRT_
Line
Count
Source
291
382
                    [&](auto& agg_method) {
292
382
                        auto& hash_table = *agg_method.hash_table;
293
382
                        using HashTableType = std::decay_t<decltype(hash_table)>;
294
295
382
                        agg_method.arena.clear();
296
382
                        agg_method.inited_iterator = false;
297
298
382
                        hash_table.for_each_mapped([&](auto& mapped) {
299
382
                            if (mapped) {
300
382
                                _destroy_agg_status(mapped);
301
382
                                mapped = nullptr;
302
382
                            }
303
382
                        });
304
305
382
                        if (hash_table.has_null_key_data()) {
306
0
                            _destroy_agg_status(hash_table.template get_null_key_data<
307
0
                                                vectorized::AggregateDataPtr>());
308
0
                        }
309
310
382
                        aggregate_data_container.reset(new AggregateDataContainer(
311
382
                                sizeof(typename HashTableType::key_type),
312
382
                                ((total_size_of_aggregate_states + align_aggregate_states - 1) /
313
382
                                 align_aggregate_states) *
314
382
                                        align_aggregate_states));
315
382
                        agg_method.hash_table.reset(new HashTableType());
316
382
                        return Status::OK();
317
382
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberImNS4_15DataWithNullKeyI9PHHashMapImPc14HashMixWrapperIm9HashCRC32ImEEEEEEEEEEEDaRT_
Line
Count
Source
291
493
                    [&](auto& agg_method) {
292
493
                        auto& hash_table = *agg_method.hash_table;
293
493
                        using HashTableType = std::decay_t<decltype(hash_table)>;
294
295
493
                        agg_method.arena.clear();
296
493
                        agg_method.inited_iterator = false;
297
298
493
                        hash_table.for_each_mapped([&](auto& mapped) {
299
493
                            if (mapped) {
300
493
                                _destroy_agg_status(mapped);
301
493
                                mapped = nullptr;
302
493
                            }
303
493
                        });
304
305
493
                        if (hash_table.has_null_key_data()) {
306
0
                            _destroy_agg_status(hash_table.template get_null_key_data<
307
0
                                                vectorized::AggregateDataPtr>());
308
0
                        }
309
310
493
                        aggregate_data_container.reset(new AggregateDataContainer(
311
493
                                sizeof(typename HashTableType::key_type),
312
493
                                ((total_size_of_aggregate_states + align_aggregate_states - 1) /
313
493
                                 align_aggregate_states) *
314
493
                                        align_aggregate_states));
315
493
                        agg_method.hash_table.reset(new HashTableType());
316
493
                        return Status::OK();
317
493
                    }},
Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberIN4wide7integerILm128EjEENS4_15DataWithNullKeyI9PHHashMapIS9_Pc9HashCRC32IS9_EEEEEEEEEEDaRT_
Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberIN4wide7integerILm256EjEENS4_15DataWithNullKeyI9PHHashMapIS9_Pc9HashCRC32IS9_EEEEEEEEEEDaRT_
Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_19MethodStringNoCacheINS4_15DataWithNullKeyINS_13StringHashMapIPcNS_9AllocatorILb1ELb1ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEEEEEEEEEDaRT_
Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodKeysFixedI9PHHashMapImPc9HashCRC32ImEEEEEEDaRT_
Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodKeysFixedI9PHHashMapINS4_6UInt72EPc9HashCRC32IS7_EEEEEEDaRT_
Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodKeysFixedI9PHHashMapINS4_6UInt96EPc9HashCRC32IS7_EEEEEEDaRT_
Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodKeysFixedI9PHHashMapINS4_7UInt104EPc9HashCRC32IS7_EEEEEEDaRT_
Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodKeysFixedI9PHHashMapIN4wide7integerILm128EjEEPc9HashCRC32IS9_EEEEEEDaRT_
Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodKeysFixedI9PHHashMapINS4_7UInt136EPc9HashCRC32IS7_EEEEEEDaRT_
Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodKeysFixedI9PHHashMapIN4wide7integerILm256EjEEPc9HashCRC32IS9_EEEEEEDaRT_
318
2.54k
            agg_data->method_variant);
319
2.54k
}
320
321
337
void PartitionedAggSharedState::init_spill_params(size_t spill_partition_count) {
322
337
    partition_count = spill_partition_count;
323
337
    max_partition_index = partition_count - 1;
324
325
11.1k
    for (int i = 0; i < partition_count; ++i) {
326
10.7k
        spill_partitions.emplace_back(std::make_shared<AggSpillPartition>());
327
10.7k
    }
328
337
}
329
330
326
void PartitionedAggSharedState::update_spill_stream_profiles(RuntimeProfile* source_profile) {
331
10.4k
    for (auto& partition : spill_partitions) {
332
10.4k
        if (partition->spilling_stream_) {
333
0
            partition->spilling_stream_->update_shared_profiles(source_profile);
334
0
        }
335
10.4k
        for (auto& stream : partition->spill_streams_) {
336
1.69k
            if (stream) {
337
1.69k
                stream->update_shared_profiles(source_profile);
338
1.69k
            }
339
1.69k
        }
340
10.4k
    }
341
326
}
342
343
Status AggSpillPartition::get_spill_stream(RuntimeState* state, int node_id,
344
                                           RuntimeProfile* profile,
345
8.92k
                                           vectorized::SpillStreamSPtr& spill_stream) {
346
8.92k
    if (spilling_stream_) {
347
7.18k
        spill_stream = spilling_stream_;
348
7.18k
        return Status::OK();
349
7.18k
    }
350
1.74k
    RETURN_IF_ERROR(ExecEnv::GetInstance()->spill_stream_mgr()->register_spill_stream(
351
1.74k
            state, spilling_stream_, print_id(state->query_id()), "agg", node_id,
352
1.74k
            std::numeric_limits<int32_t>::max(), std::numeric_limits<size_t>::max(), profile));
353
1.74k
    spill_streams_.emplace_back(spilling_stream_);
354
1.74k
    spill_stream = spilling_stream_;
355
1.74k
    return Status::OK();
356
1.74k
}
357
7.95k
void AggSpillPartition::close() {
358
7.95k
    if (spilling_stream_) {
359
1
        spilling_stream_.reset();
360
1
    }
361
7.95k
    for (auto& stream : spill_streams_) {
362
5
        (void)ExecEnv::GetInstance()->spill_stream_mgr()->delete_spill_stream(stream);
363
5
    }
364
7.95k
    spill_streams_.clear();
365
7.95k
}
366
367
364
void PartitionedAggSharedState::close() {
368
    // need to use CAS instead of only `if (!is_closed)` statement,
369
    // to avoid concurrent entry of close() both pass the if statement
370
364
    bool false_close = false;
371
364
    if (!is_closed.compare_exchange_strong(false_close, true)) {
372
33
        return;
373
33
    }
374
364
    DCHECK(!false_close && is_closed);
375
7.95k
    for (auto partition : spill_partitions) {
376
7.95k
        partition->close();
377
7.95k
    }
378
331
    spill_partitions.clear();
379
331
}
380
381
16
void SpillSortSharedState::update_spill_stream_profiles(RuntimeProfile* source_profile) {
382
54
    for (auto& stream : sorted_streams) {
383
54
        if (stream) {
384
54
            stream->update_shared_profiles(source_profile);
385
54
        }
386
54
    }
387
16
}
388
389
18
void SpillSortSharedState::close() {
390
    // need to use CAS instead of only `if (!is_closed)` statement,
391
    // to avoid concurrent entry of close() both pass the if statement
392
18
    bool false_close = false;
393
18
    if (!is_closed.compare_exchange_strong(false_close, true)) {
394
1
        return;
395
1
    }
396
18
    DCHECK(!false_close && is_closed);
397
17
    for (auto& stream : sorted_streams) {
398
1
        (void)ExecEnv::GetInstance()->spill_stream_mgr()->delete_spill_stream(stream);
399
1
    }
400
17
    sorted_streams.clear();
401
17
}
402
403
MultiCastSharedState::MultiCastSharedState(ObjectPool* pool, int cast_sender_count, int node_id)
404
1.98k
        : multi_cast_data_streamer(std::make_unique<pipeline::MultiCastDataStreamer>(
405
1.98k
                  pool, cast_sender_count, node_id)) {}
406
407
0
void MultiCastSharedState::update_spill_stream_profiles(RuntimeProfile* source_profile) {}
408
409
108k
int AggSharedState::get_slot_column_id(const vectorized::AggFnEvaluator* evaluator) {
410
108k
    auto ctxs = evaluator->input_exprs_ctxs();
411
108k
    CHECK(ctxs.size() == 1 && ctxs[0]->root()->is_slot_ref())
412
2
            << "input_exprs_ctxs is invalid, input_exprs_ctx[0]="
413
2
            << ctxs[0]->root()->debug_string();
414
108k
    return ((vectorized::VSlotRef*)ctxs[0]->root().get())->column_id();
415
108k
}
416
417
4.03M
void AggSharedState::_destroy_agg_status(vectorized::AggregateDataPtr data) {
418
9.92M
    for (int i = 0; i < aggregate_evaluators.size(); ++i) {
419
5.89M
        aggregate_evaluators[i]->function()->destroy(data + offsets_of_aggregate_states[i]);
420
5.89M
    }
421
4.03M
}
422
423
105k
LocalExchangeSharedState::~LocalExchangeSharedState() = default;
424
425
12.0k
Status SetSharedState::update_build_not_ignore_null(const vectorized::VExprContextSPtrs& ctxs) {
426
12.0k
    if (ctxs.size() > build_not_ignore_null.size()) {
427
0
        return Status::InternalError("build_not_ignore_null not initialized");
428
0
    }
429
430
99.5k
    for (int i = 0; i < ctxs.size(); ++i) {
431
87.4k
        build_not_ignore_null[i] = build_not_ignore_null[i] || ctxs[i]->root()->is_nullable();
432
87.4k
    }
433
434
12.0k
    return Status::OK();
435
12.0k
}
436
437
19.3k
size_t SetSharedState::get_hash_table_size() const {
438
19.3k
    size_t hash_table_size = 0;
439
19.3k
    std::visit(
440
19.3k
            [&](auto&& arg) {
441
19.3k
                using HashTableCtxType = std::decay_t<decltype(arg)>;
442
19.3k
                if constexpr (!std::is_same_v<HashTableCtxType, std::monostate>) {
443
19.3k
                    hash_table_size = arg.hash_table->size();
444
19.3k
                }
445
19.3k
            },
Unexecuted instantiation: dependency.cpp:_ZZNK5doris8pipeline14SetSharedState19get_hash_table_sizeEvENK3$_0clIRSt9monostateEEDaOT_
dependency.cpp:_ZZNK5doris8pipeline14SetSharedState19get_hash_table_sizeEvENK3$_0clIRNS_10vectorized16MethodSerializedI9PHHashMapINS_9StringRefENS_14RowRefWithFlagE11DefaultHashIS7_vEEEEEEDaOT_
Line
Count
Source
440
18.2k
            [&](auto&& arg) {
441
18.2k
                using HashTableCtxType = std::decay_t<decltype(arg)>;
442
18.2k
                if constexpr (!std::is_same_v<HashTableCtxType, std::monostate>) {
443
18.2k
                    hash_table_size = arg.hash_table->size();
444
18.2k
                }
445
18.2k
            },
dependency.cpp:_ZZNK5doris8pipeline14SetSharedState19get_hash_table_sizeEvENK3$_0clIRNS_10vectorized19MethodStringNoCacheI9PHHashMapINS_9StringRefENS_14RowRefWithFlagE11DefaultHashIS7_vEEEEEEDaOT_
Line
Count
Source
440
208
            [&](auto&& arg) {
441
208
                using HashTableCtxType = std::decay_t<decltype(arg)>;
442
208
                if constexpr (!std::is_same_v<HashTableCtxType, std::monostate>) {
443
208
                    hash_table_size = arg.hash_table->size();
444
208
                }
445
208
            },
dependency.cpp:_ZZNK5doris8pipeline14SetSharedState19get_hash_table_sizeEvENK3$_0clIRNS_10vectorized26MethodSingleNullableColumnINS4_19MethodStringNoCacheINS4_15DataWithNullKeyI9PHHashMapINS_9StringRefENS_14RowRefWithFlagE11DefaultHashIS9_vEEEEEEEEEEDaOT_
Line
Count
Source
440
127
            [&](auto&& arg) {
441
127
                using HashTableCtxType = std::decay_t<decltype(arg)>;
442
127
                if constexpr (!std::is_same_v<HashTableCtxType, std::monostate>) {
443
127
                    hash_table_size = arg.hash_table->size();
444
127
                }
445
127
            },
dependency.cpp:_ZZNK5doris8pipeline14SetSharedState19get_hash_table_sizeEvENK3$_0clIRNS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberIhNS4_15DataWithNullKeyI9PHHashMapIhNS_14RowRefWithFlagE9HashCRC32IhEEEEEEEEEEDaOT_
Line
Count
Source
440
57
            [&](auto&& arg) {
441
57
                using HashTableCtxType = std::decay_t<decltype(arg)>;
442
57
                if constexpr (!std::is_same_v<HashTableCtxType, std::monostate>) {
443
57
                    hash_table_size = arg.hash_table->size();
444
57
                }
445
57
            },
Unexecuted instantiation: dependency.cpp:_ZZNK5doris8pipeline14SetSharedState19get_hash_table_sizeEvENK3$_0clIRNS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberItNS4_15DataWithNullKeyI9PHHashMapItNS_14RowRefWithFlagE9HashCRC32ItEEEEEEEEEEDaOT_
dependency.cpp:_ZZNK5doris8pipeline14SetSharedState19get_hash_table_sizeEvENK3$_0clIRNS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberIjNS4_15DataWithNullKeyI9PHHashMapIjNS_14RowRefWithFlagE9HashCRC32IjEEEEEEEEEEDaOT_
Line
Count
Source
440
298
            [&](auto&& arg) {
441
298
                using HashTableCtxType = std::decay_t<decltype(arg)>;
442
298
                if constexpr (!std::is_same_v<HashTableCtxType, std::monostate>) {
443
298
                    hash_table_size = arg.hash_table->size();
444
298
                }
445
298
            },
dependency.cpp:_ZZNK5doris8pipeline14SetSharedState19get_hash_table_sizeEvENK3$_0clIRNS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberImNS4_15DataWithNullKeyI9PHHashMapImNS_14RowRefWithFlagE9HashCRC32ImEEEEEEEEEEDaOT_
Line
Count
Source
440
61
            [&](auto&& arg) {
441
61
                using HashTableCtxType = std::decay_t<decltype(arg)>;
442
61
                if constexpr (!std::is_same_v<HashTableCtxType, std::monostate>) {
443
61
                    hash_table_size = arg.hash_table->size();
444
61
                }
445
61
            },
dependency.cpp:_ZZNK5doris8pipeline14SetSharedState19get_hash_table_sizeEvENK3$_0clIRNS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberIN4wide7integerILm128EjEENS4_15DataWithNullKeyI9PHHashMapIS9_NS_14RowRefWithFlagE9HashCRC32IS9_EEEEEEEEEEDaOT_
Line
Count
Source
440
191
            [&](auto&& arg) {
441
191
                using HashTableCtxType = std::decay_t<decltype(arg)>;
442
191
                if constexpr (!std::is_same_v<HashTableCtxType, std::monostate>) {
443
191
                    hash_table_size = arg.hash_table->size();
444
191
                }
445
191
            },
Unexecuted instantiation: dependency.cpp:_ZZNK5doris8pipeline14SetSharedState19get_hash_table_sizeEvENK3$_0clIRNS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberIN4wide7integerILm256EjEENS4_15DataWithNullKeyI9PHHashMapIS9_NS_14RowRefWithFlagE9HashCRC32IS9_EEEEEEEEEEDaOT_
Unexecuted instantiation: dependency.cpp:_ZZNK5doris8pipeline14SetSharedState19get_hash_table_sizeEvENK3$_0clIRNS_10vectorized15MethodOneNumberIh9PHHashMapIhNS_14RowRefWithFlagE9HashCRC32IhEEEEEEDaOT_
Unexecuted instantiation: dependency.cpp:_ZZNK5doris8pipeline14SetSharedState19get_hash_table_sizeEvENK3$_0clIRNS_10vectorized15MethodOneNumberIt9PHHashMapItNS_14RowRefWithFlagE9HashCRC32ItEEEEEEDaOT_
dependency.cpp:_ZZNK5doris8pipeline14SetSharedState19get_hash_table_sizeEvENK3$_0clIRNS_10vectorized15MethodOneNumberIj9PHHashMapIjNS_14RowRefWithFlagE9HashCRC32IjEEEEEEDaOT_
Line
Count
Source
440
29
            [&](auto&& arg) {
441
29
                using HashTableCtxType = std::decay_t<decltype(arg)>;
442
29
                if constexpr (!std::is_same_v<HashTableCtxType, std::monostate>) {
443
29
                    hash_table_size = arg.hash_table->size();
444
29
                }
445
29
            },
dependency.cpp:_ZZNK5doris8pipeline14SetSharedState19get_hash_table_sizeEvENK3$_0clIRNS_10vectorized15MethodOneNumberIm9PHHashMapImNS_14RowRefWithFlagE9HashCRC32ImEEEEEEDaOT_
Line
Count
Source
440
16
            [&](auto&& arg) {
441
16
                using HashTableCtxType = std::decay_t<decltype(arg)>;
442
16
                if constexpr (!std::is_same_v<HashTableCtxType, std::monostate>) {
443
16
                    hash_table_size = arg.hash_table->size();
444
16
                }
445
16
            },
Unexecuted instantiation: dependency.cpp:_ZZNK5doris8pipeline14SetSharedState19get_hash_table_sizeEvENK3$_0clIRNS_10vectorized15MethodOneNumberIN4wide7integerILm128EjEE9PHHashMapIS8_NS_14RowRefWithFlagE9HashCRC32IS8_EEEEEEDaOT_
Unexecuted instantiation: dependency.cpp:_ZZNK5doris8pipeline14SetSharedState19get_hash_table_sizeEvENK3$_0clIRNS_10vectorized15MethodOneNumberIN4wide7integerILm256EjEE9PHHashMapIS8_NS_14RowRefWithFlagE9HashCRC32IS8_EEEEEEDaOT_
dependency.cpp:_ZZNK5doris8pipeline14SetSharedState19get_hash_table_sizeEvENK3$_0clIRNS_10vectorized15MethodKeysFixedI9PHHashMapImNS_14RowRefWithFlagE9HashCRC32ImEEEEEEDaOT_
Line
Count
Source
440
27
            [&](auto&& arg) {
441
27
                using HashTableCtxType = std::decay_t<decltype(arg)>;
442
27
                if constexpr (!std::is_same_v<HashTableCtxType, std::monostate>) {
443
27
                    hash_table_size = arg.hash_table->size();
444
27
                }
445
27
            },
dependency.cpp:_ZZNK5doris8pipeline14SetSharedState19get_hash_table_sizeEvENK3$_0clIRNS_10vectorized15MethodKeysFixedI9PHHashMapINS4_6UInt72ENS_14RowRefWithFlagE9HashCRC32IS7_EEEEEEDaOT_
Line
Count
Source
440
96
            [&](auto&& arg) {
441
96
                using HashTableCtxType = std::decay_t<decltype(arg)>;
442
96
                if constexpr (!std::is_same_v<HashTableCtxType, std::monostate>) {
443
96
                    hash_table_size = arg.hash_table->size();
444
96
                }
445
96
            },
dependency.cpp:_ZZNK5doris8pipeline14SetSharedState19get_hash_table_sizeEvENK3$_0clIRNS_10vectorized15MethodKeysFixedI9PHHashMapINS4_6UInt96ENS_14RowRefWithFlagE9HashCRC32IS7_EEEEEEDaOT_
Line
Count
Source
440
12
            [&](auto&& arg) {
441
12
                using HashTableCtxType = std::decay_t<decltype(arg)>;
442
12
                if constexpr (!std::is_same_v<HashTableCtxType, std::monostate>) {
443
12
                    hash_table_size = arg.hash_table->size();
444
12
                }
445
12
            },
dependency.cpp:_ZZNK5doris8pipeline14SetSharedState19get_hash_table_sizeEvENK3$_0clIRNS_10vectorized15MethodKeysFixedI9PHHashMapINS4_7UInt104ENS_14RowRefWithFlagE9HashCRC32IS7_EEEEEEDaOT_
Line
Count
Source
440
9
            [&](auto&& arg) {
441
9
                using HashTableCtxType = std::decay_t<decltype(arg)>;
442
9
                if constexpr (!std::is_same_v<HashTableCtxType, std::monostate>) {
443
9
                    hash_table_size = arg.hash_table->size();
444
9
                }
445
9
            },
Unexecuted instantiation: dependency.cpp:_ZZNK5doris8pipeline14SetSharedState19get_hash_table_sizeEvENK3$_0clIRNS_10vectorized15MethodKeysFixedI9PHHashMapIN4wide7integerILm128EjEENS_14RowRefWithFlagE9HashCRC32IS9_EEEEEEDaOT_
dependency.cpp:_ZZNK5doris8pipeline14SetSharedState19get_hash_table_sizeEvENK3$_0clIRNS_10vectorized15MethodKeysFixedI9PHHashMapIN4wide7integerILm256EjEENS_14RowRefWithFlagE9HashCRC32IS9_EEEEEEDaOT_
Line
Count
Source
440
4
            [&](auto&& arg) {
441
4
                using HashTableCtxType = std::decay_t<decltype(arg)>;
442
4
                if constexpr (!std::is_same_v<HashTableCtxType, std::monostate>) {
443
4
                    hash_table_size = arg.hash_table->size();
444
4
                }
445
4
            },
dependency.cpp:_ZZNK5doris8pipeline14SetSharedState19get_hash_table_sizeEvENK3$_0clIRNS_10vectorized15MethodKeysFixedI9PHHashMapINS4_7UInt136ENS_14RowRefWithFlagE9HashCRC32IS7_EEEEEEDaOT_
Line
Count
Source
440
14
            [&](auto&& arg) {
441
14
                using HashTableCtxType = std::decay_t<decltype(arg)>;
442
14
                if constexpr (!std::is_same_v<HashTableCtxType, std::monostate>) {
443
14
                    hash_table_size = arg.hash_table->size();
444
14
                }
445
14
            },
446
19.3k
            hash_table_variants->method_variant);
447
19.3k
    return hash_table_size;
448
19.3k
}
449
450
4.99k
Status SetSharedState::hash_table_init() {
451
4.99k
    std::vector<vectorized::DataTypePtr> data_types;
452
40.3k
    for (size_t i = 0; i != child_exprs_lists[0].size(); ++i) {
453
35.3k
        auto& ctx = child_exprs_lists[0][i];
454
35.3k
        auto data_type = ctx->root()->data_type();
455
35.3k
        if (build_not_ignore_null[i]) {
456
35.1k
            data_type = vectorized::make_nullable(data_type);
457
35.1k
        }
458
35.3k
        data_types.emplace_back(std::move(data_type));
459
35.3k
    }
460
4.99k
    return init_hash_method<SetDataVariants>(hash_table_variants.get(), data_types, true);
461
4.99k
}
462
463
void AggSharedState::refresh_top_limit(size_t row_id,
464
42
                                       const vectorized::ColumnRawPtrs& key_columns) {
465
165
    for (int j = 0; j < key_columns.size(); ++j) {
466
123
        limit_columns[j]->insert_from(*key_columns[j], row_id);
467
123
    }
468
42
    limit_heap.emplace(limit_columns[0]->size() - 1, limit_columns, order_directions,
469
42
                       null_directions);
470
471
42
    limit_heap.pop();
472
42
    limit_columns_min = limit_heap.top()._row_id;
473
42
}
474
475
} // namespace doris::pipeline