Coverage Report

Created: 2025-08-17 19:38

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
1.44M
                                                       const std::string& name) {
43
1.44M
    source_deps.push_back(std::make_shared<Dependency>(operator_id, node_id, name + "_DEPENDENCY"));
44
1.44M
    source_deps.back()->set_shared_state(this);
45
1.44M
    return source_deps.back().get();
46
1.44M
}
47
48
void BasicSharedState::create_source_dependencies(int num_sources, int operator_id, int node_id,
49
339k
                                                  const std::string& name) {
50
339k
    source_deps.resize(num_sources, nullptr);
51
2.47M
    for (auto& source_dep : source_deps) {
52
2.47M
        source_dep = std::make_shared<Dependency>(operator_id, node_id, name + "_DEPENDENCY");
53
2.47M
        source_dep->set_shared_state(this);
54
2.47M
    }
55
339k
}
56
57
Dependency* BasicSharedState::create_sink_dependency(int dest_id, int node_id,
58
3.75M
                                                     const std::string& name) {
59
3.75M
    sink_deps.push_back(std::make_shared<Dependency>(dest_id, node_id, name + "_DEPENDENCY", true));
60
3.75M
    sink_deps.back()->set_shared_state(this);
61
3.75M
    return sink_deps.back().get();
62
3.75M
}
63
64
15.9M
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
15.9M
    _blocked_task.push_back(task);
69
15.9M
}
70
71
87.7M
void Dependency::set_ready() {
72
87.7M
    if (_ready) {
73
73.1M
        return;
74
73.1M
    }
75
14.6M
    _watcher.stop();
76
14.6M
    std::vector<std::weak_ptr<PipelineTask>> local_block_task {};
77
14.6M
    {
78
14.6M
        std::unique_lock<std::mutex> lc(_task_lock);
79
14.6M
        if (_ready) {
80
160
            return;
81
160
        }
82
14.6M
        _ready = true;
83
14.6M
        local_block_task.swap(_blocked_task);
84
14.6M
    }
85
16.0M
    for (auto task : local_block_task) {
86
16.0M
        if (auto t = task.lock()) {
87
16.0M
            std::unique_lock<std::mutex> lc(_task_lock);
88
16.0M
            THROW_IF_ERROR(t->wake_up(this));
89
16.0M
        }
90
16.0M
    }
91
14.6M
}
92
93
133M
Dependency* Dependency::is_blocked_by(std::shared_ptr<PipelineTask> task) {
94
133M
    std::unique_lock<std::mutex> lc(_task_lock);
95
133M
    auto ready = _ready.load();
96
133M
    if (!ready && task) {
97
16.0M
        _add_block_task(task);
98
16.0M
        start_watcher();
99
16.0M
        THROW_IF_ERROR(task->blocked(this));
100
16.0M
    }
101
133M
    return ready ? nullptr : this;
102
133M
}
103
104
97.4k
std::string Dependency::debug_string(int indentation_level) {
105
97.4k
    fmt::memory_buffer debug_string_buffer;
106
97.4k
    fmt::format_to(debug_string_buffer, "{}{}: id={}, block task = {}, ready={}, _always_ready={}",
107
97.4k
                   std::string(indentation_level * 2, ' '), _name, _node_id, _blocked_task.size(),
108
97.4k
                   _ready, _always_ready);
109
97.4k
    return fmt::to_string(debug_string_buffer);
110
97.4k
}
111
112
0
std::string CountedFinishDependency::debug_string(int indentation_level) {
113
0
    fmt::memory_buffer debug_string_buffer;
114
0
    fmt::format_to(debug_string_buffer,
115
0
                   "{}{}: id={}, block_task={}, ready={}, _always_ready={}, count={}",
116
0
                   std::string(indentation_level * 2, ' '), _name, _node_id, _blocked_task.size(),
117
0
                   _ready, _always_ready, _counter);
118
0
    return fmt::to_string(debug_string_buffer);
119
0
}
120
121
8.38k
void RuntimeFilterTimer::call_timeout() {
122
8.38k
    _parent->set_ready();
123
8.38k
}
124
125
55.0k
void RuntimeFilterTimer::call_ready() {
126
55.0k
    _parent->set_ready();
127
55.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
1.58M
bool RuntimeFilterTimer::should_be_check_timeout() {
133
1.58M
    if (!_parent->ready() && !_local_runtime_filter_dependencies.empty()) {
134
9.91k
        bool all_ready = true;
135
9.99k
        for (auto& dep : _local_runtime_filter_dependencies) {
136
9.99k
            if (!dep->ready()) {
137
9.81k
                all_ready = false;
138
9.81k
                break;
139
9.81k
            }
140
9.99k
        }
141
9.91k
        if (all_ready) {
142
98
            _local_runtime_filter_dependencies.clear();
143
98
            _registration_time = MonotonicMillis();
144
98
        }
145
9.91k
        return all_ready;
146
9.91k
    }
147
1.57M
    return true;
148
1.58M
}
149
150
9
void RuntimeFilterTimerQueue::start() {
151
206k
    while (!_stop) {
152
206k
        std::unique_lock<std::mutex> lk(cv_m);
153
154
214k
        while (_que.empty() && !_stop) {
155
16.6k
            cv.wait_for(lk, std::chrono::seconds(3), [this] { return !_que.empty() || _stop; });
156
8.32k
        }
157
206k
        if (_stop) {
158
4
            break;
159
4
        }
160
206k
        {
161
206k
            std::unique_lock<std::mutex> lc(_que_lock);
162
206k
            std::list<std::shared_ptr<pipeline::RuntimeFilterTimer>> new_que;
163
1.58M
            for (auto& it : _que) {
164
1.58M
                if (it.use_count() == 1) {
165
                    // `use_count == 1` means this runtime filter has been released
166
1.58M
                } else if (it->should_be_check_timeout()) {
167
1.57M
                    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
1.52M
                        int64_t ms_since_registration = MonotonicMillis() - it->registration_time();
170
1.52M
                        if (ms_since_registration > it->wait_time_ms()) {
171
8.38k
                            it->call_timeout();
172
1.51M
                        } else {
173
1.51M
                            new_que.push_back(std::move(it));
174
1.51M
                        }
175
1.52M
                    }
176
1.57M
                } else {
177
9.81k
                    new_que.push_back(std::move(it));
178
9.81k
                }
179
1.58M
            }
180
206k
            new_que.swap(_que);
181
206k
        }
182
206k
        std::this_thread::sleep_for(std::chrono::milliseconds(interval));
183
206k
    }
184
9
    _shutdown = true;
185
9
}
186
187
1.09M
void LocalExchangeSharedState::sub_running_sink_operators() {
188
1.09M
    std::unique_lock<std::mutex> lc(le_lock);
189
1.09M
    if (exchanger->_running_sink_operators.fetch_sub(1) == 1) {
190
333k
        _set_always_ready();
191
333k
    }
192
1.09M
}
193
194
2.43M
void LocalExchangeSharedState::sub_running_source_operators() {
195
2.43M
    std::unique_lock<std::mutex> lc(le_lock);
196
2.43M
    if (exchanger->_running_source_operators.fetch_sub(1) == 1) {
197
333k
        _set_always_ready();
198
333k
        exchanger->finalize();
199
333k
    }
200
2.43M
}
201
202
333k
LocalExchangeSharedState::LocalExchangeSharedState(int num_instances) {
203
333k
    source_deps.resize(num_instances, nullptr);
204
333k
    mem_counters.resize(num_instances, nullptr);
205
333k
}
206
207
256
vectorized::MutableColumns AggSharedState::_get_keys_hash_table() {
208
256
    return std::visit(
209
256
            vectorized::Overload {
210
256
                    [&](std::monostate& arg) {
211
0
                        throw doris::Exception(ErrorCode::INTERNAL_ERROR, "uninited hash table");
212
0
                        return vectorized::MutableColumns();
213
0
                    },
214
256
                    [&](auto&& agg_method) -> vectorized::MutableColumns {
215
256
                        vectorized::MutableColumns key_columns;
216
846
                        for (int i = 0; i < probe_expr_ctxs.size(); ++i) {
217
590
                            key_columns.emplace_back(
218
590
                                    probe_expr_ctxs[i]->root()->data_type()->create_column());
219
590
                        }
220
256
                        auto& data = *agg_method.hash_table;
221
256
                        bool has_null_key = data.has_null_key_data();
222
256
                        const auto size = data.size() - has_null_key;
223
256
                        using KeyType = std::decay_t<decltype(agg_method)>::Key;
224
256
                        std::vector<KeyType> keys(size);
225
226
256
                        uint32_t num_rows = 0;
227
256
                        auto iter = aggregate_data_container->begin();
228
256
                        {
229
53.2k
                            while (iter != aggregate_data_container->end()) {
230
52.9k
                                keys[num_rows] = iter.get_key<KeyType>();
231
52.9k
                                ++iter;
232
52.9k
                                ++num_rows;
233
52.9k
                            }
234
256
                        }
235
256
                        agg_method.insert_keys_into_columns(keys, key_columns, num_rows);
236
256
                        if (has_null_key) {
237
3
                            key_columns[0]->insert_data(nullptr, 0);
238
3
                        }
239
256
                        return key_columns;
240
256
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized16MethodSerializedI9PHHashMapINS_9StringRefEPc11DefaultHashIS7_vEEEEEESt6vectorINS_3COWINS4_7IColumnEE11mutable_ptrISG_EESaISJ_EEOT_
Line
Count
Source
214
24
                    [&](auto&& agg_method) -> vectorized::MutableColumns {
215
24
                        vectorized::MutableColumns key_columns;
216
120
                        for (int i = 0; i < probe_expr_ctxs.size(); ++i) {
217
96
                            key_columns.emplace_back(
218
96
                                    probe_expr_ctxs[i]->root()->data_type()->create_column());
219
96
                        }
220
24
                        auto& data = *agg_method.hash_table;
221
24
                        bool has_null_key = data.has_null_key_data();
222
24
                        const auto size = data.size() - has_null_key;
223
24
                        using KeyType = std::decay_t<decltype(agg_method)>::Key;
224
24
                        std::vector<KeyType> keys(size);
225
226
24
                        uint32_t num_rows = 0;
227
24
                        auto iter = aggregate_data_container->begin();
228
24
                        {
229
38.8k
                            while (iter != aggregate_data_container->end()) {
230
38.7k
                                keys[num_rows] = iter.get_key<KeyType>();
231
38.7k
                                ++iter;
232
38.7k
                                ++num_rows;
233
38.7k
                            }
234
24
                        }
235
24
                        agg_method.insert_keys_into_columns(keys, key_columns, num_rows);
236
24
                        if (has_null_key) {
237
0
                            key_columns[0]->insert_data(nullptr, 0);
238
0
                        }
239
24
                        return key_columns;
240
24
                    }},
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
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
24
                            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
8
                        }
235
8
                        agg_method.insert_keys_into_columns(keys, key_columns, num_rows);
236
8
                        if (has_null_key) {
237
0
                            key_columns[0]->insert_data(nullptr, 0);
238
0
                        }
239
8
                        return key_columns;
240
8
                    }},
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
16
                    [&](auto&& agg_method) -> vectorized::MutableColumns {
215
16
                        vectorized::MutableColumns key_columns;
216
32
                        for (int i = 0; i < probe_expr_ctxs.size(); ++i) {
217
16
                            key_columns.emplace_back(
218
16
                                    probe_expr_ctxs[i]->root()->data_type()->create_column());
219
16
                        }
220
16
                        auto& data = *agg_method.hash_table;
221
16
                        bool has_null_key = data.has_null_key_data();
222
16
                        const auto size = data.size() - has_null_key;
223
16
                        using KeyType = std::decay_t<decltype(agg_method)>::Key;
224
16
                        std::vector<KeyType> keys(size);
225
226
16
                        uint32_t num_rows = 0;
227
16
                        auto iter = aggregate_data_container->begin();
228
16
                        {
229
60
                            while (iter != aggregate_data_container->end()) {
230
44
                                keys[num_rows] = iter.get_key<KeyType>();
231
44
                                ++iter;
232
44
                                ++num_rows;
233
44
                            }
234
16
                        }
235
16
                        agg_method.insert_keys_into_columns(keys, key_columns, num_rows);
236
16
                        if (has_null_key) {
237
0
                            key_columns[0]->insert_data(nullptr, 0);
238
0
                        }
239
16
                        return key_columns;
240
16
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberIhNS4_15DataWithNullKeyI9PHHashMapIhPc9HashCRC32IhEEEEEEEEEESt6vectorINS_3COWINS4_7IColumnEE11mutable_ptrISJ_EESaISM_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
8
                            while (iter != aggregate_data_container->end()) {
230
6
                                keys[num_rows] = iter.get_key<KeyType>();
231
6
                                ++iter;
232
6
                                ++num_rows;
233
6
                            }
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_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
12
                    [&](auto&& agg_method) -> vectorized::MutableColumns {
215
12
                        vectorized::MutableColumns key_columns;
216
24
                        for (int i = 0; i < probe_expr_ctxs.size(); ++i) {
217
12
                            key_columns.emplace_back(
218
12
                                    probe_expr_ctxs[i]->root()->data_type()->create_column());
219
12
                        }
220
12
                        auto& data = *agg_method.hash_table;
221
12
                        bool has_null_key = data.has_null_key_data();
222
12
                        const auto size = data.size() - has_null_key;
223
12
                        using KeyType = std::decay_t<decltype(agg_method)>::Key;
224
12
                        std::vector<KeyType> keys(size);
225
226
12
                        uint32_t num_rows = 0;
227
12
                        auto iter = aggregate_data_container->begin();
228
12
                        {
229
4.91k
                            while (iter != aggregate_data_container->end()) {
230
4.90k
                                keys[num_rows] = iter.get_key<KeyType>();
231
4.90k
                                ++iter;
232
4.90k
                                ++num_rows;
233
4.90k
                            }
234
12
                        }
235
12
                        agg_method.insert_keys_into_columns(keys, key_columns, num_rows);
236
12
                        if (has_null_key) {
237
0
                            key_columns[0]->insert_data(nullptr, 0);
238
0
                        }
239
12
                        return key_columns;
240
12
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberImNS4_15DataWithNullKeyI9PHHashMapImPc9HashCRC32ImEEEEEEEEEESt6vectorINS_3COWINS4_7IColumnEE11mutable_ptrISJ_EESaISM_EEOT_
Line
Count
Source
214
12
                    [&](auto&& agg_method) -> vectorized::MutableColumns {
215
12
                        vectorized::MutableColumns key_columns;
216
24
                        for (int i = 0; i < probe_expr_ctxs.size(); ++i) {
217
12
                            key_columns.emplace_back(
218
12
                                    probe_expr_ctxs[i]->root()->data_type()->create_column());
219
12
                        }
220
12
                        auto& data = *agg_method.hash_table;
221
12
                        bool has_null_key = data.has_null_key_data();
222
12
                        const auto size = data.size() - has_null_key;
223
12
                        using KeyType = std::decay_t<decltype(agg_method)>::Key;
224
12
                        std::vector<KeyType> keys(size);
225
226
12
                        uint32_t num_rows = 0;
227
12
                        auto iter = aggregate_data_container->begin();
228
12
                        {
229
4.41k
                            while (iter != aggregate_data_container->end()) {
230
4.40k
                                keys[num_rows] = iter.get_key<KeyType>();
231
4.40k
                                ++iter;
232
4.40k
                                ++num_rows;
233
4.40k
                            }
234
12
                        }
235
12
                        agg_method.insert_keys_into_columns(keys, key_columns, num_rows);
236
12
                        if (has_null_key) {
237
0
                            key_columns[0]->insert_data(nullptr, 0);
238
0
                        }
239
12
                        return key_columns;
240
12
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberIjNS4_15DataWithNullKeyI9PHHashMapIjPc14HashMixWrapperIj9HashCRC32IjEEEEEEEEEEESt6vectorINS_3COWINS4_7IColumnEE11mutable_ptrISL_EESaISO_EEOT_
Line
Count
Source
214
16
                    [&](auto&& agg_method) -> vectorized::MutableColumns {
215
16
                        vectorized::MutableColumns key_columns;
216
32
                        for (int i = 0; i < probe_expr_ctxs.size(); ++i) {
217
16
                            key_columns.emplace_back(
218
16
                                    probe_expr_ctxs[i]->root()->data_type()->create_column());
219
16
                        }
220
16
                        auto& data = *agg_method.hash_table;
221
16
                        bool has_null_key = data.has_null_key_data();
222
16
                        const auto size = data.size() - has_null_key;
223
16
                        using KeyType = std::decay_t<decltype(agg_method)>::Key;
224
16
                        std::vector<KeyType> keys(size);
225
226
16
                        uint32_t num_rows = 0;
227
16
                        auto iter = aggregate_data_container->begin();
228
16
                        {
229
54
                            while (iter != aggregate_data_container->end()) {
230
38
                                keys[num_rows] = iter.get_key<KeyType>();
231
38
                                ++iter;
232
38
                                ++num_rows;
233
38
                            }
234
16
                        }
235
16
                        agg_method.insert_keys_into_columns(keys, key_columns, num_rows);
236
16
                        if (has_null_key) {
237
2
                            key_columns[0]->insert_data(nullptr, 0);
238
2
                        }
239
16
                        return key_columns;
240
16
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberImNS4_15DataWithNullKeyI9PHHashMapImPc14HashMixWrapperIm9HashCRC32ImEEEEEEEEEEESt6vectorINS_3COWINS4_7IColumnEE11mutable_ptrISL_EESaISO_EEOT_
Line
Count
Source
214
16
                    [&](auto&& agg_method) -> vectorized::MutableColumns {
215
16
                        vectorized::MutableColumns key_columns;
216
32
                        for (int i = 0; i < probe_expr_ctxs.size(); ++i) {
217
16
                            key_columns.emplace_back(
218
16
                                    probe_expr_ctxs[i]->root()->data_type()->create_column());
219
16
                        }
220
16
                        auto& data = *agg_method.hash_table;
221
16
                        bool has_null_key = data.has_null_key_data();
222
16
                        const auto size = data.size() - has_null_key;
223
16
                        using KeyType = std::decay_t<decltype(agg_method)>::Key;
224
16
                        std::vector<KeyType> keys(size);
225
226
16
                        uint32_t num_rows = 0;
227
16
                        auto iter = aggregate_data_container->begin();
228
16
                        {
229
69
                            while (iter != aggregate_data_container->end()) {
230
53
                                keys[num_rows] = iter.get_key<KeyType>();
231
53
                                ++iter;
232
53
                                ++num_rows;
233
53
                            }
234
16
                        }
235
16
                        agg_method.insert_keys_into_columns(keys, key_columns, num_rows);
236
16
                        if (has_null_key) {
237
1
                            key_columns[0]->insert_data(nullptr, 0);
238
1
                        }
239
16
                        return key_columns;
240
16
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberIN4wide7integerILm128EjEENS4_15DataWithNullKeyI9PHHashMapIS9_Pc9HashCRC32IS9_EEEEEEEEEESt6vectorINS_3COWINS4_7IColumnEE11mutable_ptrISM_EESaISP_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
8
                            while (iter != aggregate_data_container->end()) {
230
6
                                keys[num_rows] = iter.get_key<KeyType>();
231
6
                                ++iter;
232
6
                                ++num_rows;
233
6
                            }
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_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_10vectorized15MethodKeysFixedI9PHHashMapIN4wide7integerILm128EjEEPc9HashCRC32IS9_EEEEEESt6vectorINS_3COWINS4_7IColumnEE11mutable_ptrISI_EESaISL_EEOT_
dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized15MethodKeysFixedI9PHHashMapIN4wide7integerILm256EjEEPc9HashCRC32IS9_EEEEEESt6vectorINS_3COWINS4_7IColumnEE11mutable_ptrISI_EESaISL_EEOT_
Line
Count
Source
214
142
                    [&](auto&& agg_method) -> vectorized::MutableColumns {
215
142
                        vectorized::MutableColumns key_columns;
216
546
                        for (int i = 0; i < probe_expr_ctxs.size(); ++i) {
217
404
                            key_columns.emplace_back(
218
404
                                    probe_expr_ctxs[i]->root()->data_type()->create_column());
219
404
                        }
220
142
                        auto& data = *agg_method.hash_table;
221
142
                        bool has_null_key = data.has_null_key_data();
222
142
                        const auto size = data.size() - has_null_key;
223
142
                        using KeyType = std::decay_t<decltype(agg_method)>::Key;
224
142
                        std::vector<KeyType> keys(size);
225
226
142
                        uint32_t num_rows = 0;
227
142
                        auto iter = aggregate_data_container->begin();
228
142
                        {
229
4.85k
                            while (iter != aggregate_data_container->end()) {
230
4.71k
                                keys[num_rows] = iter.get_key<KeyType>();
231
4.71k
                                ++iter;
232
4.71k
                                ++num_rows;
233
4.71k
                            }
234
142
                        }
235
142
                        agg_method.insert_keys_into_columns(keys, key_columns, num_rows);
236
142
                        if (has_null_key) {
237
0
                            key_columns[0]->insert_data(nullptr, 0);
238
0
                        }
239
142
                        return key_columns;
240
142
                    }},
Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized15MethodKeysFixedI9PHHashMapINS4_7UInt136EPc9HashCRC32IS7_EEEEEESt6vectorINS_3COWINS4_7IColumnEE11mutable_ptrISG_EESaISJ_EEOT_
241
256
            agg_data->method_variant);
242
256
}
243
244
256
void AggSharedState::build_limit_heap(size_t hash_table_size) {
245
256
    limit_columns = _get_keys_hash_table();
246
52.0k
    for (size_t i = 0; i < hash_table_size; ++i) {
247
51.8k
        limit_heap.emplace(i, limit_columns, order_directions, null_directions);
248
51.8k
    }
249
52.6k
    while (hash_table_size > limit) {
250
52.4k
        limit_heap.pop();
251
52.4k
        hash_table_size--;
252
52.4k
    }
253
256
    limit_columns_min = limit_heap.top()._row_id;
254
256
}
255
256
bool AggSharedState::do_limit_filter(vectorized::Block* block, size_t num_rows,
257
940
                                     const std::vector<int>* key_locs) {
258
940
    if (num_rows) {
259
940
        cmp_res.resize(num_rows);
260
940
        need_computes.resize(num_rows);
261
940
        memset(need_computes.data(), 0, need_computes.size());
262
940
        memset(cmp_res.data(), 0, cmp_res.size());
263
264
940
        const auto key_size = null_directions.size();
265
3.32k
        for (int i = 0; i < key_size; i++) {
266
2.38k
            block->get_by_position(key_locs ? key_locs->operator[](i) : i)
267
2.38k
                    .column->compare_internal(limit_columns_min, *limit_columns[i],
268
2.38k
                                              null_directions[i], order_directions[i], cmp_res,
269
2.38k
                                              need_computes.data());
270
2.38k
        }
271
272
948
        auto set_computes_arr = [](auto* __restrict res, auto* __restrict computes, size_t rows) {
273
777k
            for (size_t i = 0; i < rows; ++i) {
274
776k
                computes[i] = computes[i] == res[i];
275
776k
            }
276
948
        };
277
940
        set_computes_arr(cmp_res.data(), need_computes.data(), num_rows);
278
279
940
        return std::find(need_computes.begin(), need_computes.end(), 0) != need_computes.end();
280
940
    }
281
282
0
    return false;
283
940
}
284
285
66.7k
Status AggSharedState::reset_hash_table() {
286
66.7k
    return std::visit(
287
66.7k
            vectorized::Overload {
288
66.7k
                    [&](std::monostate& arg) -> Status {
289
0
                        return Status::InternalError("Uninited hash table");
290
0
                    },
291
66.7k
                    [&](auto& agg_method) {
292
66.7k
                        auto& hash_table = *agg_method.hash_table;
293
66.7k
                        using HashTableType = std::decay_t<decltype(hash_table)>;
294
295
66.7k
                        agg_method.arena.clear();
296
66.7k
                        agg_method.inited_iterator = false;
297
298
12.8M
                        hash_table.for_each_mapped([&](auto& mapped) {
299
12.8M
                            if (mapped) {
300
12.8M
                                static_cast<void>(_destroy_agg_status(mapped));
301
12.8M
                                mapped = nullptr;
302
12.8M
                            }
303
12.8M
                        });
dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized16MethodSerializedI9PHHashMapINS_9StringRefEPc11DefaultHashIS7_vEEEEEEDaRT_ENKUlSE_E_clIS8_EEDaSE_
Line
Count
Source
298
153k
                        hash_table.for_each_mapped([&](auto& mapped) {
299
153k
                            if (mapped) {
300
153k
                                static_cast<void>(_destroy_agg_status(mapped));
301
153k
                                mapped = nullptr;
302
153k
                            }
303
153k
                        });
Unexecuted instantiation: dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodOneNumberIh9PHHashMapIhPc9HashCRC32IhEEEEEEDaRT_ENKUlSD_E_clIS7_EEDaSD_
dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodOneNumberIt9PHHashMapItPc9HashCRC32ItEEEEEEDaRT_ENKUlSD_E_clIS7_EEDaSD_
Line
Count
Source
298
18
                        hash_table.for_each_mapped([&](auto& mapped) {
299
18
                            if (mapped) {
300
18
                                static_cast<void>(_destroy_agg_status(mapped));
301
18
                                mapped = nullptr;
302
18
                            }
303
18
                        });
dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodOneNumberIj9PHHashMapIjPc9HashCRC32IjEEEEEEDaRT_ENKUlSD_E_clIS7_EEDaSD_
Line
Count
Source
298
2.48M
                        hash_table.for_each_mapped([&](auto& mapped) {
299
2.48M
                            if (mapped) {
300
2.48M
                                static_cast<void>(_destroy_agg_status(mapped));
301
2.48M
                                mapped = nullptr;
302
2.48M
                            }
303
2.48M
                        });
dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodOneNumberIm9PHHashMapImPc9HashCRC32ImEEEEEEDaRT_ENKUlSD_E_clIS7_EEDaSD_
Line
Count
Source
298
382k
                        hash_table.for_each_mapped([&](auto& mapped) {
299
382k
                            if (mapped) {
300
382k
                                static_cast<void>(_destroy_agg_status(mapped));
301
382k
                                mapped = nullptr;
302
382k
                            }
303
382k
                        });
dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized19MethodStringNoCacheINS_13StringHashMapIPcNS_9AllocatorILb1ELb1ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEEEEEDaRT_ENKUlSE_E_clIS7_EEDaSE_
Line
Count
Source
298
2.19k
                        hash_table.for_each_mapped([&](auto& mapped) {
299
2.19k
                            if (mapped) {
300
2.19k
                                static_cast<void>(_destroy_agg_status(mapped));
301
2.19k
                                mapped = nullptr;
302
2.19k
                            }
303
2.19k
                        });
dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodOneNumberIN4wide7integerILm128EjEE9PHHashMapIS8_Pc9HashCRC32IS8_EEEEEEDaRT_ENKUlSG_E_clISA_EEDaSG_
Line
Count
Source
298
742
                        hash_table.for_each_mapped([&](auto& mapped) {
299
742
                            if (mapped) {
300
742
                                static_cast<void>(_destroy_agg_status(mapped));
301
742
                                mapped = nullptr;
302
742
                            }
303
742
                        });
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.37M
                        hash_table.for_each_mapped([&](auto& mapped) {
299
1.37M
                            if (mapped) {
300
1.37M
                                static_cast<void>(_destroy_agg_status(mapped));
301
1.37M
                                mapped = nullptr;
302
1.37M
                            }
303
1.37M
                        });
dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodOneNumberIm9PHHashMapImPc14HashMixWrapperIm9HashCRC32ImEEEEEEEDaRT_ENKUlSF_E_clIS7_EEDaSF_
Line
Count
Source
298
692k
                        hash_table.for_each_mapped([&](auto& mapped) {
299
692k
                            if (mapped) {
300
692k
                                static_cast<void>(_destroy_agg_status(mapped));
301
692k
                                mapped = nullptr;
302
692k
                            }
303
692k
                        });
dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberIhNS4_15DataWithNullKeyI9PHHashMapIhPc9HashCRC32IhEEEEEEEEEEDaRT_ENKUlSH_E_clIS9_EEDaSH_
Line
Count
Source
298
1.35k
                        hash_table.for_each_mapped([&](auto& mapped) {
299
1.35k
                            if (mapped) {
300
1.35k
                                static_cast<void>(_destroy_agg_status(mapped));
301
1.35k
                                mapped = nullptr;
302
1.35k
                            }
303
1.35k
                        });
dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberItNS4_15DataWithNullKeyI9PHHashMapItPc9HashCRC32ItEEEEEEEEEEDaRT_ENKUlSH_E_clIS9_EEDaSH_
Line
Count
Source
298
696k
                        hash_table.for_each_mapped([&](auto& mapped) {
299
696k
                            if (mapped) {
300
696k
                                static_cast<void>(_destroy_agg_status(mapped));
301
696k
                                mapped = nullptr;
302
696k
                            }
303
696k
                        });
dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberIjNS4_15DataWithNullKeyI9PHHashMapIjPc9HashCRC32IjEEEEEEEEEEDaRT_ENKUlSH_E_clIS9_EEDaSH_
Line
Count
Source
298
377k
                        hash_table.for_each_mapped([&](auto& mapped) {
299
377k
                            if (mapped) {
300
377k
                                static_cast<void>(_destroy_agg_status(mapped));
301
377k
                                mapped = nullptr;
302
377k
                            }
303
377k
                        });
dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberImNS4_15DataWithNullKeyI9PHHashMapImPc9HashCRC32ImEEEEEEEEEEDaRT_ENKUlSH_E_clIS9_EEDaSH_
Line
Count
Source
298
1.57M
                        hash_table.for_each_mapped([&](auto& mapped) {
299
1.57M
                            if (mapped) {
300
1.57M
                                static_cast<void>(_destroy_agg_status(mapped));
301
1.57M
                                mapped = nullptr;
302
1.57M
                            }
303
1.57M
                        });
dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberIjNS4_15DataWithNullKeyI9PHHashMapIjPc14HashMixWrapperIj9HashCRC32IjEEEEEEEEEEEDaRT_ENKUlSJ_E_clIS9_EEDaSJ_
Line
Count
Source
298
1.05M
                        hash_table.for_each_mapped([&](auto& mapped) {
299
1.05M
                            if (mapped) {
300
1.05M
                                static_cast<void>(_destroy_agg_status(mapped));
301
1.05M
                                mapped = nullptr;
302
1.05M
                            }
303
1.05M
                        });
dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberImNS4_15DataWithNullKeyI9PHHashMapImPc14HashMixWrapperIm9HashCRC32ImEEEEEEEEEEEDaRT_ENKUlSJ_E_clIS9_EEDaSJ_
Line
Count
Source
298
2.95M
                        hash_table.for_each_mapped([&](auto& mapped) {
299
2.95M
                            if (mapped) {
300
2.95M
                                static_cast<void>(_destroy_agg_status(mapped));
301
2.95M
                                mapped = nullptr;
302
2.95M
                            }
303
2.95M
                        });
dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberIN4wide7integerILm128EjEENS4_15DataWithNullKeyI9PHHashMapIS9_Pc9HashCRC32IS9_EEEEEEEEEEDaRT_ENKUlSK_E_clISC_EEDaSK_
Line
Count
Source
298
787k
                        hash_table.for_each_mapped([&](auto& mapped) {
299
787k
                            if (mapped) {
300
787k
                                static_cast<void>(_destroy_agg_status(mapped));
301
787k
                                mapped = nullptr;
302
787k
                            }
303
787k
                        });
dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberIN4wide7integerILm256EjEENS4_15DataWithNullKeyI9PHHashMapIS9_Pc9HashCRC32IS9_EEEEEEEEEEDaRT_ENKUlSK_E_clISC_EEDaSK_
Line
Count
Source
298
12
                        hash_table.for_each_mapped([&](auto& mapped) {
299
12
                            if (mapped) {
300
12
                                static_cast<void>(_destroy_agg_status(mapped));
301
12
                                mapped = nullptr;
302
12
                            }
303
12
                        });
dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_19MethodStringNoCacheINS4_15DataWithNullKeyINS_13StringHashMapIPcNS_9AllocatorILb1ELb1ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEEEEEEEEEDaRT_ENKUlSI_E_clIS9_EEDaSI_
Line
Count
Source
298
2.56k
                        hash_table.for_each_mapped([&](auto& mapped) {
299
2.56k
                            if (mapped) {
300
2.56k
                                static_cast<void>(_destroy_agg_status(mapped));
301
2.56k
                                mapped = nullptr;
302
2.56k
                            }
303
2.56k
                        });
dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodKeysFixedI9PHHashMapImPc9HashCRC32ImEEEEEEDaRT_ENKUlSD_E_clIS7_EEDaSD_
Line
Count
Source
298
260k
                        hash_table.for_each_mapped([&](auto& mapped) {
299
260k
                            if (mapped) {
300
260k
                                static_cast<void>(_destroy_agg_status(mapped));
301
260k
                                mapped = nullptr;
302
260k
                            }
303
260k
                        });
dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodKeysFixedI9PHHashMapIN4wide7integerILm128EjEEPc9HashCRC32IS9_EEEEEEDaRT_ENKUlSG_E_clISA_EEDaSG_
Line
Count
Source
298
54.5k
                        hash_table.for_each_mapped([&](auto& mapped) {
299
54.5k
                            if (mapped) {
300
54.5k
                                static_cast<void>(_destroy_agg_status(mapped));
301
54.5k
                                mapped = nullptr;
302
54.5k
                            }
303
54.5k
                        });
dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodKeysFixedI9PHHashMapIN4wide7integerILm256EjEEPc9HashCRC32IS9_EEEEEEDaRT_ENKUlSG_E_clISA_EEDaSG_
Line
Count
Source
298
1.54k
                        hash_table.for_each_mapped([&](auto& mapped) {
299
1.54k
                            if (mapped) {
300
1.54k
                                static_cast<void>(_destroy_agg_status(mapped));
301
1.54k
                                mapped = nullptr;
302
1.54k
                            }
303
1.54k
                        });
dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodKeysFixedI9PHHashMapINS4_7UInt136EPc9HashCRC32IS7_EEEEEEDaRT_ENKUlSE_E_clIS8_EEDaSE_
Line
Count
Source
298
4.12k
                        hash_table.for_each_mapped([&](auto& mapped) {
299
4.12k
                            if (mapped) {
300
4.12k
                                static_cast<void>(_destroy_agg_status(mapped));
301
4.12k
                                mapped = nullptr;
302
4.12k
                            }
303
4.12k
                        });
304
305
66.7k
                        if (hash_table.has_null_key_data()) {
306
68
                            auto st = _destroy_agg_status(hash_table.template get_null_key_data<
307
68
                                                          vectorized::AggregateDataPtr>());
308
68
                            RETURN_IF_ERROR(st);
309
68
                        }
310
311
66.7k
                        aggregate_data_container.reset(new AggregateDataContainer(
312
66.7k
                                sizeof(typename HashTableType::key_type),
313
66.7k
                                ((total_size_of_aggregate_states + align_aggregate_states - 1) /
314
66.7k
                                 align_aggregate_states) *
315
66.7k
                                        align_aggregate_states));
316
66.7k
                        agg_method.hash_table.reset(new HashTableType());
317
66.7k
                        return Status::OK();
318
66.7k
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized16MethodSerializedI9PHHashMapINS_9StringRefEPc11DefaultHashIS7_vEEEEEEDaRT_
Line
Count
Source
291
10.2k
                    [&](auto& agg_method) {
292
10.2k
                        auto& hash_table = *agg_method.hash_table;
293
10.2k
                        using HashTableType = std::decay_t<decltype(hash_table)>;
294
295
10.2k
                        agg_method.arena.clear();
296
10.2k
                        agg_method.inited_iterator = false;
297
298
10.2k
                        hash_table.for_each_mapped([&](auto& mapped) {
299
10.2k
                            if (mapped) {
300
10.2k
                                static_cast<void>(_destroy_agg_status(mapped));
301
10.2k
                                mapped = nullptr;
302
10.2k
                            }
303
10.2k
                        });
304
305
10.2k
                        if (hash_table.has_null_key_data()) {
306
0
                            auto st = _destroy_agg_status(hash_table.template get_null_key_data<
307
0
                                                          vectorized::AggregateDataPtr>());
308
0
                            RETURN_IF_ERROR(st);
309
0
                        }
310
311
10.2k
                        aggregate_data_container.reset(new AggregateDataContainer(
312
10.2k
                                sizeof(typename HashTableType::key_type),
313
10.2k
                                ((total_size_of_aggregate_states + align_aggregate_states - 1) /
314
10.2k
                                 align_aggregate_states) *
315
10.2k
                                        align_aggregate_states));
316
10.2k
                        agg_method.hash_table.reset(new HashTableType());
317
10.2k
                        return Status::OK();
318
10.2k
                    }},
Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodOneNumberIh9PHHashMapIhPc9HashCRC32IhEEEEEEDaRT_
dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodOneNumberIt9PHHashMapItPc9HashCRC32ItEEEEEEDaRT_
Line
Count
Source
291
24
                    [&](auto& agg_method) {
292
24
                        auto& hash_table = *agg_method.hash_table;
293
24
                        using HashTableType = std::decay_t<decltype(hash_table)>;
294
295
24
                        agg_method.arena.clear();
296
24
                        agg_method.inited_iterator = false;
297
298
24
                        hash_table.for_each_mapped([&](auto& mapped) {
299
24
                            if (mapped) {
300
24
                                static_cast<void>(_destroy_agg_status(mapped));
301
24
                                mapped = nullptr;
302
24
                            }
303
24
                        });
304
305
24
                        if (hash_table.has_null_key_data()) {
306
0
                            auto st = _destroy_agg_status(hash_table.template get_null_key_data<
307
0
                                                          vectorized::AggregateDataPtr>());
308
0
                            RETURN_IF_ERROR(st);
309
0
                        }
310
311
24
                        aggregate_data_container.reset(new AggregateDataContainer(
312
24
                                sizeof(typename HashTableType::key_type),
313
24
                                ((total_size_of_aggregate_states + align_aggregate_states - 1) /
314
24
                                 align_aggregate_states) *
315
24
                                        align_aggregate_states));
316
24
                        agg_method.hash_table.reset(new HashTableType());
317
24
                        return Status::OK();
318
24
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodOneNumberIj9PHHashMapIjPc9HashCRC32IjEEEEEEDaRT_
Line
Count
Source
291
11.3k
                    [&](auto& agg_method) {
292
11.3k
                        auto& hash_table = *agg_method.hash_table;
293
11.3k
                        using HashTableType = std::decay_t<decltype(hash_table)>;
294
295
11.3k
                        agg_method.arena.clear();
296
11.3k
                        agg_method.inited_iterator = false;
297
298
11.3k
                        hash_table.for_each_mapped([&](auto& mapped) {
299
11.3k
                            if (mapped) {
300
11.3k
                                static_cast<void>(_destroy_agg_status(mapped));
301
11.3k
                                mapped = nullptr;
302
11.3k
                            }
303
11.3k
                        });
304
305
11.3k
                        if (hash_table.has_null_key_data()) {
306
0
                            auto st = _destroy_agg_status(hash_table.template get_null_key_data<
307
0
                                                          vectorized::AggregateDataPtr>());
308
0
                            RETURN_IF_ERROR(st);
309
0
                        }
310
311
11.3k
                        aggregate_data_container.reset(new AggregateDataContainer(
312
11.3k
                                sizeof(typename HashTableType::key_type),
313
11.3k
                                ((total_size_of_aggregate_states + align_aggregate_states - 1) /
314
11.3k
                                 align_aggregate_states) *
315
11.3k
                                        align_aggregate_states));
316
11.3k
                        agg_method.hash_table.reset(new HashTableType());
317
11.3k
                        return Status::OK();
318
11.3k
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodOneNumberIm9PHHashMapImPc9HashCRC32ImEEEEEEDaRT_
Line
Count
Source
291
2.52k
                    [&](auto& agg_method) {
292
2.52k
                        auto& hash_table = *agg_method.hash_table;
293
2.52k
                        using HashTableType = std::decay_t<decltype(hash_table)>;
294
295
2.52k
                        agg_method.arena.clear();
296
2.52k
                        agg_method.inited_iterator = false;
297
298
2.52k
                        hash_table.for_each_mapped([&](auto& mapped) {
299
2.52k
                            if (mapped) {
300
2.52k
                                static_cast<void>(_destroy_agg_status(mapped));
301
2.52k
                                mapped = nullptr;
302
2.52k
                            }
303
2.52k
                        });
304
305
2.52k
                        if (hash_table.has_null_key_data()) {
306
0
                            auto st = _destroy_agg_status(hash_table.template get_null_key_data<
307
0
                                                          vectorized::AggregateDataPtr>());
308
0
                            RETURN_IF_ERROR(st);
309
0
                        }
310
311
2.52k
                        aggregate_data_container.reset(new AggregateDataContainer(
312
2.52k
                                sizeof(typename HashTableType::key_type),
313
2.52k
                                ((total_size_of_aggregate_states + align_aggregate_states - 1) /
314
2.52k
                                 align_aggregate_states) *
315
2.52k
                                        align_aggregate_states));
316
2.52k
                        agg_method.hash_table.reset(new HashTableType());
317
2.52k
                        return Status::OK();
318
2.52k
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized19MethodStringNoCacheINS_13StringHashMapIPcNS_9AllocatorILb1ELb1ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEEEEEDaRT_
Line
Count
Source
291
1.21k
                    [&](auto& agg_method) {
292
1.21k
                        auto& hash_table = *agg_method.hash_table;
293
1.21k
                        using HashTableType = std::decay_t<decltype(hash_table)>;
294
295
1.21k
                        agg_method.arena.clear();
296
1.21k
                        agg_method.inited_iterator = false;
297
298
1.21k
                        hash_table.for_each_mapped([&](auto& mapped) {
299
1.21k
                            if (mapped) {
300
1.21k
                                static_cast<void>(_destroy_agg_status(mapped));
301
1.21k
                                mapped = nullptr;
302
1.21k
                            }
303
1.21k
                        });
304
305
1.21k
                        if (hash_table.has_null_key_data()) {
306
0
                            auto st = _destroy_agg_status(hash_table.template get_null_key_data<
307
0
                                                          vectorized::AggregateDataPtr>());
308
0
                            RETURN_IF_ERROR(st);
309
0
                        }
310
311
1.21k
                        aggregate_data_container.reset(new AggregateDataContainer(
312
1.21k
                                sizeof(typename HashTableType::key_type),
313
1.21k
                                ((total_size_of_aggregate_states + align_aggregate_states - 1) /
314
1.21k
                                 align_aggregate_states) *
315
1.21k
                                        align_aggregate_states));
316
1.21k
                        agg_method.hash_table.reset(new HashTableType());
317
1.21k
                        return Status::OK();
318
1.21k
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodOneNumberIN4wide7integerILm128EjEE9PHHashMapIS8_Pc9HashCRC32IS8_EEEEEEDaRT_
Line
Count
Source
291
200
                    [&](auto& agg_method) {
292
200
                        auto& hash_table = *agg_method.hash_table;
293
200
                        using HashTableType = std::decay_t<decltype(hash_table)>;
294
295
200
                        agg_method.arena.clear();
296
200
                        agg_method.inited_iterator = false;
297
298
200
                        hash_table.for_each_mapped([&](auto& mapped) {
299
200
                            if (mapped) {
300
200
                                static_cast<void>(_destroy_agg_status(mapped));
301
200
                                mapped = nullptr;
302
200
                            }
303
200
                        });
304
305
200
                        if (hash_table.has_null_key_data()) {
306
0
                            auto st = _destroy_agg_status(hash_table.template get_null_key_data<
307
0
                                                          vectorized::AggregateDataPtr>());
308
0
                            RETURN_IF_ERROR(st);
309
0
                        }
310
311
200
                        aggregate_data_container.reset(new AggregateDataContainer(
312
200
                                sizeof(typename HashTableType::key_type),
313
200
                                ((total_size_of_aggregate_states + align_aggregate_states - 1) /
314
200
                                 align_aggregate_states) *
315
200
                                        align_aggregate_states));
316
200
                        agg_method.hash_table.reset(new HashTableType());
317
200
                        return Status::OK();
318
200
                    }},
Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodOneNumberIN4wide7integerILm256EjEE9PHHashMapIS8_Pc9HashCRC32IS8_EEEEEEDaRT_
dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodOneNumberIj9PHHashMapIjPc14HashMixWrapperIj9HashCRC32IjEEEEEEEDaRT_
Line
Count
Source
291
9.29k
                    [&](auto& agg_method) {
292
9.29k
                        auto& hash_table = *agg_method.hash_table;
293
9.29k
                        using HashTableType = std::decay_t<decltype(hash_table)>;
294
295
9.29k
                        agg_method.arena.clear();
296
9.29k
                        agg_method.inited_iterator = false;
297
298
9.29k
                        hash_table.for_each_mapped([&](auto& mapped) {
299
9.29k
                            if (mapped) {
300
9.29k
                                static_cast<void>(_destroy_agg_status(mapped));
301
9.29k
                                mapped = nullptr;
302
9.29k
                            }
303
9.29k
                        });
304
305
9.29k
                        if (hash_table.has_null_key_data()) {
306
0
                            auto st = _destroy_agg_status(hash_table.template get_null_key_data<
307
0
                                                          vectorized::AggregateDataPtr>());
308
0
                            RETURN_IF_ERROR(st);
309
0
                        }
310
311
9.29k
                        aggregate_data_container.reset(new AggregateDataContainer(
312
9.29k
                                sizeof(typename HashTableType::key_type),
313
9.29k
                                ((total_size_of_aggregate_states + align_aggregate_states - 1) /
314
9.29k
                                 align_aggregate_states) *
315
9.29k
                                        align_aggregate_states));
316
9.29k
                        agg_method.hash_table.reset(new HashTableType());
317
9.29k
                        return Status::OK();
318
9.29k
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodOneNumberIm9PHHashMapImPc14HashMixWrapperIm9HashCRC32ImEEEEEEEDaRT_
Line
Count
Source
291
2.81k
                    [&](auto& agg_method) {
292
2.81k
                        auto& hash_table = *agg_method.hash_table;
293
2.81k
                        using HashTableType = std::decay_t<decltype(hash_table)>;
294
295
2.81k
                        agg_method.arena.clear();
296
2.81k
                        agg_method.inited_iterator = false;
297
298
2.81k
                        hash_table.for_each_mapped([&](auto& mapped) {
299
2.81k
                            if (mapped) {
300
2.81k
                                static_cast<void>(_destroy_agg_status(mapped));
301
2.81k
                                mapped = nullptr;
302
2.81k
                            }
303
2.81k
                        });
304
305
2.81k
                        if (hash_table.has_null_key_data()) {
306
0
                            auto st = _destroy_agg_status(hash_table.template get_null_key_data<
307
0
                                                          vectorized::AggregateDataPtr>());
308
0
                            RETURN_IF_ERROR(st);
309
0
                        }
310
311
2.81k
                        aggregate_data_container.reset(new AggregateDataContainer(
312
2.81k
                                sizeof(typename HashTableType::key_type),
313
2.81k
                                ((total_size_of_aggregate_states + align_aggregate_states - 1) /
314
2.81k
                                 align_aggregate_states) *
315
2.81k
                                        align_aggregate_states));
316
2.81k
                        agg_method.hash_table.reset(new HashTableType());
317
2.81k
                        return Status::OK();
318
2.81k
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberIhNS4_15DataWithNullKeyI9PHHashMapIhPc9HashCRC32IhEEEEEEEEEEDaRT_
Line
Count
Source
291
372
                    [&](auto& agg_method) {
292
372
                        auto& hash_table = *agg_method.hash_table;
293
372
                        using HashTableType = std::decay_t<decltype(hash_table)>;
294
295
372
                        agg_method.arena.clear();
296
372
                        agg_method.inited_iterator = false;
297
298
372
                        hash_table.for_each_mapped([&](auto& mapped) {
299
372
                            if (mapped) {
300
372
                                static_cast<void>(_destroy_agg_status(mapped));
301
372
                                mapped = nullptr;
302
372
                            }
303
372
                        });
304
305
372
                        if (hash_table.has_null_key_data()) {
306
2
                            auto st = _destroy_agg_status(hash_table.template get_null_key_data<
307
2
                                                          vectorized::AggregateDataPtr>());
308
2
                            RETURN_IF_ERROR(st);
309
2
                        }
310
311
372
                        aggregate_data_container.reset(new AggregateDataContainer(
312
372
                                sizeof(typename HashTableType::key_type),
313
372
                                ((total_size_of_aggregate_states + align_aggregate_states - 1) /
314
372
                                 align_aggregate_states) *
315
372
                                        align_aggregate_states));
316
372
                        agg_method.hash_table.reset(new HashTableType());
317
372
                        return Status::OK();
318
372
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberItNS4_15DataWithNullKeyI9PHHashMapItPc9HashCRC32ItEEEEEEEEEEDaRT_
Line
Count
Source
291
1.27k
                    [&](auto& agg_method) {
292
1.27k
                        auto& hash_table = *agg_method.hash_table;
293
1.27k
                        using HashTableType = std::decay_t<decltype(hash_table)>;
294
295
1.27k
                        agg_method.arena.clear();
296
1.27k
                        agg_method.inited_iterator = false;
297
298
1.27k
                        hash_table.for_each_mapped([&](auto& mapped) {
299
1.27k
                            if (mapped) {
300
1.27k
                                static_cast<void>(_destroy_agg_status(mapped));
301
1.27k
                                mapped = nullptr;
302
1.27k
                            }
303
1.27k
                        });
304
305
1.27k
                        if (hash_table.has_null_key_data()) {
306
8
                            auto st = _destroy_agg_status(hash_table.template get_null_key_data<
307
8
                                                          vectorized::AggregateDataPtr>());
308
8
                            RETURN_IF_ERROR(st);
309
8
                        }
310
311
1.27k
                        aggregate_data_container.reset(new AggregateDataContainer(
312
1.27k
                                sizeof(typename HashTableType::key_type),
313
1.27k
                                ((total_size_of_aggregate_states + align_aggregate_states - 1) /
314
1.27k
                                 align_aggregate_states) *
315
1.27k
                                        align_aggregate_states));
316
1.27k
                        agg_method.hash_table.reset(new HashTableType());
317
1.27k
                        return Status::OK();
318
1.27k
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberIjNS4_15DataWithNullKeyI9PHHashMapIjPc9HashCRC32IjEEEEEEEEEEDaRT_
Line
Count
Source
291
5.27k
                    [&](auto& agg_method) {
292
5.27k
                        auto& hash_table = *agg_method.hash_table;
293
5.27k
                        using HashTableType = std::decay_t<decltype(hash_table)>;
294
295
5.27k
                        agg_method.arena.clear();
296
5.27k
                        agg_method.inited_iterator = false;
297
298
5.27k
                        hash_table.for_each_mapped([&](auto& mapped) {
299
5.27k
                            if (mapped) {
300
5.27k
                                static_cast<void>(_destroy_agg_status(mapped));
301
5.27k
                                mapped = nullptr;
302
5.27k
                            }
303
5.27k
                        });
304
305
5.27k
                        if (hash_table.has_null_key_data()) {
306
6
                            auto st = _destroy_agg_status(hash_table.template get_null_key_data<
307
6
                                                          vectorized::AggregateDataPtr>());
308
6
                            RETURN_IF_ERROR(st);
309
6
                        }
310
311
5.27k
                        aggregate_data_container.reset(new AggregateDataContainer(
312
5.27k
                                sizeof(typename HashTableType::key_type),
313
5.27k
                                ((total_size_of_aggregate_states + align_aggregate_states - 1) /
314
5.27k
                                 align_aggregate_states) *
315
5.27k
                                        align_aggregate_states));
316
5.27k
                        agg_method.hash_table.reset(new HashTableType());
317
5.27k
                        return Status::OK();
318
5.27k
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberImNS4_15DataWithNullKeyI9PHHashMapImPc9HashCRC32ImEEEEEEEEEEDaRT_
Line
Count
Source
291
1.33k
                    [&](auto& agg_method) {
292
1.33k
                        auto& hash_table = *agg_method.hash_table;
293
1.33k
                        using HashTableType = std::decay_t<decltype(hash_table)>;
294
295
1.33k
                        agg_method.arena.clear();
296
1.33k
                        agg_method.inited_iterator = false;
297
298
1.33k
                        hash_table.for_each_mapped([&](auto& mapped) {
299
1.33k
                            if (mapped) {
300
1.33k
                                static_cast<void>(_destroy_agg_status(mapped));
301
1.33k
                                mapped = nullptr;
302
1.33k
                            }
303
1.33k
                        });
304
305
1.33k
                        if (hash_table.has_null_key_data()) {
306
6
                            auto st = _destroy_agg_status(hash_table.template get_null_key_data<
307
6
                                                          vectorized::AggregateDataPtr>());
308
6
                            RETURN_IF_ERROR(st);
309
6
                        }
310
311
1.33k
                        aggregate_data_container.reset(new AggregateDataContainer(
312
1.33k
                                sizeof(typename HashTableType::key_type),
313
1.33k
                                ((total_size_of_aggregate_states + align_aggregate_states - 1) /
314
1.33k
                                 align_aggregate_states) *
315
1.33k
                                        align_aggregate_states));
316
1.33k
                        agg_method.hash_table.reset(new HashTableType());
317
1.33k
                        return Status::OK();
318
1.33k
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberIjNS4_15DataWithNullKeyI9PHHashMapIjPc14HashMixWrapperIj9HashCRC32IjEEEEEEEEEEEDaRT_
Line
Count
Source
291
3.73k
                    [&](auto& agg_method) {
292
3.73k
                        auto& hash_table = *agg_method.hash_table;
293
3.73k
                        using HashTableType = std::decay_t<decltype(hash_table)>;
294
295
3.73k
                        agg_method.arena.clear();
296
3.73k
                        agg_method.inited_iterator = false;
297
298
3.73k
                        hash_table.for_each_mapped([&](auto& mapped) {
299
3.73k
                            if (mapped) {
300
3.73k
                                static_cast<void>(_destroy_agg_status(mapped));
301
3.73k
                                mapped = nullptr;
302
3.73k
                            }
303
3.73k
                        });
304
305
3.73k
                        if (hash_table.has_null_key_data()) {
306
22
                            auto st = _destroy_agg_status(hash_table.template get_null_key_data<
307
22
                                                          vectorized::AggregateDataPtr>());
308
22
                            RETURN_IF_ERROR(st);
309
22
                        }
310
311
3.73k
                        aggregate_data_container.reset(new AggregateDataContainer(
312
3.73k
                                sizeof(typename HashTableType::key_type),
313
3.73k
                                ((total_size_of_aggregate_states + align_aggregate_states - 1) /
314
3.73k
                                 align_aggregate_states) *
315
3.73k
                                        align_aggregate_states));
316
3.73k
                        agg_method.hash_table.reset(new HashTableType());
317
3.73k
                        return Status::OK();
318
3.73k
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberImNS4_15DataWithNullKeyI9PHHashMapImPc14HashMixWrapperIm9HashCRC32ImEEEEEEEEEEEDaRT_
Line
Count
Source
291
3.04k
                    [&](auto& agg_method) {
292
3.04k
                        auto& hash_table = *agg_method.hash_table;
293
3.04k
                        using HashTableType = std::decay_t<decltype(hash_table)>;
294
295
3.04k
                        agg_method.arena.clear();
296
3.04k
                        agg_method.inited_iterator = false;
297
298
3.04k
                        hash_table.for_each_mapped([&](auto& mapped) {
299
3.04k
                            if (mapped) {
300
3.04k
                                static_cast<void>(_destroy_agg_status(mapped));
301
3.04k
                                mapped = nullptr;
302
3.04k
                            }
303
3.04k
                        });
304
305
3.04k
                        if (hash_table.has_null_key_data()) {
306
24
                            auto st = _destroy_agg_status(hash_table.template get_null_key_data<
307
24
                                                          vectorized::AggregateDataPtr>());
308
24
                            RETURN_IF_ERROR(st);
309
24
                        }
310
311
3.04k
                        aggregate_data_container.reset(new AggregateDataContainer(
312
3.04k
                                sizeof(typename HashTableType::key_type),
313
3.04k
                                ((total_size_of_aggregate_states + align_aggregate_states - 1) /
314
3.04k
                                 align_aggregate_states) *
315
3.04k
                                        align_aggregate_states));
316
3.04k
                        agg_method.hash_table.reset(new HashTableType());
317
3.04k
                        return Status::OK();
318
3.04k
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberIN4wide7integerILm128EjEENS4_15DataWithNullKeyI9PHHashMapIS9_Pc9HashCRC32IS9_EEEEEEEEEEDaRT_
Line
Count
Source
291
430
                    [&](auto& agg_method) {
292
430
                        auto& hash_table = *agg_method.hash_table;
293
430
                        using HashTableType = std::decay_t<decltype(hash_table)>;
294
295
430
                        agg_method.arena.clear();
296
430
                        agg_method.inited_iterator = false;
297
298
430
                        hash_table.for_each_mapped([&](auto& mapped) {
299
430
                            if (mapped) {
300
430
                                static_cast<void>(_destroy_agg_status(mapped));
301
430
                                mapped = nullptr;
302
430
                            }
303
430
                        });
304
305
430
                        if (hash_table.has_null_key_data()) {
306
0
                            auto st = _destroy_agg_status(hash_table.template get_null_key_data<
307
0
                                                          vectorized::AggregateDataPtr>());
308
0
                            RETURN_IF_ERROR(st);
309
0
                        }
310
311
430
                        aggregate_data_container.reset(new AggregateDataContainer(
312
430
                                sizeof(typename HashTableType::key_type),
313
430
                                ((total_size_of_aggregate_states + align_aggregate_states - 1) /
314
430
                                 align_aggregate_states) *
315
430
                                        align_aggregate_states));
316
430
                        agg_method.hash_table.reset(new HashTableType());
317
430
                        return Status::OK();
318
430
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberIN4wide7integerILm256EjEENS4_15DataWithNullKeyI9PHHashMapIS9_Pc9HashCRC32IS9_EEEEEEEEEEDaRT_
Line
Count
Source
291
14
                    [&](auto& agg_method) {
292
14
                        auto& hash_table = *agg_method.hash_table;
293
14
                        using HashTableType = std::decay_t<decltype(hash_table)>;
294
295
14
                        agg_method.arena.clear();
296
14
                        agg_method.inited_iterator = false;
297
298
14
                        hash_table.for_each_mapped([&](auto& mapped) {
299
14
                            if (mapped) {
300
14
                                static_cast<void>(_destroy_agg_status(mapped));
301
14
                                mapped = nullptr;
302
14
                            }
303
14
                        });
304
305
14
                        if (hash_table.has_null_key_data()) {
306
0
                            auto st = _destroy_agg_status(hash_table.template get_null_key_data<
307
0
                                                          vectorized::AggregateDataPtr>());
308
0
                            RETURN_IF_ERROR(st);
309
0
                        }
310
311
14
                        aggregate_data_container.reset(new AggregateDataContainer(
312
14
                                sizeof(typename HashTableType::key_type),
313
14
                                ((total_size_of_aggregate_states + align_aggregate_states - 1) /
314
14
                                 align_aggregate_states) *
315
14
                                        align_aggregate_states));
316
14
                        agg_method.hash_table.reset(new HashTableType());
317
14
                        return Status::OK();
318
14
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_19MethodStringNoCacheINS4_15DataWithNullKeyINS_13StringHashMapIPcNS_9AllocatorILb1ELb1ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEEEEEEEEEDaRT_
Line
Count
Source
291
1.86k
                    [&](auto& agg_method) {
292
1.86k
                        auto& hash_table = *agg_method.hash_table;
293
1.86k
                        using HashTableType = std::decay_t<decltype(hash_table)>;
294
295
1.86k
                        agg_method.arena.clear();
296
1.86k
                        agg_method.inited_iterator = false;
297
298
1.86k
                        hash_table.for_each_mapped([&](auto& mapped) {
299
1.86k
                            if (mapped) {
300
1.86k
                                static_cast<void>(_destroy_agg_status(mapped));
301
1.86k
                                mapped = nullptr;
302
1.86k
                            }
303
1.86k
                        });
304
305
1.86k
                        if (hash_table.has_null_key_data()) {
306
0
                            auto st = _destroy_agg_status(hash_table.template get_null_key_data<
307
0
                                                          vectorized::AggregateDataPtr>());
308
0
                            RETURN_IF_ERROR(st);
309
0
                        }
310
311
1.86k
                        aggregate_data_container.reset(new AggregateDataContainer(
312
1.86k
                                sizeof(typename HashTableType::key_type),
313
1.86k
                                ((total_size_of_aggregate_states + align_aggregate_states - 1) /
314
1.86k
                                 align_aggregate_states) *
315
1.86k
                                        align_aggregate_states));
316
1.86k
                        agg_method.hash_table.reset(new HashTableType());
317
1.86k
                        return Status::OK();
318
1.86k
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodKeysFixedI9PHHashMapImPc9HashCRC32ImEEEEEEDaRT_
Line
Count
Source
291
814
                    [&](auto& agg_method) {
292
814
                        auto& hash_table = *agg_method.hash_table;
293
814
                        using HashTableType = std::decay_t<decltype(hash_table)>;
294
295
814
                        agg_method.arena.clear();
296
814
                        agg_method.inited_iterator = false;
297
298
814
                        hash_table.for_each_mapped([&](auto& mapped) {
299
814
                            if (mapped) {
300
814
                                static_cast<void>(_destroy_agg_status(mapped));
301
814
                                mapped = nullptr;
302
814
                            }
303
814
                        });
304
305
814
                        if (hash_table.has_null_key_data()) {
306
0
                            auto st = _destroy_agg_status(hash_table.template get_null_key_data<
307
0
                                                          vectorized::AggregateDataPtr>());
308
0
                            RETURN_IF_ERROR(st);
309
0
                        }
310
311
814
                        aggregate_data_container.reset(new AggregateDataContainer(
312
814
                                sizeof(typename HashTableType::key_type),
313
814
                                ((total_size_of_aggregate_states + align_aggregate_states - 1) /
314
814
                                 align_aggregate_states) *
315
814
                                        align_aggregate_states));
316
814
                        agg_method.hash_table.reset(new HashTableType());
317
814
                        return Status::OK();
318
814
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodKeysFixedI9PHHashMapIN4wide7integerILm128EjEEPc9HashCRC32IS9_EEEEEEDaRT_
Line
Count
Source
291
4.67k
                    [&](auto& agg_method) {
292
4.67k
                        auto& hash_table = *agg_method.hash_table;
293
4.67k
                        using HashTableType = std::decay_t<decltype(hash_table)>;
294
295
4.67k
                        agg_method.arena.clear();
296
4.67k
                        agg_method.inited_iterator = false;
297
298
4.67k
                        hash_table.for_each_mapped([&](auto& mapped) {
299
4.67k
                            if (mapped) {
300
4.67k
                                static_cast<void>(_destroy_agg_status(mapped));
301
4.67k
                                mapped = nullptr;
302
4.67k
                            }
303
4.67k
                        });
304
305
4.67k
                        if (hash_table.has_null_key_data()) {
306
0
                            auto st = _destroy_agg_status(hash_table.template get_null_key_data<
307
0
                                                          vectorized::AggregateDataPtr>());
308
0
                            RETURN_IF_ERROR(st);
309
0
                        }
310
311
4.67k
                        aggregate_data_container.reset(new AggregateDataContainer(
312
4.67k
                                sizeof(typename HashTableType::key_type),
313
4.67k
                                ((total_size_of_aggregate_states + align_aggregate_states - 1) /
314
4.67k
                                 align_aggregate_states) *
315
4.67k
                                        align_aggregate_states));
316
4.67k
                        agg_method.hash_table.reset(new HashTableType());
317
4.67k
                        return Status::OK();
318
4.67k
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodKeysFixedI9PHHashMapIN4wide7integerILm256EjEEPc9HashCRC32IS9_EEEEEEDaRT_
Line
Count
Source
291
1.82k
                    [&](auto& agg_method) {
292
1.82k
                        auto& hash_table = *agg_method.hash_table;
293
1.82k
                        using HashTableType = std::decay_t<decltype(hash_table)>;
294
295
1.82k
                        agg_method.arena.clear();
296
1.82k
                        agg_method.inited_iterator = false;
297
298
1.82k
                        hash_table.for_each_mapped([&](auto& mapped) {
299
1.82k
                            if (mapped) {
300
1.82k
                                static_cast<void>(_destroy_agg_status(mapped));
301
1.82k
                                mapped = nullptr;
302
1.82k
                            }
303
1.82k
                        });
304
305
1.82k
                        if (hash_table.has_null_key_data()) {
306
0
                            auto st = _destroy_agg_status(hash_table.template get_null_key_data<
307
0
                                                          vectorized::AggregateDataPtr>());
308
0
                            RETURN_IF_ERROR(st);
309
0
                        }
310
311
1.82k
                        aggregate_data_container.reset(new AggregateDataContainer(
312
1.82k
                                sizeof(typename HashTableType::key_type),
313
1.82k
                                ((total_size_of_aggregate_states + align_aggregate_states - 1) /
314
1.82k
                                 align_aggregate_states) *
315
1.82k
                                        align_aggregate_states));
316
1.82k
                        agg_method.hash_table.reset(new HashTableType());
317
1.82k
                        return Status::OK();
318
1.82k
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodKeysFixedI9PHHashMapINS4_7UInt136EPc9HashCRC32IS7_EEEEEEDaRT_
Line
Count
Source
291
4.37k
                    [&](auto& agg_method) {
292
4.37k
                        auto& hash_table = *agg_method.hash_table;
293
4.37k
                        using HashTableType = std::decay_t<decltype(hash_table)>;
294
295
4.37k
                        agg_method.arena.clear();
296
4.37k
                        agg_method.inited_iterator = false;
297
298
4.37k
                        hash_table.for_each_mapped([&](auto& mapped) {
299
4.37k
                            if (mapped) {
300
4.37k
                                static_cast<void>(_destroy_agg_status(mapped));
301
4.37k
                                mapped = nullptr;
302
4.37k
                            }
303
4.37k
                        });
304
305
4.37k
                        if (hash_table.has_null_key_data()) {
306
0
                            auto st = _destroy_agg_status(hash_table.template get_null_key_data<
307
0
                                                          vectorized::AggregateDataPtr>());
308
0
                            RETURN_IF_ERROR(st);
309
0
                        }
310
311
4.37k
                        aggregate_data_container.reset(new AggregateDataContainer(
312
4.37k
                                sizeof(typename HashTableType::key_type),
313
4.37k
                                ((total_size_of_aggregate_states + align_aggregate_states - 1) /
314
4.37k
                                 align_aggregate_states) *
315
4.37k
                                        align_aggregate_states));
316
4.37k
                        agg_method.hash_table.reset(new HashTableType());
317
4.37k
                        return Status::OK();
318
4.37k
                    }},
319
66.7k
            agg_data->method_variant);
320
66.7k
}
321
322
75.6k
void PartitionedAggSharedState::init_spill_params(size_t spill_partition_count) {
323
75.6k
    partition_count = spill_partition_count;
324
75.6k
    max_partition_index = partition_count - 1;
325
326
2.61M
    for (int i = 0; i < partition_count; ++i) {
327
2.54M
        spill_partitions.emplace_back(std::make_shared<AggSpillPartition>());
328
2.54M
    }
329
75.6k
}
330
331
80.5k
void PartitionedAggSharedState::update_spill_stream_profiles(RuntimeProfile* source_profile) {
332
2.57M
    for (auto& partition : spill_partitions) {
333
2.57M
        if (partition->spilling_stream_) {
334
0
            partition->spilling_stream_->update_shared_profiles(source_profile);
335
0
        }
336
2.57M
        for (auto& stream : partition->spill_streams_) {
337
39.6k
            if (stream) {
338
39.5k
                stream->update_shared_profiles(source_profile);
339
39.5k
            }
340
39.6k
        }
341
2.57M
    }
342
80.5k
}
343
344
Status AggSpillPartition::get_spill_stream(RuntimeState* state, int node_id,
345
                                           RuntimeProfile* profile,
346
269k
                                           vectorized::SpillStreamSPtr& spill_stream) {
347
269k
    if (spilling_stream_) {
348
230k
        spill_stream = spilling_stream_;
349
230k
        return Status::OK();
350
230k
    }
351
38.9k
    RETURN_IF_ERROR(ExecEnv::GetInstance()->spill_stream_mgr()->register_spill_stream(
352
38.9k
            state, spilling_stream_, print_id(state->query_id()), "agg", node_id,
353
38.9k
            std::numeric_limits<int32_t>::max(), std::numeric_limits<size_t>::max(), profile));
354
38.9k
    spill_streams_.emplace_back(spilling_stream_);
355
38.9k
    spill_stream = spilling_stream_;
356
38.9k
    return Status::OK();
357
38.9k
}
358
2.32M
void AggSpillPartition::close() {
359
2.32M
    if (spilling_stream_) {
360
1
        spilling_stream_.reset();
361
1
    }
362
2.32M
    for (auto& stream : spill_streams_) {
363
5
        (void)ExecEnv::GetInstance()->spill_stream_mgr()->delete_spill_stream(stream);
364
5
    }
365
2.32M
    spill_streams_.clear();
366
2.32M
}
367
368
85.3k
void PartitionedAggSharedState::close() {
369
    // need to use CAS instead of only `if (!is_closed)` statement,
370
    // to avoid concurrent entry of close() both pass the if statement
371
85.3k
    bool false_close = false;
372
85.3k
    if (!is_closed.compare_exchange_strong(false_close, true)) {
373
5.10k
        return;
374
5.10k
    }
375
85.3k
    DCHECK(!false_close && is_closed);
376
2.35M
    for (auto partition : spill_partitions) {
377
2.35M
        partition->close();
378
2.35M
    }
379
80.2k
    spill_partitions.clear();
380
80.2k
}
381
382
403k
void SpillSortSharedState::update_spill_stream_profiles(RuntimeProfile* source_profile) {
383
403k
    for (auto& stream : sorted_streams) {
384
298
        if (stream) {
385
298
            stream->update_shared_profiles(source_profile);
386
298
        }
387
298
    }
388
403k
}
389
390
395k
void SpillSortSharedState::close() {
391
    // need to use CAS instead of only `if (!is_closed)` statement,
392
    // to avoid concurrent entry of close() both pass the if statement
393
395k
    bool false_close = false;
394
395k
    if (!is_closed.compare_exchange_strong(false_close, true)) {
395
2
        return;
396
2
    }
397
395k
    DCHECK(!false_close && is_closed);
398
395k
    for (auto& stream : sorted_streams) {
399
1
        (void)ExecEnv::GetInstance()->spill_stream_mgr()->delete_spill_stream(stream);
400
1
    }
401
395k
    sorted_streams.clear();
402
395k
}
403
404
MultiCastSharedState::MultiCastSharedState(ObjectPool* pool, int cast_sender_count, int node_id)
405
4.16k
        : multi_cast_data_streamer(std::make_unique<pipeline::MultiCastDataStreamer>(
406
4.16k
                  this, pool, cast_sender_count, node_id)) {}
407
408
0
void MultiCastSharedState::update_spill_stream_profiles(RuntimeProfile* source_profile) {}
409
410
259k
int AggSharedState::get_slot_column_id(const vectorized::AggFnEvaluator* evaluator) {
411
259k
    auto ctxs = evaluator->input_exprs_ctxs();
412
259k
    CHECK(ctxs.size() == 1 && ctxs[0]->root()->is_slot_ref())
413
0
            << "input_exprs_ctxs is invalid, input_exprs_ctx[0]="
414
0
            << ctxs[0]->root()->debug_string();
415
259k
    return ((vectorized::VSlotRef*)ctxs[0]->root().get())->column_id();
416
259k
}
417
418
26.5M
Status AggSharedState::_destroy_agg_status(vectorized::AggregateDataPtr data) {
419
74.1M
    for (int i = 0; i < aggregate_evaluators.size(); ++i) {
420
47.6M
        aggregate_evaluators[i]->function()->destroy(data + offsets_of_aggregate_states[i]);
421
47.6M
    }
422
26.5M
    return Status::OK();
423
26.5M
}
424
425
333k
LocalExchangeSharedState::~LocalExchangeSharedState() = default;
426
427
1.90k
Status SetSharedState::update_build_not_ignore_null(const vectorized::VExprContextSPtrs& ctxs) {
428
1.90k
    if (ctxs.size() > build_not_ignore_null.size()) {
429
0
        return Status::InternalError("build_not_ignore_null not initialized");
430
0
    }
431
432
4.65k
    for (int i = 0; i < ctxs.size(); ++i) {
433
2.74k
        build_not_ignore_null[i] = build_not_ignore_null[i] || ctxs[i]->root()->is_nullable();
434
2.74k
    }
435
436
1.90k
    return Status::OK();
437
1.90k
}
438
439
1.91k
size_t SetSharedState::get_hash_table_size() const {
440
1.91k
    size_t hash_table_size = 0;
441
1.91k
    std::visit(
442
1.91k
            [&](auto&& arg) {
443
1.91k
                using HashTableCtxType = std::decay_t<decltype(arg)>;
444
1.91k
                if constexpr (!std::is_same_v<HashTableCtxType, std::monostate>) {
445
1.91k
                    hash_table_size = arg.hash_table->size();
446
1.91k
                }
447
1.91k
            },
Unexecuted instantiation: dependency.cpp:_ZZNK5doris8pipeline14SetSharedState19get_hash_table_sizeEvENK3$_0clIRSt9monostateEEDaOT_
dependency.cpp:_ZZNK5doris8pipeline14SetSharedState19get_hash_table_sizeEvENK3$_0clIRNS_10vectorized16MethodSerializedI9PHHashMapINS_9StringRefENS_14RowRefWithFlagE11DefaultHashIS7_vEEEEEEDaOT_
Line
Count
Source
442
568
            [&](auto&& arg) {
443
568
                using HashTableCtxType = std::decay_t<decltype(arg)>;
444
568
                if constexpr (!std::is_same_v<HashTableCtxType, std::monostate>) {
445
568
                    hash_table_size = arg.hash_table->size();
446
568
                }
447
568
            },
dependency.cpp:_ZZNK5doris8pipeline14SetSharedState19get_hash_table_sizeEvENK3$_0clIRNS_10vectorized19MethodStringNoCacheI9PHHashMapINS_9StringRefENS_14RowRefWithFlagE11DefaultHashIS7_vEEEEEEDaOT_
Line
Count
Source
442
378
            [&](auto&& arg) {
443
378
                using HashTableCtxType = std::decay_t<decltype(arg)>;
444
378
                if constexpr (!std::is_same_v<HashTableCtxType, std::monostate>) {
445
378
                    hash_table_size = arg.hash_table->size();
446
378
                }
447
378
            },
dependency.cpp:_ZZNK5doris8pipeline14SetSharedState19get_hash_table_sizeEvENK3$_0clIRNS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberIhNS4_15DataWithNullKeyI9PHHashMapIhNS_14RowRefWithFlagE9HashCRC32IhEEEEEEEEEEDaOT_
Line
Count
Source
442
44
            [&](auto&& arg) {
443
44
                using HashTableCtxType = std::decay_t<decltype(arg)>;
444
44
                if constexpr (!std::is_same_v<HashTableCtxType, std::monostate>) {
445
44
                    hash_table_size = arg.hash_table->size();
446
44
                }
447
44
            },
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
442
584
            [&](auto&& arg) {
443
584
                using HashTableCtxType = std::decay_t<decltype(arg)>;
444
584
                if constexpr (!std::is_same_v<HashTableCtxType, std::monostate>) {
445
584
                    hash_table_size = arg.hash_table->size();
446
584
                }
447
584
            },
dependency.cpp:_ZZNK5doris8pipeline14SetSharedState19get_hash_table_sizeEvENK3$_0clIRNS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberImNS4_15DataWithNullKeyI9PHHashMapImNS_14RowRefWithFlagE9HashCRC32ImEEEEEEEEEEDaOT_
Line
Count
Source
442
58
            [&](auto&& arg) {
443
58
                using HashTableCtxType = std::decay_t<decltype(arg)>;
444
58
                if constexpr (!std::is_same_v<HashTableCtxType, std::monostate>) {
445
58
                    hash_table_size = arg.hash_table->size();
446
58
                }
447
58
            },
dependency.cpp:_ZZNK5doris8pipeline14SetSharedState19get_hash_table_sizeEvENK3$_0clIRNS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberIN4wide7integerILm128EjEENS4_15DataWithNullKeyI9PHHashMapIS9_NS_14RowRefWithFlagE9HashCRC32IS9_EEEEEEEEEEDaOT_
Line
Count
Source
442
32
            [&](auto&& arg) {
443
32
                using HashTableCtxType = std::decay_t<decltype(arg)>;
444
32
                if constexpr (!std::is_same_v<HashTableCtxType, std::monostate>) {
445
32
                    hash_table_size = arg.hash_table->size();
446
32
                }
447
32
            },
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
442
16
            [&](auto&& arg) {
443
16
                using HashTableCtxType = std::decay_t<decltype(arg)>;
444
16
                if constexpr (!std::is_same_v<HashTableCtxType, std::monostate>) {
445
16
                    hash_table_size = arg.hash_table->size();
446
16
                }
447
16
            },
dependency.cpp:_ZZNK5doris8pipeline14SetSharedState19get_hash_table_sizeEvENK3$_0clIRNS_10vectorized15MethodOneNumberIm9PHHashMapImNS_14RowRefWithFlagE9HashCRC32ImEEEEEEDaOT_
Line
Count
Source
442
8
            [&](auto&& arg) {
443
8
                using HashTableCtxType = std::decay_t<decltype(arg)>;
444
8
                if constexpr (!std::is_same_v<HashTableCtxType, std::monostate>) {
445
8
                    hash_table_size = arg.hash_table->size();
446
8
                }
447
8
            },
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
442
40
            [&](auto&& arg) {
443
40
                using HashTableCtxType = std::decay_t<decltype(arg)>;
444
40
                if constexpr (!std::is_same_v<HashTableCtxType, std::monostate>) {
445
40
                    hash_table_size = arg.hash_table->size();
446
40
                }
447
40
            },
dependency.cpp:_ZZNK5doris8pipeline14SetSharedState19get_hash_table_sizeEvENK3$_0clIRNS_10vectorized15MethodKeysFixedI9PHHashMapIN4wide7integerILm128EjEENS_14RowRefWithFlagE9HashCRC32IS9_EEEEEEDaOT_
Line
Count
Source
442
156
            [&](auto&& arg) {
443
156
                using HashTableCtxType = std::decay_t<decltype(arg)>;
444
156
                if constexpr (!std::is_same_v<HashTableCtxType, std::monostate>) {
445
156
                    hash_table_size = arg.hash_table->size();
446
156
                }
447
156
            },
dependency.cpp:_ZZNK5doris8pipeline14SetSharedState19get_hash_table_sizeEvENK3$_0clIRNS_10vectorized15MethodKeysFixedI9PHHashMapIN4wide7integerILm256EjEENS_14RowRefWithFlagE9HashCRC32IS9_EEEEEEDaOT_
Line
Count
Source
442
2
            [&](auto&& arg) {
443
2
                using HashTableCtxType = std::decay_t<decltype(arg)>;
444
2
                if constexpr (!std::is_same_v<HashTableCtxType, std::monostate>) {
445
2
                    hash_table_size = arg.hash_table->size();
446
2
                }
447
2
            },
dependency.cpp:_ZZNK5doris8pipeline14SetSharedState19get_hash_table_sizeEvENK3$_0clIRNS_10vectorized15MethodKeysFixedI9PHHashMapINS4_7UInt136ENS_14RowRefWithFlagE9HashCRC32IS7_EEEEEEDaOT_
Line
Count
Source
442
33
            [&](auto&& arg) {
443
33
                using HashTableCtxType = std::decay_t<decltype(arg)>;
444
33
                if constexpr (!std::is_same_v<HashTableCtxType, std::monostate>) {
445
33
                    hash_table_size = arg.hash_table->size();
446
33
                }
447
33
            },
448
1.91k
            hash_table_variants->method_variant);
449
1.91k
    return hash_table_size;
450
1.91k
}
451
452
852
Status SetSharedState::hash_table_init() {
453
852
    std::vector<vectorized::DataTypePtr> data_types;
454
2.11k
    for (size_t i = 0; i != child_exprs_lists[0].size(); ++i) {
455
1.26k
        auto& ctx = child_exprs_lists[0][i];
456
1.26k
        auto data_type = ctx->root()->data_type();
457
1.26k
        if (build_not_ignore_null[i]) {
458
936
            data_type = vectorized::make_nullable(data_type);
459
936
        }
460
1.26k
        data_types.emplace_back(std::move(data_type));
461
1.26k
    }
462
852
    return init_hash_method<SetDataVariants>(hash_table_variants.get(), data_types, true);
463
852
}
464
465
void AggSharedState::refresh_top_limit(size_t row_id,
466
86
                                       const vectorized::ColumnRawPtrs& key_columns) {
467
346
    for (int j = 0; j < key_columns.size(); ++j) {
468
260
        limit_columns[j]->insert_from(*key_columns[j], row_id);
469
260
    }
470
86
    limit_heap.emplace(limit_columns[0]->size() - 1, limit_columns, order_directions,
471
86
                       null_directions);
472
473
86
    limit_heap.pop();
474
86
    limit_columns_min = limit_heap.top()._row_id;
475
86
}
476
477
2.23k
Status MaterializationSharedState::merge_multi_response(vectorized::Block* block) {
478
2.23k
    std::map<int64_t, std::pair<vectorized::Block, int>> _block_maps;
479
5.18k
    for (int i = 0; i < block_order_results.size(); ++i) {
480
2.95k
        for (auto& [backend_id, rpc_struct] : rpc_struct_map) {
481
2.95k
            vectorized::Block partial_block;
482
2.95k
            DCHECK(rpc_struct.callback->response_->blocks_size() > i);
483
2.95k
            RETURN_IF_ERROR(
484
2.95k
                    partial_block.deserialize(rpc_struct.callback->response_->blocks(i).block()));
485
2.95k
            if (rpc_struct.callback->response_->blocks(i).has_profile()) {
486
0
                auto response_profile = RuntimeProfile::from_proto(
487
0
                        rpc_struct.callback->response_->blocks(i).profile());
488
0
                _update_profile_info(backend_id, response_profile.get());
489
0
            }
490
491
2.95k
            if (!partial_block.is_empty_column()) {
492
2.78k
                _block_maps[backend_id] = std::make_pair(std::move(partial_block), 0);
493
2.78k
            }
494
2.95k
        }
495
496
65.4k
        for (int j = 0; j < block_order_results[i].size(); ++j) {
497
62.5k
            auto backend_id = block_order_results[i][j];
498
62.5k
            if (backend_id) {
499
61.4k
                auto& source_block_rows = _block_maps[backend_id];
500
61.4k
                DCHECK(source_block_rows.second < source_block_rows.first.rows());
501
724k
                for (int k = 0; k < response_blocks[i].columns(); ++k) {
502
663k
                    response_blocks[i].get_column_by_position(k)->insert_from(
503
663k
                            *source_block_rows.first.get_by_position(k).column,
504
663k
                            source_block_rows.second);
505
663k
                }
506
61.4k
                source_block_rows.second++;
507
61.4k
            } else {
508
5.52k
                for (int k = 0; k < response_blocks[i].columns(); ++k) {
509
4.41k
                    response_blocks[i].get_column_by_position(k)->insert_default();
510
4.41k
                }
511
1.11k
            }
512
62.5k
        }
513
2.95k
    }
514
515
    // clear request/response
516
2.23k
    for (auto& [_, rpc_struct] : rpc_struct_map) {
517
5.19k
        for (int i = 0; i < rpc_struct.request.request_block_descs_size(); ++i) {
518
2.95k
            rpc_struct.request.mutable_request_block_descs(i)->clear_row_id();
519
2.95k
            rpc_struct.request.mutable_request_block_descs(i)->clear_file_id();
520
2.95k
        }
521
2.23k
    }
522
523
24.2k
    for (int i = 0, j = 0, rowid_to_block_loc = rowid_locs[j]; i < origin_block.columns(); i++) {
524
21.9k
        if (i != rowid_to_block_loc) {
525
19.0k
            block->insert(origin_block.get_by_position(i));
526
19.0k
        } else {
527
2.95k
            auto response_block = response_blocks[j].to_block();
528
18.8k
            for (int k = 0; k < response_block.columns(); k++) {
529
15.8k
                auto& data = response_block.get_by_position(k);
530
15.8k
                response_blocks[j].mutable_columns()[k] = data.column->clone_empty();
531
15.8k
                block->insert(data);
532
15.8k
            }
533
2.95k
            if (++j < rowid_locs.size()) {
534
723
                rowid_to_block_loc = rowid_locs[j];
535
723
            }
536
2.95k
        }
537
21.9k
    }
538
2.23k
    origin_block.clear();
539
540
2.23k
    return Status::OK();
541
2.23k
}
542
543
void MaterializationSharedState::_update_profile_info(int64_t backend_id,
544
0
                                                      RuntimeProfile* response_profile) {
545
0
    if (!backend_profile_info_string.contains(backend_id)) {
546
0
        backend_profile_info_string.emplace(backend_id,
547
0
                                            std::map<std::string, fmt::memory_buffer> {});
548
0
    }
549
0
    auto& info_map = backend_profile_info_string[backend_id];
550
551
0
    auto update_profile_info_key = [&](const std::string& info_key) {
552
0
        const auto* info_value = response_profile->get_info_string(info_key);
553
0
        if (info_value == nullptr) [[unlikely]] {
554
0
            LOG(WARNING) << "Get row id fetch rpc profile success, but no info key :" << info_key;
555
0
            return;
556
0
        }
557
0
        if (!info_map.contains(info_key)) {
558
0
            info_map.emplace(info_key, fmt::memory_buffer {});
559
0
        }
560
0
        fmt::format_to(info_map[info_key], "{}, ", *info_value);
561
0
    };
562
563
0
    update_profile_info_key(RowIdStorageReader::ScannersRunningTimeProfile);
564
0
    update_profile_info_key(RowIdStorageReader::InitReaderAvgTimeProfile);
565
0
    update_profile_info_key(RowIdStorageReader::GetBlockAvgTimeProfile);
566
0
    update_profile_info_key(RowIdStorageReader::FileReadLinesProfile);
567
0
    update_profile_info_key(vectorized::FileScanner::FileReadBytesProfile);
568
0
    update_profile_info_key(vectorized::FileScanner::FileReadTimeProfile);
569
0
}
570
571
void MaterializationSharedState::create_counter_dependency(int operator_id, int node_id,
572
1.57k
                                                           const std::string& name) {
573
1.57k
    auto dep =
574
1.57k
            std::make_shared<CountedFinishDependency>(operator_id, node_id, name + "_DEPENDENCY");
575
1.57k
    dep->set_shared_state(this);
576
    // just block source wait for add the counter in sink
577
1.57k
    dep->add(0);
578
579
1.57k
    source_deps.push_back(dep);
580
1.57k
}
581
582
Status MaterializationSharedState::create_muiltget_result(const vectorized::Columns& columns,
583
2.90k
                                                          bool eos, bool gc_id_map) {
584
2.90k
    const auto rows = columns.empty() ? 0 : columns[0]->size();
585
2.90k
    block_order_results.resize(columns.size());
586
587
5.85k
    for (int i = 0; i < columns.size(); ++i) {
588
2.95k
        const uint8_t* null_map = nullptr;
589
2.95k
        const vectorized::ColumnString* column_rowid = nullptr;
590
2.95k
        auto& column = columns[i];
591
592
2.95k
        if (auto column_ptr = check_and_get_column<vectorized::ColumnNullable>(*column)) {
593
574
            null_map = column_ptr->get_null_map_data().data();
594
574
            column_rowid = assert_cast<const vectorized::ColumnString*>(
595
574
                    column_ptr->get_nested_column_ptr().get());
596
2.37k
        } else {
597
2.37k
            column_rowid = assert_cast<const vectorized::ColumnString*>(column.get());
598
2.37k
        }
599
600
2.95k
        auto& block_order = block_order_results[i];
601
2.95k
        block_order.resize(rows);
602
603
65.4k
        for (int j = 0; j < rows; ++j) {
604
62.5k
            if (!null_map || !null_map[j]) {
605
61.3k
                DCHECK(column_rowid->get_data_at(j).size == sizeof(GlobalRowLoacationV2));
606
61.3k
                GlobalRowLoacationV2 row_location =
607
61.3k
                        *((GlobalRowLoacationV2*)column_rowid->get_data_at(j).data);
608
61.3k
                auto rpc_struct = rpc_struct_map.find(row_location.backend_id);
609
61.3k
                if (UNLIKELY(rpc_struct == rpc_struct_map.end())) {
610
0
                    return Status::InternalError(
611
0
                            "MaterializationSinkOperatorX failed to find rpc_struct, backend_id={}",
612
0
                            row_location.backend_id);
613
0
                }
614
61.3k
                rpc_struct->second.request.mutable_request_block_descs(i)->add_row_id(
615
61.3k
                        row_location.row_id);
616
61.3k
                rpc_struct->second.request.mutable_request_block_descs(i)->add_file_id(
617
61.3k
                        row_location.file_id);
618
61.3k
                block_order[j] = row_location.backend_id;
619
61.3k
            } else {
620
1.10k
                block_order[j] = 0;
621
1.10k
            }
622
62.5k
        }
623
2.95k
    }
624
625
2.90k
    if (eos && gc_id_map) {
626
1.57k
        for (auto& [_, rpc_struct] : rpc_struct_map) {
627
1.57k
            rpc_struct.request.set_gc_id_map(true);
628
1.57k
        }
629
1.57k
    }
630
2.90k
    last_block = eos;
631
2.90k
    need_merge_block = rows > 0;
632
633
2.90k
    return Status::OK();
634
2.90k
}
635
636
Status MaterializationSharedState::init_multi_requests(
637
1.57k
        const TMaterializationNode& materialization_node, RuntimeState* state) {
638
1.57k
    rpc_struct_inited = true;
639
1.57k
    PMultiGetRequestV2 multi_get_request;
640
    // Initialize the base struct of PMultiGetRequestV2
641
1.57k
    multi_get_request.set_be_exec_version(state->be_exec_version());
642
1.57k
    multi_get_request.set_wg_id(state->get_query_ctx()->workload_group()->id());
643
1.57k
    auto query_id = multi_get_request.mutable_query_id();
644
1.57k
    query_id->set_hi(state->query_id().hi);
645
1.57k
    query_id->set_lo(state->query_id().lo);
646
1.57k
    DCHECK_EQ(materialization_node.column_descs_lists.size(),
647
1.57k
              materialization_node.slot_locs_lists.size());
648
649
1.57k
    const auto& tuple_desc =
650
1.57k
            state->desc_tbl().get_tuple_descriptor(materialization_node.intermediate_tuple_id);
651
1.57k
    const auto& slots = tuple_desc->slots();
652
1.57k
    response_blocks =
653
1.57k
            std::vector<vectorized::MutableBlock>(materialization_node.column_descs_lists.size());
654
655
3.45k
    for (int i = 0; i < materialization_node.column_descs_lists.size(); ++i) {
656
1.88k
        auto request_block_desc = multi_get_request.add_request_block_descs();
657
1.88k
        request_block_desc->set_fetch_row_store(materialization_node.fetch_row_stores[i]);
658
        // Initialize the column_descs and slot_locs
659
1.88k
        auto& column_descs = materialization_node.column_descs_lists[i];
660
12.1k
        for (auto& column_desc_item : column_descs) {
661
12.1k
            TabletColumn(column_desc_item).to_schema_pb(request_block_desc->add_column_descs());
662
12.1k
        }
663
664
1.88k
        auto& slot_locs = materialization_node.slot_locs_lists[i];
665
1.88k
        tuple_desc->to_protobuf(request_block_desc->mutable_desc());
666
667
1.88k
        auto& column_idxs = materialization_node.column_idxs_lists[i];
668
12.1k
        for (auto idx : column_idxs) {
669
12.1k
            request_block_desc->add_column_idxs(idx);
670
12.1k
        }
671
672
1.88k
        std::vector<SlotDescriptor*> slots_res;
673
12.1k
        for (auto& slot_loc_item : slot_locs) {
674
12.1k
            slots[slot_loc_item]->to_protobuf(request_block_desc->add_slots());
675
12.1k
            slots_res.emplace_back(slots[slot_loc_item]);
676
12.1k
        }
677
1.88k
        response_blocks[i] = vectorized::MutableBlock(vectorized::Block(slots_res, 10));
678
1.88k
    }
679
680
    // Initialize the stubs and requests for each BE
681
1.57k
    for (const auto& node_info : materialization_node.nodes_info.nodes) {
682
1.57k
        auto client = ExecEnv::GetInstance()->brpc_internal_client_cache()->get_client(
683
1.57k
                node_info.host, node_info.async_internal_port);
684
1.57k
        if (!client) {
685
0
            LOG(WARNING) << "Get rpc stub failed, host=" << node_info.host
686
0
                         << ", port=" << node_info.async_internal_port;
687
0
            return Status::InternalError("RowIDFetcher failed to init rpc client, host={}, port={}",
688
0
                                         node_info.host, node_info.async_internal_port);
689
0
        }
690
1.57k
        rpc_struct_map.emplace(node_info.id, FetchRpcStruct {.stub = std::move(client),
691
1.57k
                                                             .request = multi_get_request,
692
1.57k
                                                             .callback = nullptr,
693
1.57k
                                                             .rpc_timer = MonotonicStopWatch()});
694
1.57k
    }
695
    // add be_num ad count finish counter for source dependency
696
1.57k
    ((CountedFinishDependency*)source_deps.back().get())->add((int)rpc_struct_map.size());
697
698
1.57k
    return Status::OK();
699
1.57k
}
700
701
} // namespace doris::pipeline