Coverage Report

Created: 2025-09-12 10:28

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
754k
                                                       const std::string& name) {
43
754k
    source_deps.push_back(std::make_shared<Dependency>(operator_id, node_id, name + "_DEPENDENCY"));
44
754k
    source_deps.back()->set_shared_state(this);
45
754k
    return source_deps.back().get();
46
754k
}
47
48
void BasicSharedState::create_source_dependencies(int num_sources, int operator_id, int node_id,
49
221k
                                                  const std::string& name) {
50
221k
    source_deps.resize(num_sources, nullptr);
51
1.39M
    for (auto& source_dep : source_deps) {
52
1.39M
        source_dep = std::make_shared<Dependency>(operator_id, node_id, name + "_DEPENDENCY");
53
1.39M
        source_dep->set_shared_state(this);
54
1.39M
    }
55
221k
}
56
57
Dependency* BasicSharedState::create_sink_dependency(int dest_id, int node_id,
58
1.93M
                                                     const std::string& name) {
59
1.93M
    sink_deps.push_back(std::make_shared<Dependency>(dest_id, node_id, name + "_DEPENDENCY", true));
60
1.93M
    sink_deps.back()->set_shared_state(this);
61
1.93M
    return sink_deps.back().get();
62
1.93M
}
63
64
7.34M
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
7.34M
    _blocked_task.push_back(task);
69
7.34M
}
70
71
25.4M
void Dependency::set_ready() {
72
25.4M
    if (_ready) {
73
18.4M
        return;
74
18.4M
    }
75
6.95M
    _watcher.stop();
76
6.95M
    std::vector<std::weak_ptr<PipelineTask>> local_block_task {};
77
6.95M
    {
78
6.95M
        std::unique_lock<std::mutex> lc(_task_lock);
79
6.95M
        if (_ready) {
80
8
            return;
81
8
        }
82
6.95M
        _ready = true;
83
6.95M
        local_block_task.swap(_blocked_task);
84
6.95M
    }
85
7.37M
    for (auto task : local_block_task) {
86
7.37M
        if (auto t = task.lock()) {
87
7.36M
            std::unique_lock<std::mutex> lc(_task_lock);
88
7.36M
            THROW_IF_ERROR(t->wake_up(this));
89
7.36M
        }
90
7.37M
    }
91
6.95M
}
92
93
66.9M
Dependency* Dependency::is_blocked_by(std::shared_ptr<PipelineTask> task) {
94
66.9M
    std::unique_lock<std::mutex> lc(_task_lock);
95
66.9M
    auto ready = _ready.load();
96
66.9M
    if (!ready && task) {
97
7.37M
        _add_block_task(task);
98
7.37M
        start_watcher();
99
7.37M
        THROW_IF_ERROR(task->blocked(this));
100
7.37M
    }
101
66.9M
    return ready ? nullptr : this;
102
66.9M
}
103
104
81.3k
std::string Dependency::debug_string(int indentation_level) {
105
81.3k
    fmt::memory_buffer debug_string_buffer;
106
81.3k
    fmt::format_to(debug_string_buffer, "{}{}: id={}, block task = {}, ready={}, _always_ready={}",
107
81.3k
                   std::string(indentation_level * 2, ' '), _name, _node_id, _blocked_task.size(),
108
81.3k
                   _ready, _always_ready);
109
81.3k
    return fmt::to_string(debug_string_buffer);
110
81.3k
}
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
12.1k
void RuntimeFilterTimer::call_timeout() {
122
12.1k
    _parent->set_ready();
123
12.1k
}
124
125
40.0k
void RuntimeFilterTimer::call_ready() {
126
40.0k
    _parent->set_ready();
127
40.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.29M
bool RuntimeFilterTimer::should_be_check_timeout() {
133
1.29M
    if (!_parent->ready() && !_local_runtime_filter_dependencies.empty()) {
134
4.30k
        bool all_ready = true;
135
4.32k
        for (auto& dep : _local_runtime_filter_dependencies) {
136
4.32k
            if (!dep->ready()) {
137
4.28k
                all_ready = false;
138
4.28k
                break;
139
4.28k
            }
140
4.32k
        }
141
4.30k
        if (all_ready) {
142
25
            _local_runtime_filter_dependencies.clear();
143
25
            _registration_time = MonotonicMillis();
144
25
        }
145
4.30k
        return all_ready;
146
4.30k
    }
147
1.28M
    return true;
148
1.29M
}
149
150
8
void RuntimeFilterTimerQueue::start() {
151
86.1k
    while (!_stop) {
152
86.1k
        std::unique_lock<std::mutex> lk(cv_m);
153
154
91.2k
        while (_que.empty() && !_stop) {
155
10.3k
            cv.wait_for(lk, std::chrono::seconds(3), [this] { return !_que.empty() || _stop; });
156
5.17k
        }
157
86.1k
        if (_stop) {
158
3
            break;
159
3
        }
160
86.1k
        {
161
86.1k
            std::unique_lock<std::mutex> lc(_que_lock);
162
86.1k
            std::list<std::shared_ptr<pipeline::RuntimeFilterTimer>> new_que;
163
1.29M
            for (auto& it : _que) {
164
1.29M
                if (it.use_count() == 1) {
165
                    // `use_count == 1` means this runtime filter has been released
166
1.29M
                } else if (it->should_be_check_timeout()) {
167
1.28M
                    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.25M
                        int64_t ms_since_registration = MonotonicMillis() - it->registration_time();
170
1.25M
                        if (ms_since_registration > it->wait_time_ms()) {
171
12.1k
                            it->call_timeout();
172
1.24M
                        } else {
173
1.24M
                            new_que.push_back(std::move(it));
174
1.24M
                        }
175
1.25M
                    }
176
1.28M
                } else {
177
4.28k
                    new_que.push_back(std::move(it));
178
4.28k
                }
179
1.29M
            }
180
86.1k
            new_que.swap(_que);
181
86.1k
        }
182
86.1k
        std::this_thread::sleep_for(std::chrono::milliseconds(interval));
183
86.1k
    }
184
8
    _shutdown = true;
185
8
}
186
187
757k
void LocalExchangeSharedState::sub_running_sink_operators() {
188
757k
    std::unique_lock<std::mutex> lc(le_lock);
189
757k
    if (exchanger->_running_sink_operators.fetch_sub(1) == 1) {
190
216k
        _set_always_ready();
191
216k
    }
192
757k
}
193
194
1.37M
void LocalExchangeSharedState::sub_running_source_operators() {
195
1.37M
    std::unique_lock<std::mutex> lc(le_lock);
196
1.37M
    if (exchanger->_running_source_operators.fetch_sub(1) == 1) {
197
216k
        _set_always_ready();
198
216k
        exchanger->finalize();
199
216k
    }
200
1.37M
}
201
202
215k
LocalExchangeSharedState::LocalExchangeSharedState(int num_instances) {
203
215k
    source_deps.resize(num_instances, nullptr);
204
215k
    mem_counters.resize(num_instances, nullptr);
205
215k
}
206
207
45
vectorized::MutableColumns AggSharedState::_get_keys_hash_table() {
208
45
    return std::visit(
209
45
            vectorized::Overload {
210
45
                    [&](std::monostate& arg) {
211
0
                        throw doris::Exception(ErrorCode::INTERNAL_ERROR, "uninited hash table");
212
0
                        return vectorized::MutableColumns();
213
0
                    },
214
45
                    [&](auto&& agg_method) -> vectorized::MutableColumns {
215
45
                        vectorized::MutableColumns key_columns;
216
118
                        for (int i = 0; i < probe_expr_ctxs.size(); ++i) {
217
73
                            key_columns.emplace_back(
218
73
                                    probe_expr_ctxs[i]->root()->data_type()->create_column());
219
73
                        }
220
45
                        auto& data = *agg_method.hash_table;
221
45
                        bool has_null_key = data.has_null_key_data();
222
45
                        const auto size = data.size() - has_null_key;
223
45
                        using KeyType = std::decay_t<decltype(agg_method)>::Key;
224
45
                        std::vector<KeyType> keys(size);
225
226
45
                        uint32_t num_rows = 0;
227
45
                        auto iter = aggregate_data_container->begin();
228
45
                        {
229
5.37k
                            while (iter != aggregate_data_container->end()) {
230
5.32k
                                keys[num_rows] = iter.get_key<KeyType>();
231
5.32k
                                ++iter;
232
5.32k
                                ++num_rows;
233
5.32k
                            }
234
45
                        }
235
45
                        agg_method.insert_keys_into_columns(keys, key_columns, num_rows);
236
45
                        if (has_null_key) {
237
2
                            key_columns[0]->insert_data(nullptr, 0);
238
2
                        }
239
45
                        return key_columns;
240
45
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized16MethodSerializedI9PHHashMapINS_9StringRefEPc11DefaultHashIS7_vEEEEEESt6vectorINS_3COWINS4_7IColumnEE11mutable_ptrISG_EESaISJ_EEOT_
Line
Count
Source
214
2
                    [&](auto&& agg_method) -> vectorized::MutableColumns {
215
2
                        vectorized::MutableColumns key_columns;
216
10
                        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
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
804
                            while (iter != aggregate_data_container->end()) {
230
802
                                keys[num_rows] = iter.get_key<KeyType>();
231
802
                                ++iter;
232
802
                                ++num_rows;
233
802
                            }
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_10vectorized15MethodOneNumberIh9PHHashMapIhPc9HashCRC32IhEEEEEESt6vectorINS_3COWINS4_7IColumnEE11mutable_ptrISF_EESaISI_EEOT_
Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized15MethodOneNumberIt9PHHashMapItPc9HashCRC32ItEEEEEESt6vectorINS_3COWINS4_7IColumnEE11mutable_ptrISF_EESaISI_EEOT_
Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized15MethodOneNumberIj9PHHashMapIjPc9HashCRC32IjEEEEEESt6vectorINS_3COWINS4_7IColumnEE11mutable_ptrISF_EESaISI_EEOT_
dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized15MethodOneNumberIm9PHHashMapImPc9HashCRC32ImEEEEEESt6vectorINS_3COWINS4_7IColumnEE11mutable_ptrISF_EESaISI_EEOT_
Line
Count
Source
214
3
                    [&](auto&& agg_method) -> vectorized::MutableColumns {
215
3
                        vectorized::MutableColumns key_columns;
216
6
                        for (int i = 0; i < probe_expr_ctxs.size(); ++i) {
217
3
                            key_columns.emplace_back(
218
3
                                    probe_expr_ctxs[i]->root()->data_type()->create_column());
219
3
                        }
220
3
                        auto& data = *agg_method.hash_table;
221
3
                        bool has_null_key = data.has_null_key_data();
222
3
                        const auto size = data.size() - has_null_key;
223
3
                        using KeyType = std::decay_t<decltype(agg_method)>::Key;
224
3
                        std::vector<KeyType> keys(size);
225
226
3
                        uint32_t num_rows = 0;
227
3
                        auto iter = aggregate_data_container->begin();
228
3
                        {
229
18
                            while (iter != aggregate_data_container->end()) {
230
15
                                keys[num_rows] = iter.get_key<KeyType>();
231
15
                                ++iter;
232
15
                                ++num_rows;
233
15
                            }
234
3
                        }
235
3
                        agg_method.insert_keys_into_columns(keys, key_columns, num_rows);
236
3
                        if (has_null_key) {
237
0
                            key_columns[0]->insert_data(nullptr, 0);
238
0
                        }
239
3
                        return key_columns;
240
3
                    }},
Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_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
6
                    [&](auto&& agg_method) -> vectorized::MutableColumns {
215
6
                        vectorized::MutableColumns key_columns;
216
12
                        for (int i = 0; i < probe_expr_ctxs.size(); ++i) {
217
6
                            key_columns.emplace_back(
218
6
                                    probe_expr_ctxs[i]->root()->data_type()->create_column());
219
6
                        }
220
6
                        auto& data = *agg_method.hash_table;
221
6
                        bool has_null_key = data.has_null_key_data();
222
6
                        const auto size = data.size() - has_null_key;
223
6
                        using KeyType = std::decay_t<decltype(agg_method)>::Key;
224
6
                        std::vector<KeyType> keys(size);
225
226
6
                        uint32_t num_rows = 0;
227
6
                        auto iter = aggregate_data_container->begin();
228
6
                        {
229
12
                            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
6
                        }
235
6
                        agg_method.insert_keys_into_columns(keys, key_columns, num_rows);
236
6
                        if (has_null_key) {
237
0
                            key_columns[0]->insert_data(nullptr, 0);
238
0
                        }
239
6
                        return key_columns;
240
6
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized15MethodOneNumberIm9PHHashMapImPc14HashMixWrapperIm9HashCRC32ImEEEEEEESt6vectorINS_3COWINS4_7IColumnEE11mutable_ptrISH_EESaISK_EEOT_
Line
Count
Source
214
5
                    [&](auto&& agg_method) -> vectorized::MutableColumns {
215
5
                        vectorized::MutableColumns key_columns;
216
10
                        for (int i = 0; i < probe_expr_ctxs.size(); ++i) {
217
5
                            key_columns.emplace_back(
218
5
                                    probe_expr_ctxs[i]->root()->data_type()->create_column());
219
5
                        }
220
5
                        auto& data = *agg_method.hash_table;
221
5
                        bool has_null_key = data.has_null_key_data();
222
5
                        const auto size = data.size() - has_null_key;
223
5
                        using KeyType = std::decay_t<decltype(agg_method)>::Key;
224
5
                        std::vector<KeyType> keys(size);
225
226
5
                        uint32_t num_rows = 0;
227
5
                        auto iter = aggregate_data_container->begin();
228
5
                        {
229
23
                            while (iter != aggregate_data_container->end()) {
230
18
                                keys[num_rows] = iter.get_key<KeyType>();
231
18
                                ++iter;
232
18
                                ++num_rows;
233
18
                            }
234
5
                        }
235
5
                        agg_method.insert_keys_into_columns(keys, key_columns, num_rows);
236
5
                        if (has_null_key) {
237
0
                            key_columns[0]->insert_data(nullptr, 0);
238
0
                        }
239
5
                        return key_columns;
240
5
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized26MethodSingleNullableColumnINS4_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
17
                            while (iter != aggregate_data_container->end()) {
230
15
                                keys[num_rows] = iter.get_key<KeyType>();
231
15
                                ++iter;
232
15
                                ++num_rows;
233
15
                            }
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
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
668
                            while (iter != aggregate_data_container->end()) {
230
666
                                keys[num_rows] = iter.get_key<KeyType>();
231
666
                                ++iter;
232
666
                                ++num_rows;
233
666
                            }
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
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberImNS4_15DataWithNullKeyI9PHHashMapImPc9HashCRC32ImEEEEEEEEEESt6vectorINS_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
1.86k
                            while (iter != aggregate_data_container->end()) {
230
1.85k
                                keys[num_rows] = iter.get_key<KeyType>();
231
1.85k
                                ++iter;
232
1.85k
                                ++num_rows;
233
1.85k
                            }
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
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberIjNS4_15DataWithNullKeyI9PHHashMapIjPc14HashMixWrapperIj9HashCRC32IjEEEEEEEEEEESt6vectorINS_3COWINS4_7IColumnEE11mutable_ptrISL_EESaISO_EEOT_
Line
Count
Source
214
5
                    [&](auto&& agg_method) -> vectorized::MutableColumns {
215
5
                        vectorized::MutableColumns key_columns;
216
10
                        for (int i = 0; i < probe_expr_ctxs.size(); ++i) {
217
5
                            key_columns.emplace_back(
218
5
                                    probe_expr_ctxs[i]->root()->data_type()->create_column());
219
5
                        }
220
5
                        auto& data = *agg_method.hash_table;
221
5
                        bool has_null_key = data.has_null_key_data();
222
5
                        const auto size = data.size() - has_null_key;
223
5
                        using KeyType = std::decay_t<decltype(agg_method)>::Key;
224
5
                        std::vector<KeyType> keys(size);
225
226
5
                        uint32_t num_rows = 0;
227
5
                        auto iter = aggregate_data_container->begin();
228
5
                        {
229
14
                            while (iter != aggregate_data_container->end()) {
230
9
                                keys[num_rows] = iter.get_key<KeyType>();
231
9
                                ++iter;
232
9
                                ++num_rows;
233
9
                            }
234
5
                        }
235
5
                        agg_method.insert_keys_into_columns(keys, key_columns, num_rows);
236
5
                        if (has_null_key) {
237
1
                            key_columns[0]->insert_data(nullptr, 0);
238
1
                        }
239
5
                        return key_columns;
240
5
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberImNS4_15DataWithNullKeyI9PHHashMapImPc14HashMixWrapperIm9HashCRC32ImEEEEEEEEEEESt6vectorINS_3COWINS4_7IColumnEE11mutable_ptrISL_EESaISO_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
21
                            while (iter != aggregate_data_container->end()) {
230
17
                                keys[num_rows] = iter.get_key<KeyType>();
231
17
                                ++iter;
232
17
                                ++num_rows;
233
17
                            }
234
4
                        }
235
4
                        agg_method.insert_keys_into_columns(keys, key_columns, num_rows);
236
4
                        if (has_null_key) {
237
1
                            key_columns[0]->insert_data(nullptr, 0);
238
1
                        }
239
4
                        return key_columns;
240
4
                    }},
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
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_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
12
                    [&](auto&& agg_method) -> vectorized::MutableColumns {
215
12
                        vectorized::MutableColumns key_columns;
216
46
                        for (int i = 0; i < probe_expr_ctxs.size(); ++i) {
217
34
                            key_columns.emplace_back(
218
34
                                    probe_expr_ctxs[i]->root()->data_type()->create_column());
219
34
                        }
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
1.92k
                            while (iter != aggregate_data_container->end()) {
230
1.91k
                                keys[num_rows] = iter.get_key<KeyType>();
231
1.91k
                                ++iter;
232
1.91k
                                ++num_rows;
233
1.91k
                            }
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
                    }},
Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized15MethodKeysFixedI9PHHashMapINS4_7UInt136EPc9HashCRC32IS7_EEEEEESt6vectorINS_3COWINS4_7IColumnEE11mutable_ptrISG_EESaISJ_EEOT_
241
45
            agg_data->method_variant);
242
45
}
243
244
45
void AggSharedState::build_limit_heap(size_t hash_table_size) {
245
45
    limit_columns = _get_keys_hash_table();
246
5.37k
    for (size_t i = 0; i < hash_table_size; ++i) {
247
5.33k
        limit_heap.emplace(i, limit_columns, order_directions, null_directions);
248
5.33k
    }
249
5.26k
    while (hash_table_size > limit) {
250
5.22k
        limit_heap.pop();
251
5.22k
        hash_table_size--;
252
5.22k
    }
253
45
    limit_columns_min = limit_heap.top()._row_id;
254
45
}
255
256
bool AggSharedState::do_limit_filter(vectorized::Block* block, size_t num_rows,
257
281
                                     const std::vector<int>* key_locs) {
258
281
    if (num_rows) {
259
281
        cmp_res.resize(num_rows);
260
281
        need_computes.resize(num_rows);
261
281
        memset(need_computes.data(), 0, need_computes.size());
262
281
        memset(cmp_res.data(), 0, cmp_res.size());
263
264
281
        const auto key_size = null_directions.size();
265
828
        for (int i = 0; i < key_size; i++) {
266
547
            block->get_by_position(key_locs ? key_locs->operator[](i) : i)
267
547
                    .column->compare_internal(limit_columns_min, *limit_columns[i],
268
547
                                              null_directions[i], order_directions[i], cmp_res,
269
547
                                              need_computes.data());
270
547
        }
271
272
281
        auto set_computes_arr = [](auto* __restrict res, auto* __restrict computes, size_t rows) {
273
768k
            for (size_t i = 0; i < rows; ++i) {
274
767k
                computes[i] = computes[i] == res[i];
275
767k
            }
276
281
        };
277
281
        set_computes_arr(cmp_res.data(), need_computes.data(), num_rows);
278
279
281
        return std::find(need_computes.begin(), need_computes.end(), 0) != need_computes.end();
280
281
    }
281
282
0
    return false;
283
281
}
284
285
29.0k
Status AggSharedState::reset_hash_table() {
286
29.0k
    return std::visit(
287
29.0k
            vectorized::Overload {
288
29.0k
                    [&](std::monostate& arg) -> Status {
289
0
                        return Status::InternalError("Uninited hash table");
290
0
                    },
291
29.0k
                    [&](auto& agg_method) {
292
29.0k
                        auto& hash_table = *agg_method.hash_table;
293
29.0k
                        using HashTableType = std::decay_t<decltype(hash_table)>;
294
295
29.0k
                        agg_method.arena.clear();
296
29.0k
                        agg_method.inited_iterator = false;
297
298
2.59M
                        hash_table.for_each_mapped([&](auto& mapped) {
299
2.59M
                            if (mapped) {
300
2.59M
                                static_cast<void>(_destroy_agg_status(mapped));
301
2.59M
                                mapped = nullptr;
302
2.59M
                            }
303
2.59M
                        });
dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized16MethodSerializedI9PHHashMapINS_9StringRefEPc11DefaultHashIS7_vEEEEEEDaRT_ENKUlSE_E_clIS8_EEDaSE_
Line
Count
Source
298
25.3k
                        hash_table.for_each_mapped([&](auto& mapped) {
299
25.3k
                            if (mapped) {
300
25.3k
                                static_cast<void>(_destroy_agg_status(mapped));
301
25.3k
                                mapped = nullptr;
302
25.3k
                            }
303
25.3k
                        });
dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodOneNumberIh9PHHashMapIhPc9HashCRC32IhEEEEEEDaRT_ENKUlSD_E_clIS7_EEDaSD_
Line
Count
Source
298
10
                        hash_table.for_each_mapped([&](auto& mapped) {
299
10
                            if (mapped) {
300
10
                                static_cast<void>(_destroy_agg_status(mapped));
301
10
                                mapped = nullptr;
302
10
                            }
303
10
                        });
Unexecuted instantiation: dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodOneNumberIt9PHHashMapItPc9HashCRC32ItEEEEEEDaRT_ENKUlSD_E_clIS7_EEDaSD_
dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodOneNumberIj9PHHashMapIjPc9HashCRC32IjEEEEEEDaRT_ENKUlSD_E_clIS7_EEDaSD_
Line
Count
Source
298
9.65k
                        hash_table.for_each_mapped([&](auto& mapped) {
299
9.65k
                            if (mapped) {
300
9.65k
                                static_cast<void>(_destroy_agg_status(mapped));
301
9.65k
                                mapped = nullptr;
302
9.65k
                            }
303
9.65k
                        });
Unexecuted instantiation: dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodOneNumberIm9PHHashMapImPc9HashCRC32ImEEEEEEDaRT_ENKUlSD_E_clIS7_EEDaSD_
dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized19MethodStringNoCacheINS_13StringHashMapIPcNS_9AllocatorILb1ELb1ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEEEEEDaRT_ENKUlSE_E_clIS7_EEDaSE_
Line
Count
Source
298
985
                        hash_table.for_each_mapped([&](auto& mapped) {
299
985
                            if (mapped) {
300
985
                                static_cast<void>(_destroy_agg_status(mapped));
301
985
                                mapped = nullptr;
302
985
                            }
303
985
                        });
Unexecuted instantiation: dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodOneNumberIN4wide7integerILm128EjEE9PHHashMapIS8_Pc9HashCRC32IS8_EEEEEEDaRT_ENKUlSG_E_clISA_EEDaSG_
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.75M
                        hash_table.for_each_mapped([&](auto& mapped) {
299
1.75M
                            if (mapped) {
300
1.75M
                                static_cast<void>(_destroy_agg_status(mapped));
301
1.75M
                                mapped = nullptr;
302
1.75M
                            }
303
1.75M
                        });
dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodOneNumberIm9PHHashMapImPc14HashMixWrapperIm9HashCRC32ImEEEEEEEDaRT_ENKUlSF_E_clIS7_EEDaSF_
Line
Count
Source
298
110k
                        hash_table.for_each_mapped([&](auto& mapped) {
299
110k
                            if (mapped) {
300
110k
                                static_cast<void>(_destroy_agg_status(mapped));
301
110k
                                mapped = nullptr;
302
110k
                            }
303
110k
                        });
dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberIhNS4_15DataWithNullKeyI9PHHashMapIhPc9HashCRC32IhEEEEEEEEEEDaRT_ENKUlSH_E_clIS9_EEDaSH_
Line
Count
Source
298
273
                        hash_table.for_each_mapped([&](auto& mapped) {
299
273
                            if (mapped) {
300
273
                                static_cast<void>(_destroy_agg_status(mapped));
301
273
                                mapped = nullptr;
302
273
                            }
303
273
                        });
dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberItNS4_15DataWithNullKeyI9PHHashMapItPc9HashCRC32ItEEEEEEEEEEDaRT_ENKUlSH_E_clIS9_EEDaSH_
Line
Count
Source
298
318
                        hash_table.for_each_mapped([&](auto& mapped) {
299
318
                            if (mapped) {
300
318
                                static_cast<void>(_destroy_agg_status(mapped));
301
318
                                mapped = nullptr;
302
318
                            }
303
318
                        });
dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberIjNS4_15DataWithNullKeyI9PHHashMapIjPc9HashCRC32IjEEEEEEEEEEDaRT_ENKUlSH_E_clIS9_EEDaSH_
Line
Count
Source
298
51.3k
                        hash_table.for_each_mapped([&](auto& mapped) {
299
51.3k
                            if (mapped) {
300
51.3k
                                static_cast<void>(_destroy_agg_status(mapped));
301
51.3k
                                mapped = nullptr;
302
51.3k
                            }
303
51.3k
                        });
dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberImNS4_15DataWithNullKeyI9PHHashMapImPc9HashCRC32ImEEEEEEEEEEDaRT_ENKUlSH_E_clIS9_EEDaSH_
Line
Count
Source
298
2.02k
                        hash_table.for_each_mapped([&](auto& mapped) {
299
2.02k
                            if (mapped) {
300
2.02k
                                static_cast<void>(_destroy_agg_status(mapped));
301
2.02k
                                mapped = nullptr;
302
2.02k
                            }
303
2.02k
                        });
dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberIjNS4_15DataWithNullKeyI9PHHashMapIjPc14HashMixWrapperIj9HashCRC32IjEEEEEEEEEEEDaRT_ENKUlSJ_E_clIS9_EEDaSJ_
Line
Count
Source
298
463k
                        hash_table.for_each_mapped([&](auto& mapped) {
299
463k
                            if (mapped) {
300
463k
                                static_cast<void>(_destroy_agg_status(mapped));
301
463k
                                mapped = nullptr;
302
463k
                            }
303
463k
                        });
dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberImNS4_15DataWithNullKeyI9PHHashMapImPc14HashMixWrapperIm9HashCRC32ImEEEEEEEEEEEDaRT_ENKUlSJ_E_clIS9_EEDaSJ_
Line
Count
Source
298
120k
                        hash_table.for_each_mapped([&](auto& mapped) {
299
121k
                            if (mapped) {
300
121k
                                static_cast<void>(_destroy_agg_status(mapped));
301
121k
                                mapped = nullptr;
302
121k
                            }
303
120k
                        });
dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberIN4wide7integerILm128EjEENS4_15DataWithNullKeyI9PHHashMapIS9_Pc9HashCRC32IS9_EEEEEEEEEEDaRT_ENKUlSK_E_clISC_EEDaSK_
Line
Count
Source
298
60
                        hash_table.for_each_mapped([&](auto& mapped) {
299
60
                            if (mapped) {
300
60
                                static_cast<void>(_destroy_agg_status(mapped));
301
60
                                mapped = nullptr;
302
60
                            }
303
60
                        });
dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberIN4wide7integerILm256EjEENS4_15DataWithNullKeyI9PHHashMapIS9_Pc9HashCRC32IS9_EEEEEEEEEEDaRT_ENKUlSK_E_clISC_EEDaSK_
Line
Count
Source
298
9
                        hash_table.for_each_mapped([&](auto& mapped) {
299
9
                            if (mapped) {
300
9
                                static_cast<void>(_destroy_agg_status(mapped));
301
9
                                mapped = nullptr;
302
9
                            }
303
9
                        });
dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_19MethodStringNoCacheINS4_15DataWithNullKeyINS_13StringHashMapIPcNS_9AllocatorILb1ELb1ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEEEEEEEEEDaRT_ENKUlSI_E_clIS9_EEDaSI_
Line
Count
Source
298
2.74k
                        hash_table.for_each_mapped([&](auto& mapped) {
299
2.74k
                            if (mapped) {
300
2.74k
                                static_cast<void>(_destroy_agg_status(mapped));
301
2.74k
                                mapped = nullptr;
302
2.74k
                            }
303
2.74k
                        });
dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodKeysFixedI9PHHashMapImPc9HashCRC32ImEEEEEEDaRT_ENKUlSD_E_clIS7_EEDaSD_
Line
Count
Source
298
212
                        hash_table.for_each_mapped([&](auto& mapped) {
299
212
                            if (mapped) {
300
212
                                static_cast<void>(_destroy_agg_status(mapped));
301
212
                                mapped = nullptr;
302
212
                            }
303
212
                        });
dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodKeysFixedI9PHHashMapIN4wide7integerILm128EjEEPc9HashCRC32IS9_EEEEEEDaRT_ENKUlSG_E_clISA_EEDaSG_
Line
Count
Source
298
47.2k
                        hash_table.for_each_mapped([&](auto& mapped) {
299
47.2k
                            if (mapped) {
300
47.2k
                                static_cast<void>(_destroy_agg_status(mapped));
301
47.2k
                                mapped = nullptr;
302
47.2k
                            }
303
47.2k
                        });
dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodKeysFixedI9PHHashMapIN4wide7integerILm256EjEEPc9HashCRC32IS9_EEEEEEDaRT_ENKUlSG_E_clISA_EEDaSG_
Line
Count
Source
298
407
                        hash_table.for_each_mapped([&](auto& mapped) {
299
407
                            if (mapped) {
300
407
                                static_cast<void>(_destroy_agg_status(mapped));
301
407
                                mapped = nullptr;
302
407
                            }
303
407
                        });
dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodKeysFixedI9PHHashMapINS4_7UInt136EPc9HashCRC32IS7_EEEEEEDaRT_ENKUlSE_E_clIS8_EEDaSE_
Line
Count
Source
298
2.45k
                        hash_table.for_each_mapped([&](auto& mapped) {
299
2.45k
                            if (mapped) {
300
2.45k
                                static_cast<void>(_destroy_agg_status(mapped));
301
2.45k
                                mapped = nullptr;
302
2.45k
                            }
303
2.45k
                        });
304
305
29.0k
                        if (hash_table.has_null_key_data()) {
306
26
                            auto st = _destroy_agg_status(hash_table.template get_null_key_data<
307
26
                                                          vectorized::AggregateDataPtr>());
308
26
                            RETURN_IF_ERROR(st);
309
26
                        }
310
311
29.0k
                        aggregate_data_container.reset(new AggregateDataContainer(
312
29.0k
                                sizeof(typename HashTableType::key_type),
313
29.0k
                                ((total_size_of_aggregate_states + align_aggregate_states - 1) /
314
29.0k
                                 align_aggregate_states) *
315
29.0k
                                        align_aggregate_states));
316
29.0k
                        agg_method.hash_table.reset(new HashTableType());
317
29.0k
                        return Status::OK();
318
29.0k
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized16MethodSerializedI9PHHashMapINS_9StringRefEPc11DefaultHashIS7_vEEEEEEDaRT_
Line
Count
Source
291
4.32k
                    [&](auto& agg_method) {
292
4.32k
                        auto& hash_table = *agg_method.hash_table;
293
4.32k
                        using HashTableType = std::decay_t<decltype(hash_table)>;
294
295
4.32k
                        agg_method.arena.clear();
296
4.32k
                        agg_method.inited_iterator = false;
297
298
4.32k
                        hash_table.for_each_mapped([&](auto& mapped) {
299
4.32k
                            if (mapped) {
300
4.32k
                                static_cast<void>(_destroy_agg_status(mapped));
301
4.32k
                                mapped = nullptr;
302
4.32k
                            }
303
4.32k
                        });
304
305
4.32k
                        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.32k
                        aggregate_data_container.reset(new AggregateDataContainer(
312
4.32k
                                sizeof(typename HashTableType::key_type),
313
4.32k
                                ((total_size_of_aggregate_states + align_aggregate_states - 1) /
314
4.32k
                                 align_aggregate_states) *
315
4.32k
                                        align_aggregate_states));
316
4.32k
                        agg_method.hash_table.reset(new HashTableType());
317
4.32k
                        return Status::OK();
318
4.32k
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodOneNumberIh9PHHashMapIhPc9HashCRC32IhEEEEEEDaRT_
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
                    }},
Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodOneNumberIt9PHHashMapItPc9HashCRC32ItEEEEEEDaRT_
dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodOneNumberIj9PHHashMapIjPc9HashCRC32IjEEEEEEDaRT_
Line
Count
Source
291
174
                    [&](auto& agg_method) {
292
174
                        auto& hash_table = *agg_method.hash_table;
293
174
                        using HashTableType = std::decay_t<decltype(hash_table)>;
294
295
174
                        agg_method.arena.clear();
296
174
                        agg_method.inited_iterator = false;
297
298
174
                        hash_table.for_each_mapped([&](auto& mapped) {
299
174
                            if (mapped) {
300
174
                                static_cast<void>(_destroy_agg_status(mapped));
301
174
                                mapped = nullptr;
302
174
                            }
303
174
                        });
304
305
174
                        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
174
                        aggregate_data_container.reset(new AggregateDataContainer(
312
174
                                sizeof(typename HashTableType::key_type),
313
174
                                ((total_size_of_aggregate_states + align_aggregate_states - 1) /
314
174
                                 align_aggregate_states) *
315
174
                                        align_aggregate_states));
316
174
                        agg_method.hash_table.reset(new HashTableType());
317
174
                        return Status::OK();
318
174
                    }},
Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodOneNumberIm9PHHashMapImPc9HashCRC32ImEEEEEEDaRT_
dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized19MethodStringNoCacheINS_13StringHashMapIPcNS_9AllocatorILb1ELb1ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEEEEEDaRT_
Line
Count
Source
291
325
                    [&](auto& agg_method) {
292
325
                        auto& hash_table = *agg_method.hash_table;
293
325
                        using HashTableType = std::decay_t<decltype(hash_table)>;
294
295
325
                        agg_method.arena.clear();
296
325
                        agg_method.inited_iterator = false;
297
298
325
                        hash_table.for_each_mapped([&](auto& mapped) {
299
325
                            if (mapped) {
300
325
                                static_cast<void>(_destroy_agg_status(mapped));
301
325
                                mapped = nullptr;
302
325
                            }
303
325
                        });
304
305
325
                        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
325
                        aggregate_data_container.reset(new AggregateDataContainer(
312
325
                                sizeof(typename HashTableType::key_type),
313
325
                                ((total_size_of_aggregate_states + align_aggregate_states - 1) /
314
325
                                 align_aggregate_states) *
315
325
                                        align_aggregate_states));
316
325
                        agg_method.hash_table.reset(new HashTableType());
317
325
                        return Status::OK();
318
325
                    }},
Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodOneNumberIN4wide7integerILm128EjEE9PHHashMapIS8_Pc9HashCRC32IS8_EEEEEEDaRT_
Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodOneNumberIN4wide7integerILm256EjEE9PHHashMapIS8_Pc9HashCRC32IS8_EEEEEEDaRT_
dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodOneNumberIj9PHHashMapIjPc14HashMixWrapperIj9HashCRC32IjEEEEEEEDaRT_
Line
Count
Source
291
9.05k
                    [&](auto& agg_method) {
292
9.05k
                        auto& hash_table = *agg_method.hash_table;
293
9.05k
                        using HashTableType = std::decay_t<decltype(hash_table)>;
294
295
9.05k
                        agg_method.arena.clear();
296
9.05k
                        agg_method.inited_iterator = false;
297
298
9.05k
                        hash_table.for_each_mapped([&](auto& mapped) {
299
9.05k
                            if (mapped) {
300
9.05k
                                static_cast<void>(_destroy_agg_status(mapped));
301
9.05k
                                mapped = nullptr;
302
9.05k
                            }
303
9.05k
                        });
304
305
9.05k
                        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.05k
                        aggregate_data_container.reset(new AggregateDataContainer(
312
9.05k
                                sizeof(typename HashTableType::key_type),
313
9.05k
                                ((total_size_of_aggregate_states + align_aggregate_states - 1) /
314
9.05k
                                 align_aggregate_states) *
315
9.05k
                                        align_aggregate_states));
316
9.05k
                        agg_method.hash_table.reset(new HashTableType());
317
9.05k
                        return Status::OK();
318
9.05k
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodOneNumberIm9PHHashMapImPc14HashMixWrapperIm9HashCRC32ImEEEEEEEDaRT_
Line
Count
Source
291
477
                    [&](auto& agg_method) {
292
477
                        auto& hash_table = *agg_method.hash_table;
293
477
                        using HashTableType = std::decay_t<decltype(hash_table)>;
294
295
477
                        agg_method.arena.clear();
296
477
                        agg_method.inited_iterator = false;
297
298
477
                        hash_table.for_each_mapped([&](auto& mapped) {
299
477
                            if (mapped) {
300
477
                                static_cast<void>(_destroy_agg_status(mapped));
301
477
                                mapped = nullptr;
302
477
                            }
303
477
                        });
304
305
477
                        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
477
                        aggregate_data_container.reset(new AggregateDataContainer(
312
477
                                sizeof(typename HashTableType::key_type),
313
477
                                ((total_size_of_aggregate_states + align_aggregate_states - 1) /
314
477
                                 align_aggregate_states) *
315
477
                                        align_aggregate_states));
316
477
                        agg_method.hash_table.reset(new HashTableType());
317
477
                        return Status::OK();
318
477
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberIhNS4_15DataWithNullKeyI9PHHashMapIhPc9HashCRC32IhEEEEEEEEEEDaRT_
Line
Count
Source
291
255
                    [&](auto& agg_method) {
292
255
                        auto& hash_table = *agg_method.hash_table;
293
255
                        using HashTableType = std::decay_t<decltype(hash_table)>;
294
295
255
                        agg_method.arena.clear();
296
255
                        agg_method.inited_iterator = false;
297
298
255
                        hash_table.for_each_mapped([&](auto& mapped) {
299
255
                            if (mapped) {
300
255
                                static_cast<void>(_destroy_agg_status(mapped));
301
255
                                mapped = nullptr;
302
255
                            }
303
255
                        });
304
305
255
                        if (hash_table.has_null_key_data()) {
306
1
                            auto st = _destroy_agg_status(hash_table.template get_null_key_data<
307
1
                                                          vectorized::AggregateDataPtr>());
308
1
                            RETURN_IF_ERROR(st);
309
1
                        }
310
311
255
                        aggregate_data_container.reset(new AggregateDataContainer(
312
255
                                sizeof(typename HashTableType::key_type),
313
255
                                ((total_size_of_aggregate_states + align_aggregate_states - 1) /
314
255
                                 align_aggregate_states) *
315
255
                                        align_aggregate_states));
316
255
                        agg_method.hash_table.reset(new HashTableType());
317
255
                        return Status::OK();
318
255
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberItNS4_15DataWithNullKeyI9PHHashMapItPc9HashCRC32ItEEEEEEEEEEDaRT_
Line
Count
Source
291
322
                    [&](auto& agg_method) {
292
322
                        auto& hash_table = *agg_method.hash_table;
293
322
                        using HashTableType = std::decay_t<decltype(hash_table)>;
294
295
322
                        agg_method.arena.clear();
296
322
                        agg_method.inited_iterator = false;
297
298
322
                        hash_table.for_each_mapped([&](auto& mapped) {
299
322
                            if (mapped) {
300
322
                                static_cast<void>(_destroy_agg_status(mapped));
301
322
                                mapped = nullptr;
302
322
                            }
303
322
                        });
304
305
322
                        if (hash_table.has_null_key_data()) {
306
9
                            auto st = _destroy_agg_status(hash_table.template get_null_key_data<
307
9
                                                          vectorized::AggregateDataPtr>());
308
9
                            RETURN_IF_ERROR(st);
309
9
                        }
310
311
322
                        aggregate_data_container.reset(new AggregateDataContainer(
312
322
                                sizeof(typename HashTableType::key_type),
313
322
                                ((total_size_of_aggregate_states + align_aggregate_states - 1) /
314
322
                                 align_aggregate_states) *
315
322
                                        align_aggregate_states));
316
322
                        agg_method.hash_table.reset(new HashTableType());
317
322
                        return Status::OK();
318
322
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberIjNS4_15DataWithNullKeyI9PHHashMapIjPc9HashCRC32IjEEEEEEEEEEDaRT_
Line
Count
Source
291
547
                    [&](auto& agg_method) {
292
547
                        auto& hash_table = *agg_method.hash_table;
293
547
                        using HashTableType = std::decay_t<decltype(hash_table)>;
294
295
547
                        agg_method.arena.clear();
296
547
                        agg_method.inited_iterator = false;
297
298
547
                        hash_table.for_each_mapped([&](auto& mapped) {
299
547
                            if (mapped) {
300
547
                                static_cast<void>(_destroy_agg_status(mapped));
301
547
                                mapped = nullptr;
302
547
                            }
303
547
                        });
304
305
547
                        if (hash_table.has_null_key_data()) {
306
3
                            auto st = _destroy_agg_status(hash_table.template get_null_key_data<
307
3
                                                          vectorized::AggregateDataPtr>());
308
3
                            RETURN_IF_ERROR(st);
309
3
                        }
310
311
547
                        aggregate_data_container.reset(new AggregateDataContainer(
312
547
                                sizeof(typename HashTableType::key_type),
313
547
                                ((total_size_of_aggregate_states + align_aggregate_states - 1) /
314
547
                                 align_aggregate_states) *
315
547
                                        align_aggregate_states));
316
547
                        agg_method.hash_table.reset(new HashTableType());
317
547
                        return Status::OK();
318
547
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberImNS4_15DataWithNullKeyI9PHHashMapImPc9HashCRC32ImEEEEEEEEEEDaRT_
Line
Count
Source
291
201
                    [&](auto& agg_method) {
292
201
                        auto& hash_table = *agg_method.hash_table;
293
201
                        using HashTableType = std::decay_t<decltype(hash_table)>;
294
295
201
                        agg_method.arena.clear();
296
201
                        agg_method.inited_iterator = false;
297
298
201
                        hash_table.for_each_mapped([&](auto& mapped) {
299
201
                            if (mapped) {
300
201
                                static_cast<void>(_destroy_agg_status(mapped));
301
201
                                mapped = nullptr;
302
201
                            }
303
201
                        });
304
305
201
                        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
201
                        aggregate_data_container.reset(new AggregateDataContainer(
312
201
                                sizeof(typename HashTableType::key_type),
313
201
                                ((total_size_of_aggregate_states + align_aggregate_states - 1) /
314
201
                                 align_aggregate_states) *
315
201
                                        align_aggregate_states));
316
201
                        agg_method.hash_table.reset(new HashTableType());
317
201
                        return Status::OK();
318
201
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberIjNS4_15DataWithNullKeyI9PHHashMapIjPc14HashMixWrapperIj9HashCRC32IjEEEEEEEEEEEDaRT_
Line
Count
Source
291
2.55k
                    [&](auto& agg_method) {
292
2.55k
                        auto& hash_table = *agg_method.hash_table;
293
2.55k
                        using HashTableType = std::decay_t<decltype(hash_table)>;
294
295
2.55k
                        agg_method.arena.clear();
296
2.55k
                        agg_method.inited_iterator = false;
297
298
2.55k
                        hash_table.for_each_mapped([&](auto& mapped) {
299
2.55k
                            if (mapped) {
300
2.55k
                                static_cast<void>(_destroy_agg_status(mapped));
301
2.55k
                                mapped = nullptr;
302
2.55k
                            }
303
2.55k
                        });
304
305
2.55k
                        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
2.55k
                        aggregate_data_container.reset(new AggregateDataContainer(
312
2.55k
                                sizeof(typename HashTableType::key_type),
313
2.55k
                                ((total_size_of_aggregate_states + align_aggregate_states - 1) /
314
2.55k
                                 align_aggregate_states) *
315
2.55k
                                        align_aggregate_states));
316
2.55k
                        agg_method.hash_table.reset(new HashTableType());
317
2.55k
                        return Status::OK();
318
2.55k
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberImNS4_15DataWithNullKeyI9PHHashMapImPc14HashMixWrapperIm9HashCRC32ImEEEEEEEEEEEDaRT_
Line
Count
Source
291
1.72k
                    [&](auto& agg_method) {
292
1.72k
                        auto& hash_table = *agg_method.hash_table;
293
1.72k
                        using HashTableType = std::decay_t<decltype(hash_table)>;
294
295
1.72k
                        agg_method.arena.clear();
296
1.72k
                        agg_method.inited_iterator = false;
297
298
1.72k
                        hash_table.for_each_mapped([&](auto& mapped) {
299
1.72k
                            if (mapped) {
300
1.72k
                                static_cast<void>(_destroy_agg_status(mapped));
301
1.72k
                                mapped = nullptr;
302
1.72k
                            }
303
1.72k
                        });
304
305
1.72k
                        if (hash_table.has_null_key_data()) {
306
5
                            auto st = _destroy_agg_status(hash_table.template get_null_key_data<
307
5
                                                          vectorized::AggregateDataPtr>());
308
5
                            RETURN_IF_ERROR(st);
309
5
                        }
310
311
1.72k
                        aggregate_data_container.reset(new AggregateDataContainer(
312
1.72k
                                sizeof(typename HashTableType::key_type),
313
1.72k
                                ((total_size_of_aggregate_states + align_aggregate_states - 1) /
314
1.72k
                                 align_aggregate_states) *
315
1.72k
                                        align_aggregate_states));
316
1.72k
                        agg_method.hash_table.reset(new HashTableType());
317
1.72k
                        return Status::OK();
318
1.72k
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberIN4wide7integerILm128EjEENS4_15DataWithNullKeyI9PHHashMapIS9_Pc9HashCRC32IS9_EEEEEEEEEEDaRT_
Line
Count
Source
291
40
                    [&](auto& agg_method) {
292
40
                        auto& hash_table = *agg_method.hash_table;
293
40
                        using HashTableType = std::decay_t<decltype(hash_table)>;
294
295
40
                        agg_method.arena.clear();
296
40
                        agg_method.inited_iterator = false;
297
298
40
                        hash_table.for_each_mapped([&](auto& mapped) {
299
40
                            if (mapped) {
300
40
                                static_cast<void>(_destroy_agg_status(mapped));
301
40
                                mapped = nullptr;
302
40
                            }
303
40
                        });
304
305
40
                        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
40
                        aggregate_data_container.reset(new AggregateDataContainer(
312
40
                                sizeof(typename HashTableType::key_type),
313
40
                                ((total_size_of_aggregate_states + align_aggregate_states - 1) /
314
40
                                 align_aggregate_states) *
315
40
                                        align_aggregate_states));
316
40
                        agg_method.hash_table.reset(new HashTableType());
317
40
                        return Status::OK();
318
40
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberIN4wide7integerILm256EjEENS4_15DataWithNullKeyI9PHHashMapIS9_Pc9HashCRC32IS9_EEEEEEEEEEDaRT_
Line
Count
Source
291
12
                    [&](auto& agg_method) {
292
12
                        auto& hash_table = *agg_method.hash_table;
293
12
                        using HashTableType = std::decay_t<decltype(hash_table)>;
294
295
12
                        agg_method.arena.clear();
296
12
                        agg_method.inited_iterator = false;
297
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
                        });
304
305
12
                        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
12
                        aggregate_data_container.reset(new AggregateDataContainer(
312
12
                                sizeof(typename HashTableType::key_type),
313
12
                                ((total_size_of_aggregate_states + align_aggregate_states - 1) /
314
12
                                 align_aggregate_states) *
315
12
                                        align_aggregate_states));
316
12
                        agg_method.hash_table.reset(new HashTableType());
317
12
                        return Status::OK();
318
12
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_19MethodStringNoCacheINS4_15DataWithNullKeyINS_13StringHashMapIPcNS_9AllocatorILb1ELb1ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEEEEEEEEEDaRT_
Line
Count
Source
291
969
                    [&](auto& agg_method) {
292
969
                        auto& hash_table = *agg_method.hash_table;
293
969
                        using HashTableType = std::decay_t<decltype(hash_table)>;
294
295
969
                        agg_method.arena.clear();
296
969
                        agg_method.inited_iterator = false;
297
298
969
                        hash_table.for_each_mapped([&](auto& mapped) {
299
969
                            if (mapped) {
300
969
                                static_cast<void>(_destroy_agg_status(mapped));
301
969
                                mapped = nullptr;
302
969
                            }
303
969
                        });
304
305
969
                        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
969
                        aggregate_data_container.reset(new AggregateDataContainer(
312
969
                                sizeof(typename HashTableType::key_type),
313
969
                                ((total_size_of_aggregate_states + align_aggregate_states - 1) /
314
969
                                 align_aggregate_states) *
315
969
                                        align_aggregate_states));
316
969
                        agg_method.hash_table.reset(new HashTableType());
317
969
                        return Status::OK();
318
969
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodKeysFixedI9PHHashMapImPc9HashCRC32ImEEEEEEDaRT_
Line
Count
Source
291
249
                    [&](auto& agg_method) {
292
249
                        auto& hash_table = *agg_method.hash_table;
293
249
                        using HashTableType = std::decay_t<decltype(hash_table)>;
294
295
249
                        agg_method.arena.clear();
296
249
                        agg_method.inited_iterator = false;
297
298
249
                        hash_table.for_each_mapped([&](auto& mapped) {
299
249
                            if (mapped) {
300
249
                                static_cast<void>(_destroy_agg_status(mapped));
301
249
                                mapped = nullptr;
302
249
                            }
303
249
                        });
304
305
249
                        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
249
                        aggregate_data_container.reset(new AggregateDataContainer(
312
249
                                sizeof(typename HashTableType::key_type),
313
249
                                ((total_size_of_aggregate_states + align_aggregate_states - 1) /
314
249
                                 align_aggregate_states) *
315
249
                                        align_aggregate_states));
316
249
                        agg_method.hash_table.reset(new HashTableType());
317
249
                        return Status::OK();
318
249
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodKeysFixedI9PHHashMapIN4wide7integerILm128EjEEPc9HashCRC32IS9_EEEEEEDaRT_
Line
Count
Source
291
5.05k
                    [&](auto& agg_method) {
292
5.05k
                        auto& hash_table = *agg_method.hash_table;
293
5.05k
                        using HashTableType = std::decay_t<decltype(hash_table)>;
294
295
5.05k
                        agg_method.arena.clear();
296
5.05k
                        agg_method.inited_iterator = false;
297
298
5.05k
                        hash_table.for_each_mapped([&](auto& mapped) {
299
5.05k
                            if (mapped) {
300
5.05k
                                static_cast<void>(_destroy_agg_status(mapped));
301
5.05k
                                mapped = nullptr;
302
5.05k
                            }
303
5.05k
                        });
304
305
5.05k
                        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
5.05k
                        aggregate_data_container.reset(new AggregateDataContainer(
312
5.05k
                                sizeof(typename HashTableType::key_type),
313
5.05k
                                ((total_size_of_aggregate_states + align_aggregate_states - 1) /
314
5.05k
                                 align_aggregate_states) *
315
5.05k
                                        align_aggregate_states));
316
5.05k
                        agg_method.hash_table.reset(new HashTableType());
317
5.05k
                        return Status::OK();
318
5.05k
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodKeysFixedI9PHHashMapIN4wide7integerILm256EjEEPc9HashCRC32IS9_EEEEEEDaRT_
Line
Count
Source
291
401
                    [&](auto& agg_method) {
292
401
                        auto& hash_table = *agg_method.hash_table;
293
401
                        using HashTableType = std::decay_t<decltype(hash_table)>;
294
295
401
                        agg_method.arena.clear();
296
401
                        agg_method.inited_iterator = false;
297
298
401
                        hash_table.for_each_mapped([&](auto& mapped) {
299
401
                            if (mapped) {
300
401
                                static_cast<void>(_destroy_agg_status(mapped));
301
401
                                mapped = nullptr;
302
401
                            }
303
401
                        });
304
305
401
                        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
401
                        aggregate_data_container.reset(new AggregateDataContainer(
312
401
                                sizeof(typename HashTableType::key_type),
313
401
                                ((total_size_of_aggregate_states + align_aggregate_states - 1) /
314
401
                                 align_aggregate_states) *
315
401
                                        align_aggregate_states));
316
401
                        agg_method.hash_table.reset(new HashTableType());
317
401
                        return Status::OK();
318
401
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodKeysFixedI9PHHashMapINS4_7UInt136EPc9HashCRC32IS7_EEEEEEDaRT_
Line
Count
Source
291
2.35k
                    [&](auto& agg_method) {
292
2.35k
                        auto& hash_table = *agg_method.hash_table;
293
2.35k
                        using HashTableType = std::decay_t<decltype(hash_table)>;
294
295
2.35k
                        agg_method.arena.clear();
296
2.35k
                        agg_method.inited_iterator = false;
297
298
2.35k
                        hash_table.for_each_mapped([&](auto& mapped) {
299
2.35k
                            if (mapped) {
300
2.35k
                                static_cast<void>(_destroy_agg_status(mapped));
301
2.35k
                                mapped = nullptr;
302
2.35k
                            }
303
2.35k
                        });
304
305
2.35k
                        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.35k
                        aggregate_data_container.reset(new AggregateDataContainer(
312
2.35k
                                sizeof(typename HashTableType::key_type),
313
2.35k
                                ((total_size_of_aggregate_states + align_aggregate_states - 1) /
314
2.35k
                                 align_aggregate_states) *
315
2.35k
                                        align_aggregate_states));
316
2.35k
                        agg_method.hash_table.reset(new HashTableType());
317
2.35k
                        return Status::OK();
318
2.35k
                    }},
319
29.0k
            agg_data->method_variant);
320
29.0k
}
321
322
37.6k
void PartitionedAggSharedState::init_spill_params(size_t spill_partition_count) {
323
37.6k
    partition_count = spill_partition_count;
324
37.6k
    max_partition_index = partition_count - 1;
325
326
1.25M
    for (int i = 0; i < partition_count; ++i) {
327
1.21M
        spill_partitions.emplace_back(std::make_shared<AggSpillPartition>());
328
1.21M
    }
329
37.6k
}
330
331
37.8k
void PartitionedAggSharedState::update_spill_stream_profiles(RuntimeProfile* source_profile) {
332
1.20M
    for (auto& partition : spill_partitions) {
333
1.20M
        if (partition->spilling_stream_) {
334
0
            partition->spilling_stream_->update_shared_profiles(source_profile);
335
0
        }
336
1.20M
        for (auto& stream : partition->spill_streams_) {
337
17.7k
            if (stream) {
338
17.7k
                stream->update_shared_profiles(source_profile);
339
17.7k
            }
340
17.7k
        }
341
1.20M
    }
342
37.8k
}
343
344
Status AggSpillPartition::get_spill_stream(RuntimeState* state, int node_id,
345
                                           RuntimeProfile* profile,
346
88.3k
                                           vectorized::SpillStreamSPtr& spill_stream) {
347
88.3k
    if (spilling_stream_) {
348
71.2k
        spill_stream = spilling_stream_;
349
71.2k
        return Status::OK();
350
71.2k
    }
351
17.1k
    RETURN_IF_ERROR(ExecEnv::GetInstance()->spill_stream_mgr()->register_spill_stream(
352
17.1k
            state, spilling_stream_, print_id(state->query_id()), "agg", node_id,
353
17.1k
            std::numeric_limits<int32_t>::max(), std::numeric_limits<size_t>::max(), profile));
354
17.1k
    spill_streams_.emplace_back(spilling_stream_);
355
17.1k
    spill_stream = spilling_stream_;
356
17.1k
    return Status::OK();
357
17.1k
}
358
1.10M
void AggSpillPartition::close() {
359
1.10M
    if (spilling_stream_) {
360
1
        spilling_stream_.reset();
361
1
    }
362
1.10M
    for (auto& stream : spill_streams_) {
363
5
        (void)ExecEnv::GetInstance()->spill_stream_mgr()->delete_spill_stream(stream);
364
5
    }
365
1.10M
    spill_streams_.clear();
366
1.10M
}
367
368
39.8k
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
39.8k
    bool false_close = false;
372
39.8k
    if (!is_closed.compare_exchange_strong(false_close, true)) {
373
2.39k
        return;
374
2.39k
    }
375
39.8k
    DCHECK(!false_close && is_closed);
376
1.11M
    for (auto partition : spill_partitions) {
377
1.11M
        partition->close();
378
1.11M
    }
379
37.4k
    spill_partitions.clear();
380
37.4k
}
381
382
206k
void SpillSortSharedState::update_spill_stream_profiles(RuntimeProfile* source_profile) {
383
206k
    for (auto& stream : sorted_streams) {
384
318
        if (stream) {
385
318
            stream->update_shared_profiles(source_profile);
386
318
        }
387
318
    }
388
206k
}
389
390
203k
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
203k
    bool false_close = false;
394
203k
    if (!is_closed.compare_exchange_strong(false_close, true)) {
395
1
        return;
396
1
    }
397
203k
    DCHECK(!false_close && is_closed);
398
203k
    for (auto& stream : sorted_streams) {
399
1
        (void)ExecEnv::GetInstance()->spill_stream_mgr()->delete_spill_stream(stream);
400
1
    }
401
203k
    sorted_streams.clear();
402
203k
}
403
404
MultiCastSharedState::MultiCastSharedState(ObjectPool* pool, int cast_sender_count, int node_id)
405
2.54k
        : multi_cast_data_streamer(std::make_unique<pipeline::MultiCastDataStreamer>(
406
2.54k
                  pool, cast_sender_count, node_id)) {}
407
408
0
void MultiCastSharedState::update_spill_stream_profiles(RuntimeProfile* source_profile) {}
409
410
133k
int AggSharedState::get_slot_column_id(const vectorized::AggFnEvaluator* evaluator) {
411
133k
    auto ctxs = evaluator->input_exprs_ctxs();
412
18.4E
    CHECK(ctxs.size() == 1 && ctxs[0]->root()->is_slot_ref())
413
18.4E
            << "input_exprs_ctxs is invalid, input_exprs_ctx[0]="
414
18.4E
            << ctxs[0]->root()->debug_string();
415
133k
    return ((vectorized::VSlotRef*)ctxs[0]->root().get())->column_id();
416
133k
}
417
418
5.02M
Status AggSharedState::_destroy_agg_status(vectorized::AggregateDataPtr data) {
419
12.3M
    for (int i = 0; i < aggregate_evaluators.size(); ++i) {
420
7.31M
        aggregate_evaluators[i]->function()->destroy(data + offsets_of_aggregate_states[i]);
421
7.31M
    }
422
5.02M
    return Status::OK();
423
5.02M
}
424
425
216k
LocalExchangeSharedState::~LocalExchangeSharedState() = default;
426
427
902
Status SetSharedState::update_build_not_ignore_null(const vectorized::VExprContextSPtrs& ctxs) {
428
902
    if (ctxs.size() > build_not_ignore_null.size()) {
429
0
        return Status::InternalError("build_not_ignore_null not initialized");
430
0
    }
431
432
2.10k
    for (int i = 0; i < ctxs.size(); ++i) {
433
1.20k
        build_not_ignore_null[i] = build_not_ignore_null[i] || ctxs[i]->root()->is_nullable();
434
1.20k
    }
435
436
902
    return Status::OK();
437
902
}
438
439
894
size_t SetSharedState::get_hash_table_size() const {
440
894
    size_t hash_table_size = 0;
441
894
    std::visit(
442
895
            [&](auto&& arg) {
443
895
                using HashTableCtxType = std::decay_t<decltype(arg)>;
444
895
                if constexpr (!std::is_same_v<HashTableCtxType, std::monostate>) {
445
895
                    hash_table_size = arg.hash_table->size();
446
895
                }
447
895
            },
Unexecuted instantiation: dependency.cpp:_ZZNK5doris8pipeline14SetSharedState19get_hash_table_sizeEvENK3$_0clIRSt9monostateEEDaOT_
dependency.cpp:_ZZNK5doris8pipeline14SetSharedState19get_hash_table_sizeEvENK3$_0clIRNS_10vectorized16MethodSerializedI9PHHashMapINS_9StringRefENS_14RowRefWithFlagE11DefaultHashIS7_vEEEEEEDaOT_
Line
Count
Source
442
180
            [&](auto&& arg) {
443
180
                using HashTableCtxType = std::decay_t<decltype(arg)>;
444
180
                if constexpr (!std::is_same_v<HashTableCtxType, std::monostate>) {
445
180
                    hash_table_size = arg.hash_table->size();
446
180
                }
447
180
            },
dependency.cpp:_ZZNK5doris8pipeline14SetSharedState19get_hash_table_sizeEvENK3$_0clIRNS_10vectorized19MethodStringNoCacheI9PHHashMapINS_9StringRefENS_14RowRefWithFlagE11DefaultHashIS7_vEEEEEEDaOT_
Line
Count
Source
442
144
            [&](auto&& arg) {
443
144
                using HashTableCtxType = std::decay_t<decltype(arg)>;
444
144
                if constexpr (!std::is_same_v<HashTableCtxType, std::monostate>) {
445
144
                    hash_table_size = arg.hash_table->size();
446
144
                }
447
144
            },
dependency.cpp:_ZZNK5doris8pipeline14SetSharedState19get_hash_table_sizeEvENK3$_0clIRNS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberIhNS4_15DataWithNullKeyI9PHHashMapIhNS_14RowRefWithFlagE9HashCRC32IhEEEEEEEEEEDaOT_
Line
Count
Source
442
34
            [&](auto&& arg) {
443
34
                using HashTableCtxType = std::decay_t<decltype(arg)>;
444
34
                if constexpr (!std::is_same_v<HashTableCtxType, std::monostate>) {
445
34
                    hash_table_size = arg.hash_table->size();
446
34
                }
447
34
            },
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
318
            [&](auto&& arg) {
443
318
                using HashTableCtxType = std::decay_t<decltype(arg)>;
444
318
                if constexpr (!std::is_same_v<HashTableCtxType, std::monostate>) {
445
318
                    hash_table_size = arg.hash_table->size();
446
318
                }
447
318
            },
dependency.cpp:_ZZNK5doris8pipeline14SetSharedState19get_hash_table_sizeEvENK3$_0clIRNS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberImNS4_15DataWithNullKeyI9PHHashMapImNS_14RowRefWithFlagE9HashCRC32ImEEEEEEEEEEDaOT_
Line
Count
Source
442
50
            [&](auto&& arg) {
443
50
                using HashTableCtxType = std::decay_t<decltype(arg)>;
444
50
                if constexpr (!std::is_same_v<HashTableCtxType, std::monostate>) {
445
50
                    hash_table_size = arg.hash_table->size();
446
50
                }
447
50
            },
dependency.cpp:_ZZNK5doris8pipeline14SetSharedState19get_hash_table_sizeEvENK3$_0clIRNS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberIN4wide7integerILm128EjEENS4_15DataWithNullKeyI9PHHashMapIS9_NS_14RowRefWithFlagE9HashCRC32IS9_EEEEEEEEEEDaOT_
Line
Count
Source
442
56
            [&](auto&& arg) {
443
56
                using HashTableCtxType = std::decay_t<decltype(arg)>;
444
56
                if constexpr (!std::is_same_v<HashTableCtxType, std::monostate>) {
445
56
                    hash_table_size = arg.hash_table->size();
446
56
                }
447
56
            },
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
24
            [&](auto&& arg) {
443
24
                using HashTableCtxType = std::decay_t<decltype(arg)>;
444
24
                if constexpr (!std::is_same_v<HashTableCtxType, std::monostate>) {
445
24
                    hash_table_size = arg.hash_table->size();
446
24
                }
447
24
            },
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
20
            [&](auto&& arg) {
443
20
                using HashTableCtxType = std::decay_t<decltype(arg)>;
444
20
                if constexpr (!std::is_same_v<HashTableCtxType, std::monostate>) {
445
20
                    hash_table_size = arg.hash_table->size();
446
20
                }
447
20
            },
dependency.cpp:_ZZNK5doris8pipeline14SetSharedState19get_hash_table_sizeEvENK3$_0clIRNS_10vectorized15MethodKeysFixedI9PHHashMapIN4wide7integerILm128EjEENS_14RowRefWithFlagE9HashCRC32IS9_EEEEEEDaOT_
Line
Count
Source
442
26
            [&](auto&& arg) {
443
26
                using HashTableCtxType = std::decay_t<decltype(arg)>;
444
26
                if constexpr (!std::is_same_v<HashTableCtxType, std::monostate>) {
445
26
                    hash_table_size = arg.hash_table->size();
446
26
                }
447
26
            },
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
894
            hash_table_variants->method_variant);
449
894
    return hash_table_size;
450
894
}
451
452
384
Status SetSharedState::hash_table_init() {
453
384
    std::vector<vectorized::DataTypePtr> data_types;
454
919
    for (size_t i = 0; i != child_exprs_lists[0].size(); ++i) {
455
535
        auto& ctx = child_exprs_lists[0][i];
456
535
        auto data_type = ctx->root()->data_type();
457
535
        if (build_not_ignore_null[i]) {
458
391
            data_type = vectorized::make_nullable(data_type);
459
391
        }
460
535
        data_types.emplace_back(std::move(data_type));
461
535
    }
462
384
    return init_hash_method<SetDataVariants>(hash_table_variants.get(), data_types, true);
463
384
}
464
465
void AggSharedState::refresh_top_limit(size_t row_id,
466
48
                                       const vectorized::ColumnRawPtrs& key_columns) {
467
141
    for (int j = 0; j < key_columns.size(); ++j) {
468
93
        limit_columns[j]->insert_from(*key_columns[j], row_id);
469
93
    }
470
48
    limit_heap.emplace(limit_columns[0]->size() - 1, limit_columns, order_directions,
471
48
                       null_directions);
472
473
48
    limit_heap.pop();
474
48
    limit_columns_min = limit_heap.top()._row_id;
475
48
}
476
477
} // namespace doris::pipeline