Coverage Report

Created: 2025-05-19 15:26

/root/doris/be/src/pipeline/dependency.cpp
Line
Count
Source (jump to first uncovered line)
1
// Licensed to the Apache Software Foundation (ASF) under one
2
// or more contributor license agreements.  See the NOTICE file
3
// distributed with this work for additional information
4
// regarding copyright ownership.  The ASF licenses this file
5
// to you under the Apache License, Version 2.0 (the
6
// "License"); you may not use this file except in compliance
7
// with the License.  You may obtain a copy of the License at
8
//
9
//   http://www.apache.org/licenses/LICENSE-2.0
10
//
11
// Unless required by applicable law or agreed to in writing,
12
// software distributed under the License is distributed on an
13
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
// KIND, either express or implied.  See the License for the
15
// specific language governing permissions and limitations
16
// under the License.
17
18
#include "dependency.h"
19
20
#include <memory>
21
#include <mutex>
22
23
#include "common/logging.h"
24
#include "pipeline/exec/multi_cast_data_streamer.h"
25
#include "pipeline/pipeline_fragment_context.h"
26
#include "pipeline/pipeline_task.h"
27
#include "runtime/exec_env.h"
28
#include "runtime/memory/mem_tracker.h"
29
#include "runtime_filter/runtime_filter_consumer.h"
30
#include "vec/exprs/vectorized_agg_fn.h"
31
#include "vec/exprs/vslot_ref.h"
32
#include "vec/spill/spill_stream_manager.h"
33
34
namespace doris::pipeline {
35
#include "common/compile_check_begin.h"
36
37
Dependency* BasicSharedState::create_source_dependency(int operator_id, int node_id,
38
656k
                                                       const std::string& name) {
39
656k
    source_deps.push_back(std::make_shared<Dependency>(operator_id, node_id, name + "_DEPENDENCY"));
40
656k
    source_deps.back()->set_shared_state(this);
41
656k
    return source_deps.back().get();
42
656k
}
43
44
void BasicSharedState::create_source_dependencies(int num_sources, int operator_id, int node_id,
45
58.0k
                                                  const std::string& name) {
46
58.0k
    source_deps.resize(num_sources, nullptr);
47
359k
    for (auto& source_dep : source_deps) {
48
359k
        source_dep = std::make_shared<Dependency>(operator_id, node_id, name + "_DEPENDENCY");
49
359k
        source_dep->set_shared_state(this);
50
359k
    }
51
58.0k
}
52
53
Dependency* BasicSharedState::create_sink_dependency(int dest_id, int node_id,
54
901k
                                                     const std::string& name) {
55
901k
    sink_deps.push_back(std::make_shared<Dependency>(dest_id, node_id, name + "_DEPENDENCY", true));
56
901k
    sink_deps.back()->set_shared_state(this);
57
901k
    return sink_deps.back().get();
58
901k
}
59
60
4.07M
void Dependency::_add_block_task(std::shared_ptr<PipelineTask> task) {
61
18.4E
    DCHECK(_blocked_task.empty() || _blocked_task[_blocked_task.size() - 1].lock() == nullptr ||
62
18.4E
           _blocked_task[_blocked_task.size() - 1].lock().get() != task.get())
63
18.4E
            << "Duplicate task: " << task->debug_string();
64
4.07M
    _blocked_task.push_back(task);
65
4.07M
}
66
67
856M
void Dependency::set_ready() {
68
856M
    if (_ready) {
69
814M
        return;
70
814M
    }
71
42.5M
    _watcher.stop();
72
42.5M
    std::vector<std::weak_ptr<PipelineTask>> local_block_task {};
73
42.5M
    {
74
42.5M
        std::unique_lock<std::mutex> lc(_task_lock);
75
42.5M
        if (_ready) {
76
11
            return;
77
11
        }
78
42.5M
        _ready = true;
79
42.5M
        local_block_task.swap(_blocked_task);
80
42.5M
    }
81
4.08M
    for (auto task : local_block_task) {
82
4.08M
        if (auto t = task.lock()) {
83
4.08M
            std::unique_lock<std::mutex> lc(_task_lock);
84
4.08M
            THROW_IF_ERROR(t->wake_up(this));
85
4.08M
        }
86
4.08M
    }
87
42.5M
}
88
89
35.8M
Dependency* Dependency::is_blocked_by(std::shared_ptr<PipelineTask> task) {
90
35.8M
    std::unique_lock<std::mutex> lc(_task_lock);
91
35.8M
    auto ready = _ready.load();
92
35.8M
    if (!ready && task) {
93
4.08M
        _add_block_task(task);
94
4.08M
        start_watcher();
95
4.08M
        THROW_IF_ERROR(task->blocked(this));
96
4.08M
    }
97
35.8M
    return ready ? nullptr : this;
98
35.8M
}
99
100
37.8k
std::string Dependency::debug_string(int indentation_level) {
101
37.8k
    fmt::memory_buffer debug_string_buffer;
102
37.8k
    fmt::format_to(debug_string_buffer, "{}{}: id={}, block task = {}, ready={}, _always_ready={}",
103
37.8k
                   std::string(indentation_level * 2, ' '), _name, _node_id, _blocked_task.size(),
104
37.8k
                   _ready, _always_ready);
105
37.8k
    return fmt::to_string(debug_string_buffer);
106
37.8k
}
107
108
0
std::string CountedFinishDependency::debug_string(int indentation_level) {
109
0
    fmt::memory_buffer debug_string_buffer;
110
0
    fmt::format_to(debug_string_buffer,
111
0
                   "{}{}: id={}, block_task={}, ready={}, _always_ready={}, count={}",
112
0
                   std::string(indentation_level * 2, ' '), _name, _node_id, _blocked_task.size(),
113
0
                   _ready, _always_ready, _counter);
114
0
    return fmt::to_string(debug_string_buffer);
115
0
}
116
117
4.73k
void RuntimeFilterTimer::call_timeout() {
118
4.73k
    _parent->set_ready();
119
4.73k
}
120
121
31.3k
void RuntimeFilterTimer::call_ready() {
122
31.3k
    _parent->set_ready();
123
31.3k
}
124
125
// should check rf timeout in two case:
126
// 1. the rf is ready just remove the wait queue
127
// 2. if the rf have local dependency, the rf should start wait when all local dependency is ready
128
1.38M
bool RuntimeFilterTimer::should_be_check_timeout() {
129
1.38M
    if (!_parent->ready() && !_local_runtime_filter_dependencies.empty()) {
130
23.3k
        bool all_ready = true;
131
23.3k
        for (auto& dep : _local_runtime_filter_dependencies) {
132
23.3k
            if (!dep->ready()) {
133
23.2k
                all_ready = false;
134
23.2k
                break;
135
23.2k
            }
136
23.3k
        }
137
23.3k
        if (all_ready) {
138
21
            _local_runtime_filter_dependencies.clear();
139
21
            _registration_time = MonotonicMillis();
140
21
        }
141
23.3k
        return all_ready;
142
23.3k
    }
143
1.36M
    return true;
144
1.38M
}
145
146
4
void RuntimeFilterTimerQueue::start() {
147
121k
    while (!_stop) {
148
121k
        std::unique_lock<std::mutex> lk(cv_m);
149
150
126k
        while (_que.empty() && !_stop) {
151
11.3k
            cv.wait_for(lk, std::chrono::seconds(3), [this] { return !_que.empty() || _stop; });
152
5.65k
        }
153
121k
        if (_stop) {
154
1
            break;
155
1
        }
156
121k
        {
157
121k
            std::unique_lock<std::mutex> lc(_que_lock);
158
121k
            std::list<std::shared_ptr<pipeline::RuntimeFilterTimer>> new_que;
159
1.38M
            for (auto& it : _que) {
160
1.38M
                if (it.use_count() == 1) {
161
                    // `use_count == 1` means this runtime filter has been released
162
1.38M
                } else if (it->should_be_check_timeout()) {
163
1.36M
                    if (it->_parent->is_blocked_by()) {
164
                        // This means runtime filter is not ready, so we call timeout or continue to poll this timer.
165
1.33M
                        int64_t ms_since_registration = MonotonicMillis() - it->registration_time();
166
1.33M
                        if (ms_since_registration > it->wait_time_ms()) {
167
4.73k
                            it->call_timeout();
168
1.33M
                        } else {
169
1.33M
                            new_que.push_back(std::move(it));
170
1.33M
                        }
171
1.33M
                    }
172
1.36M
                } else {
173
23.2k
                    new_que.push_back(std::move(it));
174
23.2k
                }
175
1.38M
            }
176
121k
            new_que.swap(_que);
177
121k
        }
178
121k
        std::this_thread::sleep_for(std::chrono::milliseconds(interval));
179
121k
    }
180
4
    _shutdown = true;
181
4
}
182
183
145k
void LocalExchangeSharedState::sub_running_sink_operators() {
184
145k
    std::unique_lock<std::mutex> lc(le_lock);
185
145k
    if (exchanger->_running_sink_operators.fetch_sub(1) == 1) {
186
55.5k
        _set_always_ready();
187
55.5k
    }
188
145k
}
189
190
347k
void LocalExchangeSharedState::sub_running_source_operators() {
191
347k
    std::unique_lock<std::mutex> lc(le_lock);
192
347k
    if (exchanger->_running_source_operators.fetch_sub(1) == 1) {
193
55.5k
        _set_always_ready();
194
55.5k
        exchanger->finalize();
195
55.5k
    }
196
347k
}
197
198
55.6k
LocalExchangeSharedState::LocalExchangeSharedState(int num_instances) {
199
55.6k
    source_deps.resize(num_instances, nullptr);
200
55.6k
    mem_counters.resize(num_instances, nullptr);
201
55.6k
}
202
203
159
vectorized::MutableColumns AggSharedState::_get_keys_hash_table() {
204
159
    return std::visit(
205
159
            vectorized::Overload {
206
159
                    [&](std::monostate& arg) {
207
0
                        throw doris::Exception(ErrorCode::INTERNAL_ERROR, "uninited hash table");
208
0
                        return vectorized::MutableColumns();
209
0
                    },
210
159
                    [&](auto&& agg_method) -> vectorized::MutableColumns {
211
159
                        vectorized::MutableColumns key_columns;
212
516
                        for (int i = 0; i < probe_expr_ctxs.size(); ++i) {
213
357
                            key_columns.emplace_back(
214
357
                                    probe_expr_ctxs[i]->root()->data_type()->create_column());
215
357
                        }
216
159
                        auto& data = *agg_method.hash_table;
217
159
                        bool has_null_key = data.has_null_key_data();
218
159
                        const auto size = data.size() - has_null_key;
219
159
                        using KeyType = std::decay_t<decltype(agg_method.iterator->get_first())>;
220
159
                        std::vector<KeyType> keys(size);
221
222
159
                        size_t num_rows = 0;
223
159
                        auto iter = aggregate_data_container->begin();
224
159
                        {
225
21.6k
                            while (iter != aggregate_data_container->end()) {
226
21.4k
                                keys[num_rows] = iter.get_key<KeyType>();
227
21.4k
                                ++iter;
228
21.4k
                                ++num_rows;
229
21.4k
                            }
230
159
                        }
231
159
                        agg_method.insert_keys_into_columns(keys, key_columns, num_rows);
232
159
                        if (has_null_key) {
233
2
                            key_columns[0]->insert_data(nullptr, 0);
234
2
                        }
235
159
                        return key_columns;
236
159
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized16MethodSerializedI9PHHashMapINS_9StringRefEPc11DefaultHashIS7_vEEEEEESt6vectorINS_3COWINS4_7IColumnEE11mutable_ptrISG_EESaISJ_EEOT_
Line
Count
Source
210
16
                    [&](auto&& agg_method) -> vectorized::MutableColumns {
211
16
                        vectorized::MutableColumns key_columns;
212
76
                        for (int i = 0; i < probe_expr_ctxs.size(); ++i) {
213
60
                            key_columns.emplace_back(
214
60
                                    probe_expr_ctxs[i]->root()->data_type()->create_column());
215
60
                        }
216
16
                        auto& data = *agg_method.hash_table;
217
16
                        bool has_null_key = data.has_null_key_data();
218
16
                        const auto size = data.size() - has_null_key;
219
16
                        using KeyType = std::decay_t<decltype(agg_method.iterator->get_first())>;
220
16
                        std::vector<KeyType> keys(size);
221
222
16
                        size_t num_rows = 0;
223
16
                        auto iter = aggregate_data_container->begin();
224
16
                        {
225
14.3k
                            while (iter != aggregate_data_container->end()) {
226
14.3k
                                keys[num_rows] = iter.get_key<KeyType>();
227
14.3k
                                ++iter;
228
14.3k
                                ++num_rows;
229
14.3k
                            }
230
16
                        }
231
16
                        agg_method.insert_keys_into_columns(keys, key_columns, num_rows);
232
16
                        if (has_null_key) {
233
0
                            key_columns[0]->insert_data(nullptr, 0);
234
0
                        }
235
16
                        return key_columns;
236
16
                    }},
Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized15MethodOneNumberIh9PHHashMapIhPc9HashCRC32IhEEEEEESt6vectorINS_3COWINS4_7IColumnEE11mutable_ptrISF_EESaISI_EEOT_
Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized15MethodOneNumberIt9PHHashMapItPc9HashCRC32ItEEEEEESt6vectorINS_3COWINS4_7IColumnEE11mutable_ptrISF_EESaISI_EEOT_
dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized15MethodOneNumberIj9PHHashMapIjPc9HashCRC32IjEEEEEESt6vectorINS_3COWINS4_7IColumnEE11mutable_ptrISF_EESaISI_EEOT_
Line
Count
Source
210
4
                    [&](auto&& agg_method) -> vectorized::MutableColumns {
211
4
                        vectorized::MutableColumns key_columns;
212
8
                        for (int i = 0; i < probe_expr_ctxs.size(); ++i) {
213
4
                            key_columns.emplace_back(
214
4
                                    probe_expr_ctxs[i]->root()->data_type()->create_column());
215
4
                        }
216
4
                        auto& data = *agg_method.hash_table;
217
4
                        bool has_null_key = data.has_null_key_data();
218
4
                        const auto size = data.size() - has_null_key;
219
4
                        using KeyType = std::decay_t<decltype(agg_method.iterator->get_first())>;
220
4
                        std::vector<KeyType> keys(size);
221
222
4
                        size_t num_rows = 0;
223
4
                        auto iter = aggregate_data_container->begin();
224
4
                        {
225
12
                            while (iter != aggregate_data_container->end()) {
226
8
                                keys[num_rows] = iter.get_key<KeyType>();
227
8
                                ++iter;
228
8
                                ++num_rows;
229
8
                            }
230
4
                        }
231
4
                        agg_method.insert_keys_into_columns(keys, key_columns, num_rows);
232
4
                        if (has_null_key) {
233
0
                            key_columns[0]->insert_data(nullptr, 0);
234
0
                        }
235
4
                        return key_columns;
236
4
                    }},
Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized15MethodOneNumberIm9PHHashMapImPc9HashCRC32ImEEEEEESt6vectorINS_3COWINS4_7IColumnEE11mutable_ptrISF_EESaISI_EEOT_
Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized19MethodStringNoCacheINS_13StringHashMapIPcNS_9AllocatorILb1ELb1ELb0ENS_22DefaultMemoryAllocatorEEEEEEEEESt6vectorINS_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
210
4
                    [&](auto&& agg_method) -> vectorized::MutableColumns {
211
4
                        vectorized::MutableColumns key_columns;
212
8
                        for (int i = 0; i < probe_expr_ctxs.size(); ++i) {
213
4
                            key_columns.emplace_back(
214
4
                                    probe_expr_ctxs[i]->root()->data_type()->create_column());
215
4
                        }
216
4
                        auto& data = *agg_method.hash_table;
217
4
                        bool has_null_key = data.has_null_key_data();
218
4
                        const auto size = data.size() - has_null_key;
219
4
                        using KeyType = std::decay_t<decltype(agg_method.iterator->get_first())>;
220
4
                        std::vector<KeyType> keys(size);
221
222
4
                        size_t num_rows = 0;
223
4
                        auto iter = aggregate_data_container->begin();
224
4
                        {
225
8
                            while (iter != aggregate_data_container->end()) {
226
4
                                keys[num_rows] = iter.get_key<KeyType>();
227
4
                                ++iter;
228
4
                                ++num_rows;
229
4
                            }
230
4
                        }
231
4
                        agg_method.insert_keys_into_columns(keys, key_columns, num_rows);
232
4
                        if (has_null_key) {
233
0
                            key_columns[0]->insert_data(nullptr, 0);
234
0
                        }
235
4
                        return key_columns;
236
4
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized15MethodOneNumberIm9PHHashMapImPc14HashMixWrapperIm9HashCRC32ImEEEEEEESt6vectorINS_3COWINS4_7IColumnEE11mutable_ptrISH_EESaISK_EEOT_
Line
Count
Source
210
6
                    [&](auto&& agg_method) -> vectorized::MutableColumns {
211
6
                        vectorized::MutableColumns key_columns;
212
12
                        for (int i = 0; i < probe_expr_ctxs.size(); ++i) {
213
6
                            key_columns.emplace_back(
214
6
                                    probe_expr_ctxs[i]->root()->data_type()->create_column());
215
6
                        }
216
6
                        auto& data = *agg_method.hash_table;
217
6
                        bool has_null_key = data.has_null_key_data();
218
6
                        const auto size = data.size() - has_null_key;
219
6
                        using KeyType = std::decay_t<decltype(agg_method.iterator->get_first())>;
220
6
                        std::vector<KeyType> keys(size);
221
222
6
                        size_t num_rows = 0;
223
6
                        auto iter = aggregate_data_container->begin();
224
6
                        {
225
28
                            while (iter != aggregate_data_container->end()) {
226
22
                                keys[num_rows] = iter.get_key<KeyType>();
227
22
                                ++iter;
228
22
                                ++num_rows;
229
22
                            }
230
6
                        }
231
6
                        agg_method.insert_keys_into_columns(keys, key_columns, num_rows);
232
6
                        if (has_null_key) {
233
0
                            key_columns[0]->insert_data(nullptr, 0);
234
0
                        }
235
6
                        return key_columns;
236
6
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberIhNS4_15DataWithNullKeyI9PHHashMapIhPc9HashCRC32IhEEEEEEEEEESt6vectorINS_3COWINS4_7IColumnEE11mutable_ptrISJ_EESaISM_EEOT_
Line
Count
Source
210
2
                    [&](auto&& agg_method) -> vectorized::MutableColumns {
211
2
                        vectorized::MutableColumns key_columns;
212
4
                        for (int i = 0; i < probe_expr_ctxs.size(); ++i) {
213
2
                            key_columns.emplace_back(
214
2
                                    probe_expr_ctxs[i]->root()->data_type()->create_column());
215
2
                        }
216
2
                        auto& data = *agg_method.hash_table;
217
2
                        bool has_null_key = data.has_null_key_data();
218
2
                        const auto size = data.size() - has_null_key;
219
2
                        using KeyType = std::decay_t<decltype(agg_method.iterator->get_first())>;
220
2
                        std::vector<KeyType> keys(size);
221
222
2
                        size_t num_rows = 0;
223
2
                        auto iter = aggregate_data_container->begin();
224
2
                        {
225
8
                            while (iter != aggregate_data_container->end()) {
226
6
                                keys[num_rows] = iter.get_key<KeyType>();
227
6
                                ++iter;
228
6
                                ++num_rows;
229
6
                            }
230
2
                        }
231
2
                        agg_method.insert_keys_into_columns(keys, key_columns, num_rows);
232
2
                        if (has_null_key) {
233
0
                            key_columns[0]->insert_data(nullptr, 0);
234
0
                        }
235
2
                        return key_columns;
236
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
210
7
                    [&](auto&& agg_method) -> vectorized::MutableColumns {
211
7
                        vectorized::MutableColumns key_columns;
212
14
                        for (int i = 0; i < probe_expr_ctxs.size(); ++i) {
213
7
                            key_columns.emplace_back(
214
7
                                    probe_expr_ctxs[i]->root()->data_type()->create_column());
215
7
                        }
216
7
                        auto& data = *agg_method.hash_table;
217
7
                        bool has_null_key = data.has_null_key_data();
218
7
                        const auto size = data.size() - has_null_key;
219
7
                        using KeyType = std::decay_t<decltype(agg_method.iterator->get_first())>;
220
7
                        std::vector<KeyType> keys(size);
221
222
7
                        size_t num_rows = 0;
223
7
                        auto iter = aggregate_data_container->begin();
224
7
                        {
225
2.07k
                            while (iter != aggregate_data_container->end()) {
226
2.06k
                                keys[num_rows] = iter.get_key<KeyType>();
227
2.06k
                                ++iter;
228
2.06k
                                ++num_rows;
229
2.06k
                            }
230
7
                        }
231
7
                        agg_method.insert_keys_into_columns(keys, key_columns, num_rows);
232
7
                        if (has_null_key) {
233
0
                            key_columns[0]->insert_data(nullptr, 0);
234
0
                        }
235
7
                        return key_columns;
236
7
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberImNS4_15DataWithNullKeyI9PHHashMapImPc9HashCRC32ImEEEEEEEEEESt6vectorINS_3COWINS4_7IColumnEE11mutable_ptrISJ_EESaISM_EEOT_
Line
Count
Source
210
7
                    [&](auto&& agg_method) -> vectorized::MutableColumns {
211
7
                        vectorized::MutableColumns key_columns;
212
14
                        for (int i = 0; i < probe_expr_ctxs.size(); ++i) {
213
7
                            key_columns.emplace_back(
214
7
                                    probe_expr_ctxs[i]->root()->data_type()->create_column());
215
7
                        }
216
7
                        auto& data = *agg_method.hash_table;
217
7
                        bool has_null_key = data.has_null_key_data();
218
7
                        const auto size = data.size() - has_null_key;
219
7
                        using KeyType = std::decay_t<decltype(agg_method.iterator->get_first())>;
220
7
                        std::vector<KeyType> keys(size);
221
222
7
                        size_t num_rows = 0;
223
7
                        auto iter = aggregate_data_container->begin();
224
7
                        {
225
2.43k
                            while (iter != aggregate_data_container->end()) {
226
2.42k
                                keys[num_rows] = iter.get_key<KeyType>();
227
2.42k
                                ++iter;
228
2.42k
                                ++num_rows;
229
2.42k
                            }
230
7
                        }
231
7
                        agg_method.insert_keys_into_columns(keys, key_columns, num_rows);
232
7
                        if (has_null_key) {
233
0
                            key_columns[0]->insert_data(nullptr, 0);
234
0
                        }
235
7
                        return key_columns;
236
7
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberIjNS4_15DataWithNullKeyI9PHHashMapIjPc14HashMixWrapperIj9HashCRC32IjEEEEEEEEEEESt6vectorINS_3COWINS4_7IColumnEE11mutable_ptrISL_EESaISO_EEOT_
Line
Count
Source
210
10
                    [&](auto&& agg_method) -> vectorized::MutableColumns {
211
10
                        vectorized::MutableColumns key_columns;
212
20
                        for (int i = 0; i < probe_expr_ctxs.size(); ++i) {
213
10
                            key_columns.emplace_back(
214
10
                                    probe_expr_ctxs[i]->root()->data_type()->create_column());
215
10
                        }
216
10
                        auto& data = *agg_method.hash_table;
217
10
                        bool has_null_key = data.has_null_key_data();
218
10
                        const auto size = data.size() - has_null_key;
219
10
                        using KeyType = std::decay_t<decltype(agg_method.iterator->get_first())>;
220
10
                        std::vector<KeyType> keys(size);
221
222
10
                        size_t num_rows = 0;
223
10
                        auto iter = aggregate_data_container->begin();
224
10
                        {
225
36
                            while (iter != aggregate_data_container->end()) {
226
26
                                keys[num_rows] = iter.get_key<KeyType>();
227
26
                                ++iter;
228
26
                                ++num_rows;
229
26
                            }
230
10
                        }
231
10
                        agg_method.insert_keys_into_columns(keys, key_columns, num_rows);
232
10
                        if (has_null_key) {
233
1
                            key_columns[0]->insert_data(nullptr, 0);
234
1
                        }
235
10
                        return key_columns;
236
10
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberImNS4_15DataWithNullKeyI9PHHashMapImPc14HashMixWrapperIm9HashCRC32ImEEEEEEEEEEESt6vectorINS_3COWINS4_7IColumnEE11mutable_ptrISL_EESaISO_EEOT_
Line
Count
Source
210
10
                    [&](auto&& agg_method) -> vectorized::MutableColumns {
211
10
                        vectorized::MutableColumns key_columns;
212
20
                        for (int i = 0; i < probe_expr_ctxs.size(); ++i) {
213
10
                            key_columns.emplace_back(
214
10
                                    probe_expr_ctxs[i]->root()->data_type()->create_column());
215
10
                        }
216
10
                        auto& data = *agg_method.hash_table;
217
10
                        bool has_null_key = data.has_null_key_data();
218
10
                        const auto size = data.size() - has_null_key;
219
10
                        using KeyType = std::decay_t<decltype(agg_method.iterator->get_first())>;
220
10
                        std::vector<KeyType> keys(size);
221
222
10
                        size_t num_rows = 0;
223
10
                        auto iter = aggregate_data_container->begin();
224
10
                        {
225
45
                            while (iter != aggregate_data_container->end()) {
226
35
                                keys[num_rows] = iter.get_key<KeyType>();
227
35
                                ++iter;
228
35
                                ++num_rows;
229
35
                            }
230
10
                        }
231
10
                        agg_method.insert_keys_into_columns(keys, key_columns, num_rows);
232
10
                        if (has_null_key) {
233
1
                            key_columns[0]->insert_data(nullptr, 0);
234
1
                        }
235
10
                        return key_columns;
236
10
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberIN4wide7integerILm128EjEENS4_15DataWithNullKeyI9PHHashMapIS9_Pc9HashCRC32IS9_EEEEEEEEEESt6vectorINS_3COWINS4_7IColumnEE11mutable_ptrISM_EESaISP_EEOT_
Line
Count
Source
210
1
                    [&](auto&& agg_method) -> vectorized::MutableColumns {
211
1
                        vectorized::MutableColumns key_columns;
212
2
                        for (int i = 0; i < probe_expr_ctxs.size(); ++i) {
213
1
                            key_columns.emplace_back(
214
1
                                    probe_expr_ctxs[i]->root()->data_type()->create_column());
215
1
                        }
216
1
                        auto& data = *agg_method.hash_table;
217
1
                        bool has_null_key = data.has_null_key_data();
218
1
                        const auto size = data.size() - has_null_key;
219
1
                        using KeyType = std::decay_t<decltype(agg_method.iterator->get_first())>;
220
1
                        std::vector<KeyType> keys(size);
221
222
1
                        size_t num_rows = 0;
223
1
                        auto iter = aggregate_data_container->begin();
224
1
                        {
225
4
                            while (iter != aggregate_data_container->end()) {
226
3
                                keys[num_rows] = iter.get_key<KeyType>();
227
3
                                ++iter;
228
3
                                ++num_rows;
229
3
                            }
230
1
                        }
231
1
                        agg_method.insert_keys_into_columns(keys, key_columns, num_rows);
232
1
                        if (has_null_key) {
233
0
                            key_columns[0]->insert_data(nullptr, 0);
234
0
                        }
235
1
                        return key_columns;
236
1
                    }},
Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberIN4wide7integerILm256EjEENS4_15DataWithNullKeyI9PHHashMapIS9_Pc9HashCRC32IS9_EEEEEEEEEESt6vectorINS_3COWINS4_7IColumnEE11mutable_ptrISM_EESaISP_EEOT_
dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized26MethodSingleNullableColumnINS4_19MethodStringNoCacheINS4_15DataWithNullKeyINS_13StringHashMapIPcNS_9AllocatorILb1ELb1ELb0ENS_22DefaultMemoryAllocatorEEEEEEEEEEEEESt6vectorINS_3COWINS4_7IColumnEE11mutable_ptrISK_EESaISN_EEOT_
Line
Count
Source
210
8
                    [&](auto&& agg_method) -> vectorized::MutableColumns {
211
8
                        vectorized::MutableColumns key_columns;
212
16
                        for (int i = 0; i < probe_expr_ctxs.size(); ++i) {
213
8
                            key_columns.emplace_back(
214
8
                                    probe_expr_ctxs[i]->root()->data_type()->create_column());
215
8
                        }
216
8
                        auto& data = *agg_method.hash_table;
217
8
                        bool has_null_key = data.has_null_key_data();
218
8
                        const auto size = data.size() - has_null_key;
219
8
                        using KeyType = std::decay_t<decltype(agg_method.iterator->get_first())>;
220
8
                        std::vector<KeyType> keys(size);
221
222
8
                        size_t num_rows = 0;
223
8
                        auto iter = aggregate_data_container->begin();
224
8
                        {
225
419
                            while (iter != aggregate_data_container->end()) {
226
411
                                keys[num_rows] = iter.get_key<KeyType>();
227
411
                                ++iter;
228
411
                                ++num_rows;
229
411
                            }
230
8
                        }
231
8
                        agg_method.insert_keys_into_columns(keys, key_columns, num_rows);
232
8
                        if (has_null_key) {
233
0
                            key_columns[0]->insert_data(nullptr, 0);
234
0
                        }
235
8
                        return key_columns;
236
8
                    }},
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
210
84
                    [&](auto&& agg_method) -> vectorized::MutableColumns {
211
84
                        vectorized::MutableColumns key_columns;
212
322
                        for (int i = 0; i < probe_expr_ctxs.size(); ++i) {
213
238
                            key_columns.emplace_back(
214
238
                                    probe_expr_ctxs[i]->root()->data_type()->create_column());
215
238
                        }
216
84
                        auto& data = *agg_method.hash_table;
217
84
                        bool has_null_key = data.has_null_key_data();
218
84
                        const auto size = data.size() - has_null_key;
219
84
                        using KeyType = std::decay_t<decltype(agg_method.iterator->get_first())>;
220
84
                        std::vector<KeyType> keys(size);
221
222
84
                        size_t num_rows = 0;
223
84
                        auto iter = aggregate_data_container->begin();
224
84
                        {
225
2.22k
                            while (iter != aggregate_data_container->end()) {
226
2.13k
                                keys[num_rows] = iter.get_key<KeyType>();
227
2.13k
                                ++iter;
228
2.13k
                                ++num_rows;
229
2.13k
                            }
230
84
                        }
231
84
                        agg_method.insert_keys_into_columns(keys, key_columns, num_rows);
232
84
                        if (has_null_key) {
233
0
                            key_columns[0]->insert_data(nullptr, 0);
234
0
                        }
235
84
                        return key_columns;
236
84
                    }},
Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState20_get_keys_hash_tableEvENK3$_1clIRNS_10vectorized15MethodKeysFixedI9PHHashMapINS4_7UInt136EPc9HashCRC32IS7_EEEEEESt6vectorINS_3COWINS4_7IColumnEE11mutable_ptrISG_EESaISJ_EEOT_
237
159
            agg_data->method_variant);
238
159
}
239
240
159
void AggSharedState::build_limit_heap(size_t hash_table_size) {
241
159
    limit_columns = _get_keys_hash_table();
242
21.4k
    for (size_t i = 0; i < hash_table_size; ++i) {
243
21.3k
        limit_heap.emplace(i, limit_columns, order_directions, null_directions);
244
21.3k
    }
245
21.0k
    while (hash_table_size > limit) {
246
20.8k
        limit_heap.pop();
247
20.8k
        hash_table_size--;
248
20.8k
    }
249
159
    limit_columns_min = limit_heap.top()._row_id;
250
159
}
251
252
bool AggSharedState::do_limit_filter(vectorized::Block* block, size_t num_rows,
253
571
                                     const std::vector<int>* key_locs) {
254
571
    if (num_rows) {
255
571
        cmp_res.resize(num_rows);
256
571
        need_computes.resize(num_rows);
257
571
        memset(need_computes.data(), 0, need_computes.size());
258
571
        memset(cmp_res.data(), 0, cmp_res.size());
259
260
571
        const auto key_size = null_directions.size();
261
2.01k
        for (int i = 0; i < key_size; i++) {
262
1.44k
            block->get_by_position(key_locs ? key_locs->operator[](i) : i)
263
1.44k
                    .column->compare_internal(limit_columns_min, *limit_columns[i],
264
1.44k
                                              null_directions[i], order_directions[i], cmp_res,
265
1.44k
                                              need_computes.data());
266
1.44k
        }
267
268
572
        auto set_computes_arr = [](auto* __restrict res, auto* __restrict computes, size_t rows) {
269
578k
            for (size_t i = 0; i < rows; ++i) {
270
577k
                computes[i] = computes[i] == res[i];
271
577k
            }
272
572
        };
273
571
        set_computes_arr(cmp_res.data(), need_computes.data(), num_rows);
274
275
571
        return std::find(need_computes.begin(), need_computes.end(), 0) != need_computes.end();
276
571
    }
277
278
0
    return false;
279
571
}
280
281
29.7k
Status AggSharedState::reset_hash_table() {
282
29.7k
    return std::visit(
283
29.7k
            vectorized::Overload {
284
29.7k
                    [&](std::monostate& arg) -> Status {
285
0
                        return Status::InternalError("Uninited hash table");
286
0
                    },
287
29.7k
                    [&](auto& agg_method) {
288
29.7k
                        auto& hash_table = *agg_method.hash_table;
289
29.7k
                        using HashTableType = std::decay_t<decltype(hash_table)>;
290
291
29.7k
                        agg_method.reset();
292
293
4.65M
                        hash_table.for_each_mapped([&](auto& mapped) {
294
4.66M
                            if (mapped) {
295
4.66M
                                static_cast<void>(_destroy_agg_status(mapped));
296
4.66M
                                mapped = nullptr;
297
4.66M
                            }
298
4.65M
                        });
dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized16MethodSerializedI9PHHashMapINS_9StringRefEPc11DefaultHashIS7_vEEEEEEDaRT_ENKUlSE_E_clIS8_EEDaSE_
Line
Count
Source
293
54.9k
                        hash_table.for_each_mapped([&](auto& mapped) {
294
54.9k
                            if (mapped) {
295
54.9k
                                static_cast<void>(_destroy_agg_status(mapped));
296
54.9k
                                mapped = nullptr;
297
54.9k
                            }
298
54.9k
                        });
dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodOneNumberIh9PHHashMapIhPc9HashCRC32IhEEEEEEDaRT_ENKUlSD_E_clIS7_EEDaSD_
Line
Count
Source
293
8
                        hash_table.for_each_mapped([&](auto& mapped) {
294
8
                            if (mapped) {
295
8
                                static_cast<void>(_destroy_agg_status(mapped));
296
8
                                mapped = nullptr;
297
8
                            }
298
8
                        });
dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodOneNumberIt9PHHashMapItPc9HashCRC32ItEEEEEEDaRT_ENKUlSD_E_clIS7_EEDaSD_
Line
Count
Source
293
22
                        hash_table.for_each_mapped([&](auto& mapped) {
294
22
                            if (mapped) {
295
22
                                static_cast<void>(_destroy_agg_status(mapped));
296
22
                                mapped = nullptr;
297
22
                            }
298
22
                        });
dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodOneNumberIj9PHHashMapIjPc9HashCRC32IjEEEEEEDaRT_ENKUlSD_E_clIS7_EEDaSD_
Line
Count
Source
293
3.18M
                        hash_table.for_each_mapped([&](auto& mapped) {
294
3.18M
                            if (mapped) {
295
3.18M
                                static_cast<void>(_destroy_agg_status(mapped));
296
3.18M
                                mapped = nullptr;
297
3.18M
                            }
298
3.18M
                        });
dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodOneNumberIm9PHHashMapImPc9HashCRC32ImEEEEEEDaRT_ENKUlSD_E_clIS7_EEDaSD_
Line
Count
Source
293
27.1k
                        hash_table.for_each_mapped([&](auto& mapped) {
294
27.1k
                            if (mapped) {
295
27.1k
                                static_cast<void>(_destroy_agg_status(mapped));
296
27.1k
                                mapped = nullptr;
297
27.1k
                            }
298
27.1k
                        });
dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized19MethodStringNoCacheINS_13StringHashMapIPcNS_9AllocatorILb1ELb1ELb0ENS_22DefaultMemoryAllocatorEEEEEEEEEDaRT_ENKUlSE_E_clIS7_EEDaSE_
Line
Count
Source
293
5.51k
                        hash_table.for_each_mapped([&](auto& mapped) {
294
5.51k
                            if (mapped) {
295
5.51k
                                static_cast<void>(_destroy_agg_status(mapped));
296
5.51k
                                mapped = nullptr;
297
5.51k
                            }
298
5.51k
                        });
dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodOneNumberIN4wide7integerILm128EjEE9PHHashMapIS8_Pc9HashCRC32IS8_EEEEEEDaRT_ENKUlSG_E_clISA_EEDaSG_
Line
Count
Source
293
4
                        hash_table.for_each_mapped([&](auto& mapped) {
294
4
                            if (mapped) {
295
4
                                static_cast<void>(_destroy_agg_status(mapped));
296
4
                                mapped = nullptr;
297
4
                            }
298
4
                        });
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
293
1.12M
                        hash_table.for_each_mapped([&](auto& mapped) {
294
1.12M
                            if (mapped) {
295
1.12M
                                static_cast<void>(_destroy_agg_status(mapped));
296
1.12M
                                mapped = nullptr;
297
1.12M
                            }
298
1.12M
                        });
dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodOneNumberIm9PHHashMapImPc14HashMixWrapperIm9HashCRC32ImEEEEEEEDaRT_ENKUlSF_E_clIS7_EEDaSF_
Line
Count
Source
293
1.85k
                        hash_table.for_each_mapped([&](auto& mapped) {
294
1.85k
                            if (mapped) {
295
1.85k
                                static_cast<void>(_destroy_agg_status(mapped));
296
1.85k
                                mapped = nullptr;
297
1.85k
                            }
298
1.85k
                        });
dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberIhNS4_15DataWithNullKeyI9PHHashMapIhPc9HashCRC32IhEEEEEEEEEEDaRT_ENKUlSH_E_clIS9_EEDaSH_
Line
Count
Source
293
14
                        hash_table.for_each_mapped([&](auto& mapped) {
294
14
                            if (mapped) {
295
14
                                static_cast<void>(_destroy_agg_status(mapped));
296
14
                                mapped = nullptr;
297
14
                            }
298
14
                        });
dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberItNS4_15DataWithNullKeyI9PHHashMapItPc9HashCRC32ItEEEEEEEEEEDaRT_ENKUlSH_E_clIS9_EEDaSH_
Line
Count
Source
293
74
                        hash_table.for_each_mapped([&](auto& mapped) {
294
74
                            if (mapped) {
295
74
                                static_cast<void>(_destroy_agg_status(mapped));
296
74
                                mapped = nullptr;
297
74
                            }
298
74
                        });
dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberIjNS4_15DataWithNullKeyI9PHHashMapIjPc9HashCRC32IjEEEEEEEEEEDaRT_ENKUlSH_E_clIS9_EEDaSH_
Line
Count
Source
293
235
                        hash_table.for_each_mapped([&](auto& mapped) {
294
235
                            if (mapped) {
295
235
                                static_cast<void>(_destroy_agg_status(mapped));
296
235
                                mapped = nullptr;
297
235
                            }
298
235
                        });
dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberImNS4_15DataWithNullKeyI9PHHashMapImPc9HashCRC32ImEEEEEEEEEEDaRT_ENKUlSH_E_clIS9_EEDaSH_
Line
Count
Source
293
60
                        hash_table.for_each_mapped([&](auto& mapped) {
294
60
                            if (mapped) {
295
60
                                static_cast<void>(_destroy_agg_status(mapped));
296
60
                                mapped = nullptr;
297
60
                            }
298
60
                        });
dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberIjNS4_15DataWithNullKeyI9PHHashMapIjPc14HashMixWrapperIj9HashCRC32IjEEEEEEEEEEEDaRT_ENKUlSJ_E_clIS9_EEDaSJ_
Line
Count
Source
293
375
                        hash_table.for_each_mapped([&](auto& mapped) {
294
375
                            if (mapped) {
295
375
                                static_cast<void>(_destroy_agg_status(mapped));
296
375
                                mapped = nullptr;
297
375
                            }
298
375
                        });
dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberImNS4_15DataWithNullKeyI9PHHashMapImPc14HashMixWrapperIm9HashCRC32ImEEEEEEEEEEEDaRT_ENKUlSJ_E_clIS9_EEDaSJ_
Line
Count
Source
293
114
                        hash_table.for_each_mapped([&](auto& mapped) {
294
114
                            if (mapped) {
295
114
                                static_cast<void>(_destroy_agg_status(mapped));
296
114
                                mapped = nullptr;
297
114
                            }
298
114
                        });
dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberIN4wide7integerILm128EjEENS4_15DataWithNullKeyI9PHHashMapIS9_Pc9HashCRC32IS9_EEEEEEEEEEDaRT_ENKUlSK_E_clISC_EEDaSK_
Line
Count
Source
293
36
                        hash_table.for_each_mapped([&](auto& mapped) {
294
36
                            if (mapped) {
295
36
                                static_cast<void>(_destroy_agg_status(mapped));
296
36
                                mapped = nullptr;
297
36
                            }
298
36
                        });
Unexecuted instantiation: dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberIN4wide7integerILm256EjEENS4_15DataWithNullKeyI9PHHashMapIS9_Pc9HashCRC32IS9_EEEEEEEEEEDaRT_ENKUlSK_E_clISC_EEDaSK_
dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_19MethodStringNoCacheINS4_15DataWithNullKeyINS_13StringHashMapIPcNS_9AllocatorILb1ELb1ELb0ENS_22DefaultMemoryAllocatorEEEEEEEEEEEEEDaRT_ENKUlSI_E_clIS9_EEDaSI_
Line
Count
Source
293
2.04k
                        hash_table.for_each_mapped([&](auto& mapped) {
294
2.04k
                            if (mapped) {
295
2.04k
                                static_cast<void>(_destroy_agg_status(mapped));
296
2.04k
                                mapped = nullptr;
297
2.04k
                            }
298
2.04k
                        });
dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodKeysFixedI9PHHashMapImPc9HashCRC32ImEEEEEEDaRT_ENKUlSD_E_clIS7_EEDaSD_
Line
Count
Source
293
243k
                        hash_table.for_each_mapped([&](auto& mapped) {
294
243k
                            if (mapped) {
295
243k
                                static_cast<void>(_destroy_agg_status(mapped));
296
243k
                                mapped = nullptr;
297
243k
                            }
298
243k
                        });
dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodKeysFixedI9PHHashMapIN4wide7integerILm128EjEEPc9HashCRC32IS9_EEEEEEDaRT_ENKUlSG_E_clISA_EEDaSG_
Line
Count
Source
293
12.6k
                        hash_table.for_each_mapped([&](auto& mapped) {
294
12.6k
                            if (mapped) {
295
12.6k
                                static_cast<void>(_destroy_agg_status(mapped));
296
12.6k
                                mapped = nullptr;
297
12.6k
                            }
298
12.6k
                        });
dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodKeysFixedI9PHHashMapIN4wide7integerILm256EjEEPc9HashCRC32IS9_EEEEEEDaRT_ENKUlSG_E_clISA_EEDaSG_
Line
Count
Source
293
308
                        hash_table.for_each_mapped([&](auto& mapped) {
294
308
                            if (mapped) {
295
308
                                static_cast<void>(_destroy_agg_status(mapped));
296
308
                                mapped = nullptr;
297
308
                            }
298
308
                        });
dependency.cpp:_ZZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodKeysFixedI9PHHashMapINS4_7UInt136EPc9HashCRC32IS7_EEEEEEDaRT_ENKUlSE_E_clIS8_EEDaSE_
Line
Count
Source
293
1.12k
                        hash_table.for_each_mapped([&](auto& mapped) {
294
1.12k
                            if (mapped) {
295
1.12k
                                static_cast<void>(_destroy_agg_status(mapped));
296
1.12k
                                mapped = nullptr;
297
1.12k
                            }
298
1.12k
                        });
299
300
29.7k
                        if (hash_table.has_null_key_data()) {
301
67
                            auto st = _destroy_agg_status(hash_table.template get_null_key_data<
302
67
                                                          vectorized::AggregateDataPtr>());
303
67
                            RETURN_IF_ERROR(st);
304
67
                        }
305
306
29.7k
                        aggregate_data_container.reset(new AggregateDataContainer(
307
29.7k
                                sizeof(typename HashTableType::key_type),
308
29.7k
                                ((total_size_of_aggregate_states + align_aggregate_states - 1) /
309
29.7k
                                 align_aggregate_states) *
310
29.7k
                                        align_aggregate_states));
311
29.7k
                        agg_method.hash_table.reset(new HashTableType());
312
29.7k
                        agg_arena_pool.reset(new vectorized::Arena);
313
29.7k
                        return Status::OK();
314
29.7k
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized16MethodSerializedI9PHHashMapINS_9StringRefEPc11DefaultHashIS7_vEEEEEEDaRT_
Line
Count
Source
287
6.17k
                    [&](auto& agg_method) {
288
6.17k
                        auto& hash_table = *agg_method.hash_table;
289
6.17k
                        using HashTableType = std::decay_t<decltype(hash_table)>;
290
291
6.17k
                        agg_method.reset();
292
293
6.17k
                        hash_table.for_each_mapped([&](auto& mapped) {
294
6.17k
                            if (mapped) {
295
6.17k
                                static_cast<void>(_destroy_agg_status(mapped));
296
6.17k
                                mapped = nullptr;
297
6.17k
                            }
298
6.17k
                        });
299
300
6.17k
                        if (hash_table.has_null_key_data()) {
301
0
                            auto st = _destroy_agg_status(hash_table.template get_null_key_data<
302
0
                                                          vectorized::AggregateDataPtr>());
303
0
                            RETURN_IF_ERROR(st);
304
0
                        }
305
306
6.17k
                        aggregate_data_container.reset(new AggregateDataContainer(
307
6.17k
                                sizeof(typename HashTableType::key_type),
308
6.17k
                                ((total_size_of_aggregate_states + align_aggregate_states - 1) /
309
6.17k
                                 align_aggregate_states) *
310
6.17k
                                        align_aggregate_states));
311
6.17k
                        agg_method.hash_table.reset(new HashTableType());
312
6.17k
                        agg_arena_pool.reset(new vectorized::Arena);
313
6.17k
                        return Status::OK();
314
6.17k
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodOneNumberIh9PHHashMapIhPc9HashCRC32IhEEEEEEDaRT_
Line
Count
Source
287
11
                    [&](auto& agg_method) {
288
11
                        auto& hash_table = *agg_method.hash_table;
289
11
                        using HashTableType = std::decay_t<decltype(hash_table)>;
290
291
11
                        agg_method.reset();
292
293
11
                        hash_table.for_each_mapped([&](auto& mapped) {
294
11
                            if (mapped) {
295
11
                                static_cast<void>(_destroy_agg_status(mapped));
296
11
                                mapped = nullptr;
297
11
                            }
298
11
                        });
299
300
11
                        if (hash_table.has_null_key_data()) {
301
0
                            auto st = _destroy_agg_status(hash_table.template get_null_key_data<
302
0
                                                          vectorized::AggregateDataPtr>());
303
0
                            RETURN_IF_ERROR(st);
304
0
                        }
305
306
11
                        aggregate_data_container.reset(new AggregateDataContainer(
307
11
                                sizeof(typename HashTableType::key_type),
308
11
                                ((total_size_of_aggregate_states + align_aggregate_states - 1) /
309
11
                                 align_aggregate_states) *
310
11
                                        align_aggregate_states));
311
11
                        agg_method.hash_table.reset(new HashTableType());
312
11
                        agg_arena_pool.reset(new vectorized::Arena);
313
11
                        return Status::OK();
314
11
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodOneNumberIt9PHHashMapItPc9HashCRC32ItEEEEEEDaRT_
Line
Count
Source
287
27
                    [&](auto& agg_method) {
288
27
                        auto& hash_table = *agg_method.hash_table;
289
27
                        using HashTableType = std::decay_t<decltype(hash_table)>;
290
291
27
                        agg_method.reset();
292
293
27
                        hash_table.for_each_mapped([&](auto& mapped) {
294
27
                            if (mapped) {
295
27
                                static_cast<void>(_destroy_agg_status(mapped));
296
27
                                mapped = nullptr;
297
27
                            }
298
27
                        });
299
300
27
                        if (hash_table.has_null_key_data()) {
301
0
                            auto st = _destroy_agg_status(hash_table.template get_null_key_data<
302
0
                                                          vectorized::AggregateDataPtr>());
303
0
                            RETURN_IF_ERROR(st);
304
0
                        }
305
306
27
                        aggregate_data_container.reset(new AggregateDataContainer(
307
27
                                sizeof(typename HashTableType::key_type),
308
27
                                ((total_size_of_aggregate_states + align_aggregate_states - 1) /
309
27
                                 align_aggregate_states) *
310
27
                                        align_aggregate_states));
311
27
                        agg_method.hash_table.reset(new HashTableType());
312
27
                        agg_arena_pool.reset(new vectorized::Arena);
313
27
                        return Status::OK();
314
27
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodOneNumberIj9PHHashMapIjPc9HashCRC32IjEEEEEEDaRT_
Line
Count
Source
287
8.71k
                    [&](auto& agg_method) {
288
8.71k
                        auto& hash_table = *agg_method.hash_table;
289
8.71k
                        using HashTableType = std::decay_t<decltype(hash_table)>;
290
291
8.71k
                        agg_method.reset();
292
293
8.71k
                        hash_table.for_each_mapped([&](auto& mapped) {
294
8.71k
                            if (mapped) {
295
8.71k
                                static_cast<void>(_destroy_agg_status(mapped));
296
8.71k
                                mapped = nullptr;
297
8.71k
                            }
298
8.71k
                        });
299
300
8.71k
                        if (hash_table.has_null_key_data()) {
301
0
                            auto st = _destroy_agg_status(hash_table.template get_null_key_data<
302
0
                                                          vectorized::AggregateDataPtr>());
303
0
                            RETURN_IF_ERROR(st);
304
0
                        }
305
306
8.71k
                        aggregate_data_container.reset(new AggregateDataContainer(
307
8.71k
                                sizeof(typename HashTableType::key_type),
308
8.71k
                                ((total_size_of_aggregate_states + align_aggregate_states - 1) /
309
8.71k
                                 align_aggregate_states) *
310
8.71k
                                        align_aggregate_states));
311
8.71k
                        agg_method.hash_table.reset(new HashTableType());
312
8.71k
                        agg_arena_pool.reset(new vectorized::Arena);
313
8.71k
                        return Status::OK();
314
8.71k
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodOneNumberIm9PHHashMapImPc9HashCRC32ImEEEEEEDaRT_
Line
Count
Source
287
2.62k
                    [&](auto& agg_method) {
288
2.62k
                        auto& hash_table = *agg_method.hash_table;
289
2.62k
                        using HashTableType = std::decay_t<decltype(hash_table)>;
290
291
2.62k
                        agg_method.reset();
292
293
2.62k
                        hash_table.for_each_mapped([&](auto& mapped) {
294
2.62k
                            if (mapped) {
295
2.62k
                                static_cast<void>(_destroy_agg_status(mapped));
296
2.62k
                                mapped = nullptr;
297
2.62k
                            }
298
2.62k
                        });
299
300
2.62k
                        if (hash_table.has_null_key_data()) {
301
0
                            auto st = _destroy_agg_status(hash_table.template get_null_key_data<
302
0
                                                          vectorized::AggregateDataPtr>());
303
0
                            RETURN_IF_ERROR(st);
304
0
                        }
305
306
2.62k
                        aggregate_data_container.reset(new AggregateDataContainer(
307
2.62k
                                sizeof(typename HashTableType::key_type),
308
2.62k
                                ((total_size_of_aggregate_states + align_aggregate_states - 1) /
309
2.62k
                                 align_aggregate_states) *
310
2.62k
                                        align_aggregate_states));
311
2.62k
                        agg_method.hash_table.reset(new HashTableType());
312
2.62k
                        agg_arena_pool.reset(new vectorized::Arena);
313
2.62k
                        return Status::OK();
314
2.62k
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized19MethodStringNoCacheINS_13StringHashMapIPcNS_9AllocatorILb1ELb1ELb0ENS_22DefaultMemoryAllocatorEEEEEEEEEDaRT_
Line
Count
Source
287
1.59k
                    [&](auto& agg_method) {
288
1.59k
                        auto& hash_table = *agg_method.hash_table;
289
1.59k
                        using HashTableType = std::decay_t<decltype(hash_table)>;
290
291
1.59k
                        agg_method.reset();
292
293
1.59k
                        hash_table.for_each_mapped([&](auto& mapped) {
294
1.59k
                            if (mapped) {
295
1.59k
                                static_cast<void>(_destroy_agg_status(mapped));
296
1.59k
                                mapped = nullptr;
297
1.59k
                            }
298
1.59k
                        });
299
300
1.59k
                        if (hash_table.has_null_key_data()) {
301
0
                            auto st = _destroy_agg_status(hash_table.template get_null_key_data<
302
0
                                                          vectorized::AggregateDataPtr>());
303
0
                            RETURN_IF_ERROR(st);
304
0
                        }
305
306
1.59k
                        aggregate_data_container.reset(new AggregateDataContainer(
307
1.59k
                                sizeof(typename HashTableType::key_type),
308
1.59k
                                ((total_size_of_aggregate_states + align_aggregate_states - 1) /
309
1.59k
                                 align_aggregate_states) *
310
1.59k
                                        align_aggregate_states));
311
1.59k
                        agg_method.hash_table.reset(new HashTableType());
312
1.59k
                        agg_arena_pool.reset(new vectorized::Arena);
313
1.59k
                        return Status::OK();
314
1.59k
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodOneNumberIN4wide7integerILm128EjEE9PHHashMapIS8_Pc9HashCRC32IS8_EEEEEEDaRT_
Line
Count
Source
287
5
                    [&](auto& agg_method) {
288
5
                        auto& hash_table = *agg_method.hash_table;
289
5
                        using HashTableType = std::decay_t<decltype(hash_table)>;
290
291
5
                        agg_method.reset();
292
293
5
                        hash_table.for_each_mapped([&](auto& mapped) {
294
5
                            if (mapped) {
295
5
                                static_cast<void>(_destroy_agg_status(mapped));
296
5
                                mapped = nullptr;
297
5
                            }
298
5
                        });
299
300
5
                        if (hash_table.has_null_key_data()) {
301
0
                            auto st = _destroy_agg_status(hash_table.template get_null_key_data<
302
0
                                                          vectorized::AggregateDataPtr>());
303
0
                            RETURN_IF_ERROR(st);
304
0
                        }
305
306
5
                        aggregate_data_container.reset(new AggregateDataContainer(
307
5
                                sizeof(typename HashTableType::key_type),
308
5
                                ((total_size_of_aggregate_states + align_aggregate_states - 1) /
309
5
                                 align_aggregate_states) *
310
5
                                        align_aggregate_states));
311
5
                        agg_method.hash_table.reset(new HashTableType());
312
5
                        agg_arena_pool.reset(new vectorized::Arena);
313
5
                        return Status::OK();
314
5
                    }},
Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodOneNumberIN4wide7integerILm256EjEE9PHHashMapIS8_Pc9HashCRC32IS8_EEEEEEDaRT_
dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodOneNumberIj9PHHashMapIjPc14HashMixWrapperIj9HashCRC32IjEEEEEEEDaRT_
Line
Count
Source
287
1.98k
                    [&](auto& agg_method) {
288
1.98k
                        auto& hash_table = *agg_method.hash_table;
289
1.98k
                        using HashTableType = std::decay_t<decltype(hash_table)>;
290
291
1.98k
                        agg_method.reset();
292
293
1.98k
                        hash_table.for_each_mapped([&](auto& mapped) {
294
1.98k
                            if (mapped) {
295
1.98k
                                static_cast<void>(_destroy_agg_status(mapped));
296
1.98k
                                mapped = nullptr;
297
1.98k
                            }
298
1.98k
                        });
299
300
1.98k
                        if (hash_table.has_null_key_data()) {
301
0
                            auto st = _destroy_agg_status(hash_table.template get_null_key_data<
302
0
                                                          vectorized::AggregateDataPtr>());
303
0
                            RETURN_IF_ERROR(st);
304
0
                        }
305
306
1.98k
                        aggregate_data_container.reset(new AggregateDataContainer(
307
1.98k
                                sizeof(typename HashTableType::key_type),
308
1.98k
                                ((total_size_of_aggregate_states + align_aggregate_states - 1) /
309
1.98k
                                 align_aggregate_states) *
310
1.98k
                                        align_aggregate_states));
311
1.98k
                        agg_method.hash_table.reset(new HashTableType());
312
1.98k
                        agg_arena_pool.reset(new vectorized::Arena);
313
1.98k
                        return Status::OK();
314
1.98k
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodOneNumberIm9PHHashMapImPc14HashMixWrapperIm9HashCRC32ImEEEEEEEDaRT_
Line
Count
Source
287
944
                    [&](auto& agg_method) {
288
944
                        auto& hash_table = *agg_method.hash_table;
289
944
                        using HashTableType = std::decay_t<decltype(hash_table)>;
290
291
944
                        agg_method.reset();
292
293
944
                        hash_table.for_each_mapped([&](auto& mapped) {
294
944
                            if (mapped) {
295
944
                                static_cast<void>(_destroy_agg_status(mapped));
296
944
                                mapped = nullptr;
297
944
                            }
298
944
                        });
299
300
944
                        if (hash_table.has_null_key_data()) {
301
0
                            auto st = _destroy_agg_status(hash_table.template get_null_key_data<
302
0
                                                          vectorized::AggregateDataPtr>());
303
0
                            RETURN_IF_ERROR(st);
304
0
                        }
305
306
944
                        aggregate_data_container.reset(new AggregateDataContainer(
307
944
                                sizeof(typename HashTableType::key_type),
308
944
                                ((total_size_of_aggregate_states + align_aggregate_states - 1) /
309
944
                                 align_aggregate_states) *
310
944
                                        align_aggregate_states));
311
944
                        agg_method.hash_table.reset(new HashTableType());
312
944
                        agg_arena_pool.reset(new vectorized::Arena);
313
944
                        return Status::OK();
314
944
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberIhNS4_15DataWithNullKeyI9PHHashMapIhPc9HashCRC32IhEEEEEEEEEEDaRT_
Line
Count
Source
287
19
                    [&](auto& agg_method) {
288
19
                        auto& hash_table = *agg_method.hash_table;
289
19
                        using HashTableType = std::decay_t<decltype(hash_table)>;
290
291
19
                        agg_method.reset();
292
293
19
                        hash_table.for_each_mapped([&](auto& mapped) {
294
19
                            if (mapped) {
295
19
                                static_cast<void>(_destroy_agg_status(mapped));
296
19
                                mapped = nullptr;
297
19
                            }
298
19
                        });
299
300
19
                        if (hash_table.has_null_key_data()) {
301
0
                            auto st = _destroy_agg_status(hash_table.template get_null_key_data<
302
0
                                                          vectorized::AggregateDataPtr>());
303
0
                            RETURN_IF_ERROR(st);
304
0
                        }
305
306
19
                        aggregate_data_container.reset(new AggregateDataContainer(
307
19
                                sizeof(typename HashTableType::key_type),
308
19
                                ((total_size_of_aggregate_states + align_aggregate_states - 1) /
309
19
                                 align_aggregate_states) *
310
19
                                        align_aggregate_states));
311
19
                        agg_method.hash_table.reset(new HashTableType());
312
19
                        agg_arena_pool.reset(new vectorized::Arena);
313
19
                        return Status::OK();
314
19
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberItNS4_15DataWithNullKeyI9PHHashMapItPc9HashCRC32ItEEEEEEEEEEDaRT_
Line
Count
Source
287
100
                    [&](auto& agg_method) {
288
100
                        auto& hash_table = *agg_method.hash_table;
289
100
                        using HashTableType = std::decay_t<decltype(hash_table)>;
290
291
100
                        agg_method.reset();
292
293
100
                        hash_table.for_each_mapped([&](auto& mapped) {
294
100
                            if (mapped) {
295
100
                                static_cast<void>(_destroy_agg_status(mapped));
296
100
                                mapped = nullptr;
297
100
                            }
298
100
                        });
299
300
100
                        if (hash_table.has_null_key_data()) {
301
0
                            auto st = _destroy_agg_status(hash_table.template get_null_key_data<
302
0
                                                          vectorized::AggregateDataPtr>());
303
0
                            RETURN_IF_ERROR(st);
304
0
                        }
305
306
100
                        aggregate_data_container.reset(new AggregateDataContainer(
307
100
                                sizeof(typename HashTableType::key_type),
308
100
                                ((total_size_of_aggregate_states + align_aggregate_states - 1) /
309
100
                                 align_aggregate_states) *
310
100
                                        align_aggregate_states));
311
100
                        agg_method.hash_table.reset(new HashTableType());
312
100
                        agg_arena_pool.reset(new vectorized::Arena);
313
100
                        return Status::OK();
314
100
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberIjNS4_15DataWithNullKeyI9PHHashMapIjPc9HashCRC32IjEEEEEEEEEEDaRT_
Line
Count
Source
287
287
                    [&](auto& agg_method) {
288
287
                        auto& hash_table = *agg_method.hash_table;
289
287
                        using HashTableType = std::decay_t<decltype(hash_table)>;
290
291
287
                        agg_method.reset();
292
293
287
                        hash_table.for_each_mapped([&](auto& mapped) {
294
287
                            if (mapped) {
295
287
                                static_cast<void>(_destroy_agg_status(mapped));
296
287
                                mapped = nullptr;
297
287
                            }
298
287
                        });
299
300
287
                        if (hash_table.has_null_key_data()) {
301
2
                            auto st = _destroy_agg_status(hash_table.template get_null_key_data<
302
2
                                                          vectorized::AggregateDataPtr>());
303
2
                            RETURN_IF_ERROR(st);
304
2
                        }
305
306
287
                        aggregate_data_container.reset(new AggregateDataContainer(
307
287
                                sizeof(typename HashTableType::key_type),
308
287
                                ((total_size_of_aggregate_states + align_aggregate_states - 1) /
309
287
                                 align_aggregate_states) *
310
287
                                        align_aggregate_states));
311
287
                        agg_method.hash_table.reset(new HashTableType());
312
287
                        agg_arena_pool.reset(new vectorized::Arena);
313
287
                        return Status::OK();
314
287
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberImNS4_15DataWithNullKeyI9PHHashMapImPc9HashCRC32ImEEEEEEEEEEDaRT_
Line
Count
Source
287
76
                    [&](auto& agg_method) {
288
76
                        auto& hash_table = *agg_method.hash_table;
289
76
                        using HashTableType = std::decay_t<decltype(hash_table)>;
290
291
76
                        agg_method.reset();
292
293
76
                        hash_table.for_each_mapped([&](auto& mapped) {
294
76
                            if (mapped) {
295
76
                                static_cast<void>(_destroy_agg_status(mapped));
296
76
                                mapped = nullptr;
297
76
                            }
298
76
                        });
299
300
76
                        if (hash_table.has_null_key_data()) {
301
2
                            auto st = _destroy_agg_status(hash_table.template get_null_key_data<
302
2
                                                          vectorized::AggregateDataPtr>());
303
2
                            RETURN_IF_ERROR(st);
304
2
                        }
305
306
76
                        aggregate_data_container.reset(new AggregateDataContainer(
307
76
                                sizeof(typename HashTableType::key_type),
308
76
                                ((total_size_of_aggregate_states + align_aggregate_states - 1) /
309
76
                                 align_aggregate_states) *
310
76
                                        align_aggregate_states));
311
76
                        agg_method.hash_table.reset(new HashTableType());
312
76
                        agg_arena_pool.reset(new vectorized::Arena);
313
76
                        return Status::OK();
314
76
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberIjNS4_15DataWithNullKeyI9PHHashMapIjPc14HashMixWrapperIj9HashCRC32IjEEEEEEEEEEEDaRT_
Line
Count
Source
287
475
                    [&](auto& agg_method) {
288
475
                        auto& hash_table = *agg_method.hash_table;
289
475
                        using HashTableType = std::decay_t<decltype(hash_table)>;
290
291
475
                        agg_method.reset();
292
293
475
                        hash_table.for_each_mapped([&](auto& mapped) {
294
475
                            if (mapped) {
295
475
                                static_cast<void>(_destroy_agg_status(mapped));
296
475
                                mapped = nullptr;
297
475
                            }
298
475
                        });
299
300
475
                        if (hash_table.has_null_key_data()) {
301
2
                            auto st = _destroy_agg_status(hash_table.template get_null_key_data<
302
2
                                                          vectorized::AggregateDataPtr>());
303
2
                            RETURN_IF_ERROR(st);
304
2
                        }
305
306
475
                        aggregate_data_container.reset(new AggregateDataContainer(
307
475
                                sizeof(typename HashTableType::key_type),
308
475
                                ((total_size_of_aggregate_states + align_aggregate_states - 1) /
309
475
                                 align_aggregate_states) *
310
475
                                        align_aggregate_states));
311
475
                        agg_method.hash_table.reset(new HashTableType());
312
475
                        agg_arena_pool.reset(new vectorized::Arena);
313
475
                        return Status::OK();
314
475
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberImNS4_15DataWithNullKeyI9PHHashMapImPc14HashMixWrapperIm9HashCRC32ImEEEEEEEEEEEDaRT_
Line
Count
Source
287
142
                    [&](auto& agg_method) {
288
142
                        auto& hash_table = *agg_method.hash_table;
289
142
                        using HashTableType = std::decay_t<decltype(hash_table)>;
290
291
142
                        agg_method.reset();
292
293
142
                        hash_table.for_each_mapped([&](auto& mapped) {
294
142
                            if (mapped) {
295
142
                                static_cast<void>(_destroy_agg_status(mapped));
296
142
                                mapped = nullptr;
297
142
                            }
298
142
                        });
299
300
142
                        if (hash_table.has_null_key_data()) {
301
6
                            auto st = _destroy_agg_status(hash_table.template get_null_key_data<
302
6
                                                          vectorized::AggregateDataPtr>());
303
6
                            RETURN_IF_ERROR(st);
304
6
                        }
305
306
142
                        aggregate_data_container.reset(new AggregateDataContainer(
307
142
                                sizeof(typename HashTableType::key_type),
308
142
                                ((total_size_of_aggregate_states + align_aggregate_states - 1) /
309
142
                                 align_aggregate_states) *
310
142
                                        align_aggregate_states));
311
142
                        agg_method.hash_table.reset(new HashTableType());
312
142
                        agg_arena_pool.reset(new vectorized::Arena);
313
142
                        return Status::OK();
314
142
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberIN4wide7integerILm128EjEENS4_15DataWithNullKeyI9PHHashMapIS9_Pc9HashCRC32IS9_EEEEEEEEEEDaRT_
Line
Count
Source
287
42
                    [&](auto& agg_method) {
288
42
                        auto& hash_table = *agg_method.hash_table;
289
42
                        using HashTableType = std::decay_t<decltype(hash_table)>;
290
291
42
                        agg_method.reset();
292
293
42
                        hash_table.for_each_mapped([&](auto& mapped) {
294
42
                            if (mapped) {
295
42
                                static_cast<void>(_destroy_agg_status(mapped));
296
42
                                mapped = nullptr;
297
42
                            }
298
42
                        });
299
300
42
                        if (hash_table.has_null_key_data()) {
301
3
                            auto st = _destroy_agg_status(hash_table.template get_null_key_data<
302
3
                                                          vectorized::AggregateDataPtr>());
303
3
                            RETURN_IF_ERROR(st);
304
3
                        }
305
306
42
                        aggregate_data_container.reset(new AggregateDataContainer(
307
42
                                sizeof(typename HashTableType::key_type),
308
42
                                ((total_size_of_aggregate_states + align_aggregate_states - 1) /
309
42
                                 align_aggregate_states) *
310
42
                                        align_aggregate_states));
311
42
                        agg_method.hash_table.reset(new HashTableType());
312
42
                        agg_arena_pool.reset(new vectorized::Arena);
313
42
                        return Status::OK();
314
42
                    }},
Unexecuted instantiation: dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberIN4wide7integerILm256EjEENS4_15DataWithNullKeyI9PHHashMapIS9_Pc9HashCRC32IS9_EEEEEEEEEEDaRT_
dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized26MethodSingleNullableColumnINS4_19MethodStringNoCacheINS4_15DataWithNullKeyINS_13StringHashMapIPcNS_9AllocatorILb1ELb1ELb0ENS_22DefaultMemoryAllocatorEEEEEEEEEEEEEDaRT_
Line
Count
Source
287
1.32k
                    [&](auto& agg_method) {
288
1.32k
                        auto& hash_table = *agg_method.hash_table;
289
1.32k
                        using HashTableType = std::decay_t<decltype(hash_table)>;
290
291
1.32k
                        agg_method.reset();
292
293
1.32k
                        hash_table.for_each_mapped([&](auto& mapped) {
294
1.32k
                            if (mapped) {
295
1.32k
                                static_cast<void>(_destroy_agg_status(mapped));
296
1.32k
                                mapped = nullptr;
297
1.32k
                            }
298
1.32k
                        });
299
300
1.32k
                        if (hash_table.has_null_key_data()) {
301
52
                            auto st = _destroy_agg_status(hash_table.template get_null_key_data<
302
52
                                                          vectorized::AggregateDataPtr>());
303
52
                            RETURN_IF_ERROR(st);
304
52
                        }
305
306
1.32k
                        aggregate_data_container.reset(new AggregateDataContainer(
307
1.32k
                                sizeof(typename HashTableType::key_type),
308
1.32k
                                ((total_size_of_aggregate_states + align_aggregate_states - 1) /
309
1.32k
                                 align_aggregate_states) *
310
1.32k
                                        align_aggregate_states));
311
1.32k
                        agg_method.hash_table.reset(new HashTableType());
312
1.32k
                        agg_arena_pool.reset(new vectorized::Arena);
313
1.32k
                        return Status::OK();
314
1.32k
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodKeysFixedI9PHHashMapImPc9HashCRC32ImEEEEEEDaRT_
Line
Count
Source
287
686
                    [&](auto& agg_method) {
288
686
                        auto& hash_table = *agg_method.hash_table;
289
686
                        using HashTableType = std::decay_t<decltype(hash_table)>;
290
291
686
                        agg_method.reset();
292
293
686
                        hash_table.for_each_mapped([&](auto& mapped) {
294
686
                            if (mapped) {
295
686
                                static_cast<void>(_destroy_agg_status(mapped));
296
686
                                mapped = nullptr;
297
686
                            }
298
686
                        });
299
300
686
                        if (hash_table.has_null_key_data()) {
301
0
                            auto st = _destroy_agg_status(hash_table.template get_null_key_data<
302
0
                                                          vectorized::AggregateDataPtr>());
303
0
                            RETURN_IF_ERROR(st);
304
0
                        }
305
306
686
                        aggregate_data_container.reset(new AggregateDataContainer(
307
686
                                sizeof(typename HashTableType::key_type),
308
686
                                ((total_size_of_aggregate_states + align_aggregate_states - 1) /
309
686
                                 align_aggregate_states) *
310
686
                                        align_aggregate_states));
311
686
                        agg_method.hash_table.reset(new HashTableType());
312
686
                        agg_arena_pool.reset(new vectorized::Arena);
313
686
                        return Status::OK();
314
686
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodKeysFixedI9PHHashMapIN4wide7integerILm128EjEEPc9HashCRC32IS9_EEEEEEDaRT_
Line
Count
Source
287
2.97k
                    [&](auto& agg_method) {
288
2.97k
                        auto& hash_table = *agg_method.hash_table;
289
2.97k
                        using HashTableType = std::decay_t<decltype(hash_table)>;
290
291
2.97k
                        agg_method.reset();
292
293
2.97k
                        hash_table.for_each_mapped([&](auto& mapped) {
294
2.97k
                            if (mapped) {
295
2.97k
                                static_cast<void>(_destroy_agg_status(mapped));
296
2.97k
                                mapped = nullptr;
297
2.97k
                            }
298
2.97k
                        });
299
300
2.97k
                        if (hash_table.has_null_key_data()) {
301
0
                            auto st = _destroy_agg_status(hash_table.template get_null_key_data<
302
0
                                                          vectorized::AggregateDataPtr>());
303
0
                            RETURN_IF_ERROR(st);
304
0
                        }
305
306
2.97k
                        aggregate_data_container.reset(new AggregateDataContainer(
307
2.97k
                                sizeof(typename HashTableType::key_type),
308
2.97k
                                ((total_size_of_aggregate_states + align_aggregate_states - 1) /
309
2.97k
                                 align_aggregate_states) *
310
2.97k
                                        align_aggregate_states));
311
2.97k
                        agg_method.hash_table.reset(new HashTableType());
312
2.97k
                        agg_arena_pool.reset(new vectorized::Arena);
313
2.97k
                        return Status::OK();
314
2.97k
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodKeysFixedI9PHHashMapIN4wide7integerILm256EjEEPc9HashCRC32IS9_EEEEEEDaRT_
Line
Count
Source
287
408
                    [&](auto& agg_method) {
288
408
                        auto& hash_table = *agg_method.hash_table;
289
408
                        using HashTableType = std::decay_t<decltype(hash_table)>;
290
291
408
                        agg_method.reset();
292
293
408
                        hash_table.for_each_mapped([&](auto& mapped) {
294
408
                            if (mapped) {
295
408
                                static_cast<void>(_destroy_agg_status(mapped));
296
408
                                mapped = nullptr;
297
408
                            }
298
408
                        });
299
300
408
                        if (hash_table.has_null_key_data()) {
301
0
                            auto st = _destroy_agg_status(hash_table.template get_null_key_data<
302
0
                                                          vectorized::AggregateDataPtr>());
303
0
                            RETURN_IF_ERROR(st);
304
0
                        }
305
306
408
                        aggregate_data_container.reset(new AggregateDataContainer(
307
408
                                sizeof(typename HashTableType::key_type),
308
408
                                ((total_size_of_aggregate_states + align_aggregate_states - 1) /
309
408
                                 align_aggregate_states) *
310
408
                                        align_aggregate_states));
311
408
                        agg_method.hash_table.reset(new HashTableType());
312
408
                        agg_arena_pool.reset(new vectorized::Arena);
313
408
                        return Status::OK();
314
408
                    }},
dependency.cpp:_ZZN5doris8pipeline14AggSharedState16reset_hash_tableEvENK3$_1clINS_10vectorized15MethodKeysFixedI9PHHashMapINS4_7UInt136EPc9HashCRC32IS7_EEEEEEDaRT_
Line
Count
Source
287
1.11k
                    [&](auto& agg_method) {
288
1.11k
                        auto& hash_table = *agg_method.hash_table;
289
1.11k
                        using HashTableType = std::decay_t<decltype(hash_table)>;
290
291
1.11k
                        agg_method.reset();
292
293
1.11k
                        hash_table.for_each_mapped([&](auto& mapped) {
294
1.11k
                            if (mapped) {
295
1.11k
                                static_cast<void>(_destroy_agg_status(mapped));
296
1.11k
                                mapped = nullptr;
297
1.11k
                            }
298
1.11k
                        });
299
300
1.11k
                        if (hash_table.has_null_key_data()) {
301
0
                            auto st = _destroy_agg_status(hash_table.template get_null_key_data<
302
0
                                                          vectorized::AggregateDataPtr>());
303
0
                            RETURN_IF_ERROR(st);
304
0
                        }
305
306
1.11k
                        aggregate_data_container.reset(new AggregateDataContainer(
307
1.11k
                                sizeof(typename HashTableType::key_type),
308
1.11k
                                ((total_size_of_aggregate_states + align_aggregate_states - 1) /
309
1.11k
                                 align_aggregate_states) *
310
1.11k
                                        align_aggregate_states));
311
1.11k
                        agg_method.hash_table.reset(new HashTableType());
312
1.11k
                        agg_arena_pool.reset(new vectorized::Arena);
313
1.11k
                        return Status::OK();
314
1.11k
                    }},
315
29.7k
            agg_data->method_variant);
316
29.7k
}
317
318
36.1k
void PartitionedAggSharedState::init_spill_params(size_t spill_partition_count) {
319
36.1k
    partition_count = spill_partition_count;
320
36.1k
    max_partition_index = partition_count - 1;
321
322
1.19M
    for (int i = 0; i < partition_count; ++i) {
323
1.15M
        spill_partitions.emplace_back(std::make_shared<AggSpillPartition>());
324
1.15M
    }
325
36.1k
}
326
327
35.9k
void PartitionedAggSharedState::update_spill_stream_profiles(RuntimeProfile* source_profile) {
328
1.14M
    for (auto& partition : spill_partitions) {
329
1.14M
        if (partition->spilling_stream_) {
330
0
            partition->spilling_stream_->update_shared_profiles(source_profile);
331
0
        }
332
1.14M
        for (auto& stream : partition->spill_streams_) {
333
14.3k
            if (stream) {
334
14.3k
                stream->update_shared_profiles(source_profile);
335
14.3k
            }
336
14.3k
        }
337
1.14M
    }
338
35.9k
}
339
340
Status AggSpillPartition::get_spill_stream(RuntimeState* state, int node_id,
341
                                           RuntimeProfile* profile,
342
194k
                                           vectorized::SpillStreamSPtr& spill_stream) {
343
194k
    if (spilling_stream_) {
344
181k
        spill_stream = spilling_stream_;
345
181k
        return Status::OK();
346
181k
    }
347
13.3k
    RETURN_IF_ERROR(ExecEnv::GetInstance()->spill_stream_mgr()->register_spill_stream(
348
13.3k
            state, spilling_stream_, print_id(state->query_id()), "agg", node_id,
349
13.3k
            std::numeric_limits<int32_t>::max(), std::numeric_limits<size_t>::max(), profile));
350
13.3k
    spill_streams_.emplace_back(spilling_stream_);
351
13.3k
    spill_stream = spilling_stream_;
352
13.3k
    return Status::OK();
353
13.3k
}
354
1.08M
void AggSpillPartition::close() {
355
1.08M
    if (spilling_stream_) {
356
1
        spilling_stream_.reset();
357
1
    }
358
1.08M
    for (auto& stream : spill_streams_) {
359
5
        (void)ExecEnv::GetInstance()->spill_stream_mgr()->delete_spill_stream(stream);
360
5
    }
361
1.08M
    spill_streams_.clear();
362
1.08M
}
363
364
37.6k
void PartitionedAggSharedState::close() {
365
    // need to use CAS instead of only `if (!is_closed)` statement,
366
    // to avoid concurrent entry of close() both pass the if statement
367
37.6k
    bool false_close = false;
368
37.6k
    if (!is_closed.compare_exchange_strong(false_close, true)) {
369
1.64k
        return;
370
1.64k
    }
371
36.0k
    DCHECK(!false_close && is_closed);
372
1.08M
    for (auto partition : spill_partitions) {
373
1.08M
        partition->close();
374
1.08M
    }
375
36.0k
    spill_partitions.clear();
376
36.0k
}
377
378
161k
void SpillSortSharedState::update_spill_stream_profiles(RuntimeProfile* source_profile) {
379
161k
    for (auto& stream : sorted_streams) {
380
39
        if (stream) {
381
39
            stream->update_shared_profiles(source_profile);
382
39
        }
383
39
    }
384
161k
}
385
386
161k
void SpillSortSharedState::close() {
387
    // need to use CAS instead of only `if (!is_closed)` statement,
388
    // to avoid concurrent entry of close() both pass the if statement
389
161k
    bool false_close = false;
390
161k
    if (!is_closed.compare_exchange_strong(false_close, true)) {
391
2
        return;
392
2
    }
393
161k
    DCHECK(!false_close && is_closed);
394
161k
    for (auto& stream : sorted_streams) {
395
1
        (void)ExecEnv::GetInstance()->spill_stream_mgr()->delete_spill_stream(stream);
396
1
    }
397
161k
    sorted_streams.clear();
398
161k
}
399
400
MultiCastSharedState::MultiCastSharedState(ObjectPool* pool, int cast_sender_count, int node_id)
401
        : multi_cast_data_streamer(std::make_unique<pipeline::MultiCastDataStreamer>(
402
1.50k
                  this, pool, cast_sender_count, node_id)) {}
403
404
0
void MultiCastSharedState::update_spill_stream_profiles(RuntimeProfile* source_profile) {}
405
406
126k
int AggSharedState::get_slot_column_id(const vectorized::AggFnEvaluator* evaluator) {
407
126k
    auto ctxs = evaluator->input_exprs_ctxs();
408
18.4E
    CHECK(ctxs.size() == 1 && ctxs[0]->root()->is_slot_ref())
409
18.4E
            << "input_exprs_ctxs is invalid, input_exprs_ctx[0]="
410
18.4E
            << ctxs[0]->root()->debug_string();
411
126k
    return ((vectorized::VSlotRef*)ctxs[0]->root().get())->column_id();
412
126k
}
413
414
5.26M
Status AggSharedState::_destroy_agg_status(vectorized::AggregateDataPtr data) {
415
10.8M
    for (int i = 0; i < aggregate_evaluators.size(); ++i) {
416
5.60M
        aggregate_evaluators[i]->function()->destroy(data + offsets_of_aggregate_states[i]);
417
5.60M
    }
418
5.26M
    return Status::OK();
419
5.26M
}
420
421
55.6k
LocalExchangeSharedState::~LocalExchangeSharedState() = default;
422
423
1.07k
Status SetSharedState::update_build_not_ignore_null(const vectorized::VExprContextSPtrs& ctxs) {
424
1.07k
    if (ctxs.size() > build_not_ignore_null.size()) {
425
0
        return Status::InternalError("build_not_ignore_null not initialized");
426
0
    }
427
428
2.66k
    for (int i = 0; i < ctxs.size(); ++i) {
429
1.58k
        build_not_ignore_null[i] = build_not_ignore_null[i] || ctxs[i]->root()->is_nullable();
430
1.58k
    }
431
432
1.07k
    return Status::OK();
433
1.07k
}
434
435
1.07k
size_t SetSharedState::get_hash_table_size() const {
436
1.07k
    size_t hash_table_size = 0;
437
1.07k
    std::visit(
438
1.07k
            [&](auto&& arg) {
439
1.07k
                using HashTableCtxType = std::decay_t<decltype(arg)>;
440
1.07k
                if constexpr (!std::is_same_v<HashTableCtxType, std::monostate>) {
441
1.07k
                    hash_table_size = arg.hash_table->size();
442
1.07k
                }
443
1.07k
            },
Unexecuted instantiation: dependency.cpp:_ZZNK5doris8pipeline14SetSharedState19get_hash_table_sizeEvENK3$_0clIRSt9monostateEEDaOT_
dependency.cpp:_ZZNK5doris8pipeline14SetSharedState19get_hash_table_sizeEvENK3$_0clIRNS_10vectorized16MethodSerializedI9PHHashMapINS_9StringRefENS_14RowRefWithFlagE11DefaultHashIS7_vEEEEEEDaOT_
Line
Count
Source
438
348
            [&](auto&& arg) {
439
348
                using HashTableCtxType = std::decay_t<decltype(arg)>;
440
348
                if constexpr (!std::is_same_v<HashTableCtxType, std::monostate>) {
441
348
                    hash_table_size = arg.hash_table->size();
442
348
                }
443
348
            },
dependency.cpp:_ZZNK5doris8pipeline14SetSharedState19get_hash_table_sizeEvENK3$_0clIRNS_10vectorized19MethodStringNoCacheI9PHHashMapINS_9StringRefENS_14RowRefWithFlagE11DefaultHashIS7_vEEEEEEDaOT_
Line
Count
Source
438
217
            [&](auto&& arg) {
439
217
                using HashTableCtxType = std::decay_t<decltype(arg)>;
440
217
                if constexpr (!std::is_same_v<HashTableCtxType, std::monostate>) {
441
217
                    hash_table_size = arg.hash_table->size();
442
217
                }
443
217
            },
dependency.cpp:_ZZNK5doris8pipeline14SetSharedState19get_hash_table_sizeEvENK3$_0clIRNS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberIhNS4_15DataWithNullKeyI9PHHashMapIhNS_14RowRefWithFlagE9HashCRC32IhEEEEEEEEEEDaOT_
Line
Count
Source
438
46
            [&](auto&& arg) {
439
46
                using HashTableCtxType = std::decay_t<decltype(arg)>;
440
46
                if constexpr (!std::is_same_v<HashTableCtxType, std::monostate>) {
441
46
                    hash_table_size = arg.hash_table->size();
442
46
                }
443
46
            },
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
438
232
            [&](auto&& arg) {
439
232
                using HashTableCtxType = std::decay_t<decltype(arg)>;
440
232
                if constexpr (!std::is_same_v<HashTableCtxType, std::monostate>) {
441
232
                    hash_table_size = arg.hash_table->size();
442
232
                }
443
232
            },
dependency.cpp:_ZZNK5doris8pipeline14SetSharedState19get_hash_table_sizeEvENK3$_0clIRNS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberImNS4_15DataWithNullKeyI9PHHashMapImNS_14RowRefWithFlagE9HashCRC32ImEEEEEEEEEEDaOT_
Line
Count
Source
438
38
            [&](auto&& arg) {
439
38
                using HashTableCtxType = std::decay_t<decltype(arg)>;
440
38
                if constexpr (!std::is_same_v<HashTableCtxType, std::monostate>) {
441
38
                    hash_table_size = arg.hash_table->size();
442
38
                }
443
38
            },
dependency.cpp:_ZZNK5doris8pipeline14SetSharedState19get_hash_table_sizeEvENK3$_0clIRNS_10vectorized26MethodSingleNullableColumnINS4_15MethodOneNumberIN4wide7integerILm128EjEENS4_15DataWithNullKeyI9PHHashMapIS9_NS_14RowRefWithFlagE9HashCRC32IS9_EEEEEEEEEEDaOT_
Line
Count
Source
438
24
            [&](auto&& arg) {
439
24
                using HashTableCtxType = std::decay_t<decltype(arg)>;
440
24
                if constexpr (!std::is_same_v<HashTableCtxType, std::monostate>) {
441
24
                    hash_table_size = arg.hash_table->size();
442
24
                }
443
24
            },
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
438
28
            [&](auto&& arg) {
439
28
                using HashTableCtxType = std::decay_t<decltype(arg)>;
440
28
                if constexpr (!std::is_same_v<HashTableCtxType, std::monostate>) {
441
28
                    hash_table_size = arg.hash_table->size();
442
28
                }
443
28
            },
dependency.cpp:_ZZNK5doris8pipeline14SetSharedState19get_hash_table_sizeEvENK3$_0clIRNS_10vectorized15MethodOneNumberIm9PHHashMapImNS_14RowRefWithFlagE9HashCRC32ImEEEEEEDaOT_
Line
Count
Source
438
8
            [&](auto&& arg) {
439
8
                using HashTableCtxType = std::decay_t<decltype(arg)>;
440
8
                if constexpr (!std::is_same_v<HashTableCtxType, std::monostate>) {
441
8
                    hash_table_size = arg.hash_table->size();
442
8
                }
443
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
438
26
            [&](auto&& arg) {
439
26
                using HashTableCtxType = std::decay_t<decltype(arg)>;
440
26
                if constexpr (!std::is_same_v<HashTableCtxType, std::monostate>) {
441
26
                    hash_table_size = arg.hash_table->size();
442
26
                }
443
26
            },
dependency.cpp:_ZZNK5doris8pipeline14SetSharedState19get_hash_table_sizeEvENK3$_0clIRNS_10vectorized15MethodKeysFixedI9PHHashMapIN4wide7integerILm128EjEENS_14RowRefWithFlagE9HashCRC32IS9_EEEEEEDaOT_
Line
Count
Source
438
84
            [&](auto&& arg) {
439
84
                using HashTableCtxType = std::decay_t<decltype(arg)>;
440
84
                if constexpr (!std::is_same_v<HashTableCtxType, std::monostate>) {
441
84
                    hash_table_size = arg.hash_table->size();
442
84
                }
443
84
            },
dependency.cpp:_ZZNK5doris8pipeline14SetSharedState19get_hash_table_sizeEvENK3$_0clIRNS_10vectorized15MethodKeysFixedI9PHHashMapIN4wide7integerILm256EjEENS_14RowRefWithFlagE9HashCRC32IS9_EEEEEEDaOT_
Line
Count
Source
438
2
            [&](auto&& arg) {
439
2
                using HashTableCtxType = std::decay_t<decltype(arg)>;
440
2
                if constexpr (!std::is_same_v<HashTableCtxType, std::monostate>) {
441
2
                    hash_table_size = arg.hash_table->size();
442
2
                }
443
2
            },
dependency.cpp:_ZZNK5doris8pipeline14SetSharedState19get_hash_table_sizeEvENK3$_0clIRNS_10vectorized15MethodKeysFixedI9PHHashMapINS4_7UInt136ENS_14RowRefWithFlagE9HashCRC32IS7_EEEEEEDaOT_
Line
Count
Source
438
17
            [&](auto&& arg) {
439
17
                using HashTableCtxType = std::decay_t<decltype(arg)>;
440
17
                if constexpr (!std::is_same_v<HashTableCtxType, std::monostate>) {
441
17
                    hash_table_size = arg.hash_table->size();
442
17
                }
443
17
            },
444
1.07k
            hash_table_variants->method_variant);
445
1.07k
    return hash_table_size;
446
1.07k
}
447
448
519
Status SetSharedState::hash_table_init() {
449
519
    std::vector<vectorized::DataTypePtr> data_types;
450
1.28k
    for (size_t i = 0; i != child_exprs_lists[0].size(); ++i) {
451
767
        auto& ctx = child_exprs_lists[0][i];
452
767
        auto data_type = ctx->root()->data_type();
453
767
        if (build_not_ignore_null[i]) {
454
461
            data_type = vectorized::make_nullable(data_type);
455
461
        }
456
767
        data_types.emplace_back(std::move(data_type));
457
767
    }
458
519
    return init_hash_method<SetDataVariants>(hash_table_variants.get(), data_types, true);
459
519
}
460
461
void AggSharedState::refresh_top_limit(size_t row_id,
462
141
                                       const vectorized::ColumnRawPtrs& key_columns) {
463
580
    for (int j = 0; j < key_columns.size(); ++j) {
464
439
        limit_columns[j]->insert_from(*key_columns[j], row_id);
465
439
    }
466
141
    limit_heap.emplace(limit_columns[0]->size() - 1, limit_columns, order_directions,
467
141
                       null_directions);
468
469
141
    limit_heap.pop();
470
141
    limit_columns_min = limit_heap.top()._row_id;
471
141
}
472
473
} // namespace doris::pipeline