Coverage Report

Created: 2026-04-10 04:05

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
be/src/exec/operator/operator.h
Line
Count
Source
1
// Licensed to the Apache Software Foundation (ASF) under one
2
// or more contributor license agreements.  See the NOTICE file
3
// distributed with this work for additional information
4
// regarding copyright ownership.  The ASF licenses this file
5
// to you under the Apache License, Version 2.0 (the
6
// "License"); you may not use this file except in compliance
7
// with the License.  You may obtain a copy of the License at
8
//
9
//   http://www.apache.org/licenses/LICENSE-2.0
10
//
11
// Unless required by applicable law or agreed to in writing,
12
// software distributed under the License is distributed on an
13
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
// KIND, either express or implied.  See the License for the
15
// specific language governing permissions and limitations
16
// under the License.
17
18
#pragma once
19
20
#include <fmt/format.h>
21
#include <glog/logging.h>
22
23
#include <atomic>
24
#include <cstdint>
25
#include <functional>
26
#include <memory>
27
#include <string>
28
#include <utility>
29
#include <vector>
30
31
#include "common/be_mock_util.h"
32
#include "common/exception.h"
33
#include "common/logging.h"
34
#include "common/status.h"
35
#include "core/block/block.h"
36
#include "exec/exchange/local_exchanger.h"
37
#include "exec/exchange/vdata_stream_recvr.h"
38
#include "exec/operator/operator.h"
39
#include "exec/operator/spill_counters.h"
40
#include "exec/operator/spill_utils.h"
41
#include "exec/pipeline/dependency.h"
42
#include "runtime/memory/mem_tracker.h"
43
#include "runtime/query_context.h"
44
#include "runtime/runtime_profile.h"
45
#include "runtime/runtime_profile_counter_names.h"
46
#include "runtime/runtime_state.h"
47
#include "runtime/thread_context.h"
48
49
namespace doris {
50
class RowDescriptor;
51
class RuntimeState;
52
class TDataSink;
53
class AsyncResultWriter;
54
class ScoreRuntime;
55
class AnnTopNRuntime;
56
} // namespace doris
57
58
namespace doris {
59
60
class OperatorBase;
61
class OperatorXBase;
62
class DataSinkOperatorXBase;
63
64
using OperatorPtr = std::shared_ptr<OperatorXBase>;
65
using Operators = std::vector<OperatorPtr>;
66
67
using DataSinkOperatorPtr = std::shared_ptr<DataSinkOperatorXBase>;
68
69
// This struct is used only for initializing local state.
70
struct LocalStateInfo {
71
    RuntimeProfile* parent_profile = nullptr;
72
    const std::vector<TScanRangeParams>& scan_ranges;
73
    BasicSharedState* shared_state;
74
    const std::map<int, std::pair<std::shared_ptr<BasicSharedState>,
75
                                  std::vector<std::shared_ptr<Dependency>>>>& shared_state_map;
76
    const int task_idx;
77
};
78
79
// This struct is used only for initializing local sink state.
80
struct LocalSinkStateInfo {
81
    const int task_idx;
82
    RuntimeProfile* parent_profile = nullptr;
83
    const int sender_id;
84
    BasicSharedState* shared_state;
85
    const std::map<int, std::pair<std::shared_ptr<BasicSharedState>,
86
                                  std::vector<std::shared_ptr<Dependency>>>>& shared_state_map;
87
    const TDataSink& tsink;
88
};
89
90
class OperatorBase {
91
public:
92
217k
    explicit OperatorBase() : _child(nullptr), _is_closed(false) {}
93
    explicit OperatorBase(bool is_serial_operator)
94
144k
            : _child(nullptr), _is_closed(false), _is_serial_operator(is_serial_operator) {}
95
361k
    virtual ~OperatorBase() = default;
96
97
0
    virtual bool is_sink() const { return false; }
98
99
120
    virtual bool is_source() const { return false; }
100
101
    [[nodiscard]] virtual const RowDescriptor& row_desc() const;
102
103
0
    [[nodiscard]] virtual Status init(const TDataSink& tsink) { return Status::OK(); }
104
105
    [[nodiscard]] virtual std::string get_name() const = 0;
106
    [[nodiscard]] virtual Status prepare(RuntimeState* state) = 0;
107
    [[nodiscard]] virtual Status terminate(RuntimeState* state) = 0;
108
    [[nodiscard]] virtual Status close(RuntimeState* state);
109
    [[nodiscard]] virtual int node_id() const = 0;
110
24
    [[nodiscard]] virtual int parallelism(RuntimeState* state) const {
111
24
        return _is_serial_operator ? 1 : state->query_parallel_instance_num();
112
24
    }
113
114
144k
    [[nodiscard]] virtual Status set_child(OperatorPtr child) {
115
144k
        if (_child && child != nullptr) {
116
0
            return Status::InternalError("Child is already set in node name={}", get_name());
117
0
        }
118
144k
        _child = child;
119
144k
        return Status::OK();
120
144k
    }
121
122
    // Operators need to be executed serially. (e.g. finalized agg without key)
123
144k
    [[nodiscard]] virtual bool is_serial_operator() const { return _is_serial_operator; }
124
125
1
    [[nodiscard]] bool is_closed() const { return _is_closed; }
126
127
0
    virtual size_t revocable_mem_size(RuntimeState* state) const { return 0; }
128
129
0
    virtual Status revoke_memory(RuntimeState* state) { return Status::OK(); }
130
131
0
    virtual bool is_hash_join_probe() const { return false; }
132
133
    /**
134
     * Pipeline task is blockable means it will be blocked in the next run. So we should put the
135
     * pipeline task into the blocking task scheduler.
136
     */
137
    virtual bool is_blockable(RuntimeState* state) const = 0;
138
0
    virtual void set_low_memory_mode(RuntimeState* state) {}
139
140
48.0k
    OperatorPtr child() { return _child; }
141
0
    virtual Status reset(RuntimeState* state) {
142
0
        return Status::InternalError("Reset is not implemented in operator: {}", get_name());
143
0
    }
144
145
    /* -------------- Interfaces to determine the input data properties -------------- */
146
    /**
147
     * Return True if this operator relies on the bucket distribution (e.g. COLOCATE join, 1-phase AGG).
148
     * Data input to this kind of operators must have the same distribution with the table buckets.
149
     * It is also means `required_data_distribution` should be `BUCKET_HASH_SHUFFLE`.
150
     * @return
151
     */
152
385
    [[nodiscard]] virtual bool is_colocated_operator() const { return false; }
153
    /**
154
     * Return True if this operator relies on the bucket distribution or specific hash data distribution (e.g. SHUFFLED HASH join).
155
     * Data input to this kind of operators must be HASH distributed according to some rules.
156
     * All colocated operators are also shuffled operators.
157
     * It is also means `required_data_distribution` should be `BUCKET_HASH_SHUFFLE` or `HASH_SHUFFLE`.
158
     * @return
159
     */
160
385
    [[nodiscard]] virtual bool is_shuffled_operator() const { return false; }
161
    /**
162
     * For multiple children's operators, return true if this is a shuffled operator or this is followed by a shuffled operator (HASH JOIN and SET OPERATION).
163
     *
164
     * For single child's operators, return true if this operator is followed by a shuffled operator.
165
     * For example, in the plan fragment:
166
     *   `UNION` -> `SHUFFLED HASH JOIN`
167
     * The `SHUFFLED HASH JOIN` is a shuffled operator so the UNION operator is followed by a shuffled operator.
168
     */
169
519
    [[nodiscard]] virtual bool followed_by_shuffled_operator() const {
170
519
        return _followed_by_shuffled_operator;
171
519
    }
172
    /**
173
     * Update the operator properties according to the plan node.
174
     * This is called before `prepare`.
175
     */
176
    virtual void update_operator(const TPlanNode& tnode, bool followed_by_shuffled_operator,
177
0
                                 bool require_bucket_distribution) {
178
0
        _followed_by_shuffled_operator = followed_by_shuffled_operator;
179
0
        _require_bucket_distribution = require_bucket_distribution;
180
0
    }
181
    /**
182
     * Return the required data distribution of this operator.
183
     */
184
    [[nodiscard]] virtual DataDistribution required_data_distribution(
185
            RuntimeState* /*state*/) const;
186
187
protected:
188
    OperatorPtr _child = nullptr;
189
190
    bool _is_closed;
191
    bool _followed_by_shuffled_operator = false;
192
    bool _require_bucket_distribution = false;
193
    bool _is_serial_operator = false;
194
};
195
196
class PipelineXLocalStateBase {
197
public:
198
    PipelineXLocalStateBase(RuntimeState* state, OperatorXBase* parent);
199
24.5k
    virtual ~PipelineXLocalStateBase() = default;
200
201
    template <class TARGET>
202
2.90M
    TARGET& cast() {
203
2.90M
        DCHECK(dynamic_cast<TARGET*>(this))
204
0
                << " Mismatch type! Current type is " << typeid(*this).name()
205
0
                << " and expect type is" << typeid(TARGET).name();
206
2.90M
        return reinterpret_cast<TARGET&>(*this);
207
2.90M
    }
_ZN5doris23PipelineXLocalStateBase4castINS_23DummyOperatorLocalStateEEERT_v
Line
Count
Source
202
2.90M
    TARGET& cast() {
203
2.90M
        DCHECK(dynamic_cast<TARGET*>(this))
204
0
                << " Mismatch type! Current type is " << typeid(*this).name()
205
0
                << " and expect type is" << typeid(TARGET).name();
206
2.90M
        return reinterpret_cast<TARGET&>(*this);
207
2.90M
    }
_ZN5doris23PipelineXLocalStateBase4castINS_13AggLocalStateEEERT_v
Line
Count
Source
202
130
    TARGET& cast() {
203
130
        DCHECK(dynamic_cast<TARGET*>(this))
204
0
                << " Mismatch type! Current type is " << typeid(*this).name()
205
0
                << " and expect type is" << typeid(TARGET).name();
206
130
        return reinterpret_cast<TARGET&>(*this);
207
130
    }
_ZN5doris23PipelineXLocalStateBase4castINS_18AnalyticLocalStateEEERT_v
Line
Count
Source
202
46
    TARGET& cast() {
203
46
        DCHECK(dynamic_cast<TARGET*>(this))
204
0
                << " Mismatch type! Current type is " << typeid(*this).name()
205
0
                << " and expect type is" << typeid(TARGET).name();
206
46
        return reinterpret_cast<TARGET&>(*this);
207
46
    }
_ZN5doris23PipelineXLocalStateBase4castINS_23AssertNumRowsLocalStateEEERT_v
Line
Count
Source
202
4
    TARGET& cast() {
203
4
        DCHECK(dynamic_cast<TARGET*>(this))
204
0
                << " Mismatch type! Current type is " << typeid(*this).name()
205
0
                << " and expect type is" << typeid(TARGET).name();
206
4
        return reinterpret_cast<TARGET&>(*this);
207
4
    }
Unexecuted instantiation: _ZN5doris23PipelineXLocalStateBase4castINS_14MockLocalStateEEERT_v
_ZN5doris23PipelineXLocalStateBase4castINS_17DataGenLocalStateEEERT_v
Line
Count
Source
202
3
    TARGET& cast() {
203
3
        DCHECK(dynamic_cast<TARGET*>(this))
204
0
                << " Mismatch type! Current type is " << typeid(*this).name()
205
0
                << " and expect type is" << typeid(TARGET).name();
206
3
        return reinterpret_cast<TARGET&>(*this);
207
3
    }
_ZN5doris23PipelineXLocalStateBase4castINS_30DistinctStreamingAggLocalStateEEERT_v
Line
Count
Source
202
24
    TARGET& cast() {
203
24
        DCHECK(dynamic_cast<TARGET*>(this))
204
0
                << " Mismatch type! Current type is " << typeid(*this).name()
205
0
                << " and expect type is" << typeid(TARGET).name();
206
24
        return reinterpret_cast<TARGET&>(*this);
207
24
    }
Unexecuted instantiation: _ZN5doris23PipelineXLocalStateBase4castINS_18EmptySetLocalStateEEERT_v
_ZN5doris23PipelineXLocalStateBase4castINS_18ExchangeLocalStateEEERT_v
Line
Count
Source
202
48
    TARGET& cast() {
203
48
        DCHECK(dynamic_cast<TARGET*>(this))
204
0
                << " Mismatch type! Current type is " << typeid(*this).name()
205
0
                << " and expect type is" << typeid(TARGET).name();
206
48
        return reinterpret_cast<TARGET&>(*this);
207
48
    }
_ZN5doris23PipelineXLocalStateBase4castINS_23HashJoinProbeLocalStateEEERT_v
Line
Count
Source
202
331
    TARGET& cast() {
203
331
        DCHECK(dynamic_cast<TARGET*>(this))
204
0
                << " Mismatch type! Current type is " << typeid(*this).name()
205
0
                << " and expect type is" << typeid(TARGET).name();
206
331
        return reinterpret_cast<TARGET&>(*this);
207
331
    }
_ZN5doris23PipelineXLocalStateBase4castINS_24LocalMergeSortLocalStateEEERT_v
Line
Count
Source
202
6
    TARGET& cast() {
203
6
        DCHECK(dynamic_cast<TARGET*>(this))
204
0
                << " Mismatch type! Current type is " << typeid(*this).name()
205
0
                << " and expect type is" << typeid(TARGET).name();
206
6
        return reinterpret_cast<TARGET&>(*this);
207
6
    }
Unexecuted instantiation: _ZN5doris23PipelineXLocalStateBase4castINS_25MaterializationLocalStateEEERT_v
_ZN5doris23PipelineXLocalStateBase4castINS_29PartitionSortSourceLocalStateEEERT_v
Line
Count
Source
202
402
    TARGET& cast() {
203
402
        DCHECK(dynamic_cast<TARGET*>(this))
204
0
                << " Mismatch type! Current type is " << typeid(*this).name()
205
0
                << " and expect type is" << typeid(TARGET).name();
206
402
        return reinterpret_cast<TARGET&>(*this);
207
402
    }
_ZN5doris23PipelineXLocalStateBase4castINS_24PartitionedAggLocalStateEEERT_v
Line
Count
Source
202
84
    TARGET& cast() {
203
84
        DCHECK(dynamic_cast<TARGET*>(this))
204
0
                << " Mismatch type! Current type is " << typeid(*this).name()
205
0
                << " and expect type is" << typeid(TARGET).name();
206
84
        return reinterpret_cast<TARGET&>(*this);
207
84
    }
_ZN5doris23PipelineXLocalStateBase4castINS_34PartitionedHashJoinProbeLocalStateEEERT_v
Line
Count
Source
202
59
    TARGET& cast() {
203
59
        DCHECK(dynamic_cast<TARGET*>(this))
204
0
                << " Mismatch type! Current type is " << typeid(*this).name()
205
0
                << " and expect type is" << typeid(TARGET).name();
206
59
        return reinterpret_cast<TARGET&>(*this);
207
59
    }
_ZN5doris23PipelineXLocalStateBase4castINS_21CacheSourceLocalStateEEERT_v
Line
Count
Source
202
6
    TARGET& cast() {
203
6
        DCHECK(dynamic_cast<TARGET*>(this))
204
0
                << " Mismatch type! Current type is " << typeid(*this).name()
205
0
                << " and expect type is" << typeid(TARGET).name();
206
6
        return reinterpret_cast<TARGET&>(*this);
207
6
    }
_ZN5doris23PipelineXLocalStateBase4castINS_16RepeatLocalStateEEERT_v
Line
Count
Source
202
21
    TARGET& cast() {
203
21
        DCHECK(dynamic_cast<TARGET*>(this))
204
0
                << " Mismatch type! Current type is " << typeid(*this).name()
205
0
                << " and expect type is" << typeid(TARGET).name();
206
21
        return reinterpret_cast<TARGET&>(*this);
207
21
    }
Unexecuted instantiation: _ZN5doris23PipelineXLocalStateBase4castINS_18MockScanLocalStateEEERT_v
_ZN5doris23PipelineXLocalStateBase4castINS_19SetSourceLocalStateILb1EEEEERT_v
Line
Count
Source
202
7
    TARGET& cast() {
203
7
        DCHECK(dynamic_cast<TARGET*>(this))
204
0
                << " Mismatch type! Current type is " << typeid(*this).name()
205
0
                << " and expect type is" << typeid(TARGET).name();
206
7
        return reinterpret_cast<TARGET&>(*this);
207
7
    }
_ZN5doris23PipelineXLocalStateBase4castINS_19SetSourceLocalStateILb0EEEEERT_v
Line
Count
Source
202
845
    TARGET& cast() {
203
845
        DCHECK(dynamic_cast<TARGET*>(this))
204
0
                << " Mismatch type! Current type is " << typeid(*this).name()
205
0
                << " and expect type is" << typeid(TARGET).name();
206
845
        return reinterpret_cast<TARGET&>(*this);
207
845
    }
_ZN5doris23PipelineXLocalStateBase4castINS_14SortLocalStateEEERT_v
Line
Count
Source
202
38
    TARGET& cast() {
203
38
        DCHECK(dynamic_cast<TARGET*>(this))
204
0
                << " Mismatch type! Current type is " << typeid(*this).name()
205
0
                << " and expect type is" << typeid(TARGET).name();
206
38
        return reinterpret_cast<TARGET&>(*this);
207
38
    }
_ZN5doris23PipelineXLocalStateBase4castINS_19SpillSortLocalStateEEERT_v
Line
Count
Source
202
48
    TARGET& cast() {
203
48
        DCHECK(dynamic_cast<TARGET*>(this))
204
0
                << " Mismatch type! Current type is " << typeid(*this).name()
205
0
                << " and expect type is" << typeid(TARGET).name();
206
48
        return reinterpret_cast<TARGET&>(*this);
207
48
    }
_ZN5doris23PipelineXLocalStateBase4castINS_22StreamingAggLocalStateEEERT_v
Line
Count
Source
202
21
    TARGET& cast() {
203
21
        DCHECK(dynamic_cast<TARGET*>(this))
204
0
                << " Mismatch type! Current type is " << typeid(*this).name()
205
0
                << " and expect type is" << typeid(TARGET).name();
206
21
        return reinterpret_cast<TARGET&>(*this);
207
21
    }
_ZN5doris23PipelineXLocalStateBase4castINS_23TableFunctionLocalStateEEERT_v
Line
Count
Source
202
38
    TARGET& cast() {
203
38
        DCHECK(dynamic_cast<TARGET*>(this))
204
0
                << " Mismatch type! Current type is " << typeid(*this).name()
205
0
                << " and expect type is" << typeid(TARGET).name();
206
38
        return reinterpret_cast<TARGET&>(*this);
207
38
    }
_ZN5doris23PipelineXLocalStateBase4castINS_21UnionSourceLocalStateEEERT_v
Line
Count
Source
202
41
    TARGET& cast() {
203
41
        DCHECK(dynamic_cast<TARGET*>(this))
204
0
                << " Mismatch type! Current type is " << typeid(*this).name()
205
0
                << " and expect type is" << typeid(TARGET).name();
206
41
        return reinterpret_cast<TARGET&>(*this);
207
41
    }
Unexecuted instantiation: _ZN5doris23PipelineXLocalStateBase4castINS_29LocalExchangeSourceLocalStateEEERT_v
Unexecuted instantiation: _ZN5doris23PipelineXLocalStateBase4castINS_18OlapScanLocalStateEEERT_v
_ZN5doris23PipelineXLocalStateBase4castINS_18FileScanLocalStateEEERT_v
Line
Count
Source
202
2
    TARGET& cast() {
203
2
        DCHECK(dynamic_cast<TARGET*>(this))
204
0
                << " Mismatch type! Current type is " << typeid(*this).name()
205
0
                << " and expect type is" << typeid(TARGET).name();
206
2
        return reinterpret_cast<TARGET&>(*this);
207
2
    }
Unexecuted instantiation: _ZN5doris23PipelineXLocalStateBase4castINS_29NestedLoopJoinProbeLocalStateEEERT_v
Unexecuted instantiation: _ZN5doris23PipelineXLocalStateBase4castINS_35MultiCastDataStreamSourceLocalStateEEERT_v
Unexecuted instantiation: _ZN5doris23PipelineXLocalStateBase4castINS_21GroupCommitLocalStateEEERT_v
Unexecuted instantiation: _ZN5doris23PipelineXLocalStateBase4castINS_18JDBCScanLocalStateEEERT_v
Unexecuted instantiation: _ZN5doris23PipelineXLocalStateBase4castINS_16EsScanLocalStateEEERT_v
Unexecuted instantiation: _ZN5doris23PipelineXLocalStateBase4castINS_20SchemaScanLocalStateEEERT_v
Unexecuted instantiation: _ZN5doris23PipelineXLocalStateBase4castINS_18MetaScanLocalStateEEERT_v
Unexecuted instantiation: _ZN5doris23PipelineXLocalStateBase4castINS_22RecCTESourceLocalStateEEERT_v
Unexecuted instantiation: _ZN5doris23PipelineXLocalStateBase4castINS_20RecCTEScanLocalStateEEERT_v
Unexecuted instantiation: _ZN5doris23PipelineXLocalStateBase4castINS_16SelectLocalStateEEERT_v
208
    template <class TARGET>
209
    const TARGET& cast() const {
210
        DCHECK(dynamic_cast<TARGET*>(this))
211
                << " Mismatch type! Current type is " << typeid(*this).name()
212
                << " and expect type is" << typeid(TARGET).name();
213
        return reinterpret_cast<const TARGET&>(*this);
214
    }
215
216
    // Do initialization. This step should be executed only once and in bthread, so we can do some
217
    // lightweight or non-idempotent operations (e.g. init profile, clone expr ctx from operatorX)
218
    virtual Status init(RuntimeState* state, LocalStateInfo& info) = 0;
219
    // Make sure all resources are ready before execution. For example, remote tablets should be
220
    // loaded to local storage.
221
    // This is called by execution pthread and different from `Operator::prepare` which is called
222
    // by bthread.
223
    virtual Status prepare(RuntimeState* state) = 0;
224
    // Do initialization. This step can be executed multiple times, so we should make sure it is
225
    // idempotent (e.g. wait for runtime filters).
226
    virtual Status open(RuntimeState* state) = 0;
227
    virtual Status close(RuntimeState* state) = 0;
228
    virtual Status terminate(RuntimeState* state) = 0;
229
230
    // If use projection, we should clear `_origin_block`.
231
    void clear_origin_block();
232
233
    void reached_limit(Block* block, bool* eos);
234
227
    RuntimeProfile* operator_profile() { return _operator_profile.get(); }
235
148
    RuntimeProfile* common_profile() { return _common_profile.get(); }
236
291k
    RuntimeProfile* custom_profile() { return _custom_profile.get(); }
237
238
98.0k
    RuntimeProfile::Counter* exec_time_counter() { return _exec_timer; }
239
0
    RuntimeProfile::Counter* memory_used_counter() { return _memory_used_counter; }
240
0
    OperatorXBase* parent() { return _parent; }
241
99
    RuntimeState* state() { return _state; }
242
16
    VExprContextSPtrs& conjuncts() { return _conjuncts; }
243
0
    VExprContextSPtrs& projections() { return _projections; }
244
11
    [[nodiscard]] int64_t num_rows_returned() const { return _num_rows_returned; }
245
18
    void add_num_rows_returned(int64_t delta) { _num_rows_returned += delta; }
246
2
    void set_num_rows_returned(int64_t value) { _num_rows_returned = value; }
247
248
    [[nodiscard]] virtual std::string debug_string(int indentation_level = 0) const = 0;
249
    [[nodiscard]] virtual bool is_blockable() const;
250
251
0
    virtual std::vector<Dependency*> dependencies() const { return {nullptr}; }
252
253
    // override in Scan
254
7
    virtual Dependency* finishdependency() { return nullptr; }
255
    //  override in Scan  MultiCastSink
256
5
    virtual std::vector<Dependency*> execution_dependencies() { return {}; }
257
258
    Status filter_block(const VExprContextSPtrs& expr_contexts, Block* block);
259
260
1.45M
    int64_t& estimate_memory_usage() { return _estimate_memory_usage; }
261
262
1.45M
    void reset_estimate_memory_usage() { _estimate_memory_usage = 0; }
263
264
25
    bool low_memory_mode() {
265
25
#ifdef BE_TEST
266
25
        return false;
267
#else
268
        return _state->low_memory_mode();
269
#endif
270
25
    }
271
272
protected:
273
    friend class OperatorXBase;
274
    template <typename LocalStateType>
275
    friend class ScanOperatorX;
276
277
    ObjectPool* _pool = nullptr;
278
    int64_t _num_rows_returned {0};
279
    int64_t _estimate_memory_usage {0};
280
281
    /*
282
    Each operator has its profile like this:
283
    XXXX_OPERATOR:
284
        CommonCounters:
285
            ...
286
        CustomCounters:
287
            ...
288
    */
289
    // Profile of this operator.
290
    // Should not modify this profile usually.
291
    std::unique_ptr<RuntimeProfile> _operator_profile;
292
    // CommonCounters of this operator.
293
    // CommonCounters are counters that will be used by all operators.
294
    std::unique_ptr<RuntimeProfile> _common_profile;
295
    // CustomCounters of this operator.
296
    // CustomCounters are counters that will be used by this operator only.
297
    std::unique_ptr<RuntimeProfile> _custom_profile;
298
299
    RuntimeProfile::Counter* _rows_returned_counter = nullptr;
300
    RuntimeProfile::Counter* _blocks_returned_counter = nullptr;
301
    RuntimeProfile::Counter* _wait_for_dependency_timer = nullptr;
302
    // Account for current memory and peak memory used by this node
303
    RuntimeProfile::HighWaterMarkCounter* _memory_used_counter = nullptr;
304
    RuntimeProfile::Counter* _projection_timer = nullptr;
305
    RuntimeProfile::Counter* _exec_timer = nullptr;
306
    RuntimeProfile::Counter* _init_timer = nullptr;
307
    RuntimeProfile::Counter* _open_timer = nullptr;
308
    RuntimeProfile::Counter* _close_timer = nullptr;
309
310
    OperatorXBase* _parent = nullptr;
311
    RuntimeState* _state = nullptr;
312
    VExprContextSPtrs _conjuncts;
313
    VExprContextSPtrs _projections;
314
    std::shared_ptr<ScoreRuntime> _score_runtime;
315
    std::shared_ptr<segment_v2::AnnTopNRuntime> _ann_topn_runtime;
316
    // Used in common subexpression elimination to compute intermediate results.
317
    std::vector<VExprContextSPtrs> _intermediate_projections;
318
319
    bool _closed = false;
320
    std::atomic<bool> _terminated = false;
321
    Block _origin_block;
322
};
323
324
template <typename SharedStateArg = FakeSharedState>
325
class PipelineXLocalState : public PipelineXLocalStateBase {
326
public:
327
    using SharedStateType = SharedStateArg;
328
    PipelineXLocalState(RuntimeState* state, OperatorXBase* parent)
329
24.5k
            : PipelineXLocalStateBase(state, parent) {}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEEC2EPNS_12RuntimeStateEPNS_13OperatorXBaseE
Line
Count
Source
329
102
            : PipelineXLocalStateBase(state, parent) {}
_ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEEC2EPNS_12RuntimeStateEPNS_13OperatorXBaseE
Line
Count
Source
329
3
            : PipelineXLocalStateBase(state, parent) {}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEEC2EPNS_12RuntimeStateEPNS_13OperatorXBaseE
Line
Count
Source
329
182
            : PipelineXLocalStateBase(state, parent) {}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEEC2EPNS_12RuntimeStateEPNS_13OperatorXBaseE
Line
Count
Source
329
12
            : PipelineXLocalStateBase(state, parent) {}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEEC2EPNS_12RuntimeStateEPNS_13OperatorXBaseE
Line
Count
Source
329
2
            : PipelineXLocalStateBase(state, parent) {}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEEC2EPNS_12RuntimeStateEPNS_13OperatorXBaseE
Line
Count
Source
329
24
            : PipelineXLocalStateBase(state, parent) {}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEEC2EPNS_12RuntimeStateEPNS_13OperatorXBaseE
Line
Count
Source
329
37
            : PipelineXLocalStateBase(state, parent) {}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEEC2EPNS_12RuntimeStateEPNS_13OperatorXBaseE
Line
Count
Source
329
9
            : PipelineXLocalStateBase(state, parent) {}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEEC2EPNS_12RuntimeStateEPNS_13OperatorXBaseE
Line
Count
Source
329
24.0k
            : PipelineXLocalStateBase(state, parent) {}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEEC2EPNS_12RuntimeStateEPNS_13OperatorXBaseE
_ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEEC2EPNS_12RuntimeStateEPNS_13OperatorXBaseE
Line
Count
Source
329
40
            : PipelineXLocalStateBase(state, parent) {}
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEEC2EPNS_12RuntimeStateEPNS_13OperatorXBaseE
Line
Count
Source
329
23
            : PipelineXLocalStateBase(state, parent) {}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEEC2EPNS_12RuntimeStateEPNS_13OperatorXBaseE
Line
Count
Source
329
11
            : PipelineXLocalStateBase(state, parent) {}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEEC2EPNS_12RuntimeStateEPNS_13OperatorXBaseE
Line
Count
Source
329
19
            : PipelineXLocalStateBase(state, parent) {}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEEC2EPNS_12RuntimeStateEPNS_13OperatorXBaseE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEEC2EPNS_12RuntimeStateEPNS_13OperatorXBaseE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEEC2EPNS_12RuntimeStateEPNS_13OperatorXBaseE
330
24.5k
    ~PipelineXLocalState() override = default;
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEED2Ev
Line
Count
Source
330
9
    ~PipelineXLocalState() override = default;
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEED2Ev
Line
Count
Source
330
182
    ~PipelineXLocalState() override = default;
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEED2Ev
Line
Count
Source
330
23
    ~PipelineXLocalState() override = default;
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEED2Ev
Line
Count
Source
330
102
    ~PipelineXLocalState() override = default;
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEED2Ev
Line
Count
Source
330
19
    ~PipelineXLocalState() override = default;
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEED2Ev
Line
Count
Source
330
24.0k
    ~PipelineXLocalState() override = default;
_ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEED2Ev
Line
Count
Source
330
40
    ~PipelineXLocalState() override = default;
_ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEED2Ev
Line
Count
Source
330
3
    ~PipelineXLocalState() override = default;
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEED2Ev
Line
Count
Source
330
12
    ~PipelineXLocalState() override = default;
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEED2Ev
Line
Count
Source
330
11
    ~PipelineXLocalState() override = default;
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEED2Ev
Line
Count
Source
330
2
    ~PipelineXLocalState() override = default;
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEED2Ev
Line
Count
Source
330
24
    ~PipelineXLocalState() override = default;
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEED2Ev
Line
Count
Source
330
37
    ~PipelineXLocalState() override = default;
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEED2Ev
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEED2Ev
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEED2Ev
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEED2Ev
331
332
    Status init(RuntimeState* state, LocalStateInfo& info) override;
333
80
    Status prepare(RuntimeState* state) override { return Status::OK(); }
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE7prepareEPNS_12RuntimeStateE
Line
Count
Source
333
68
    Status prepare(RuntimeState* state) override { return Status::OK(); }
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE7prepareEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE7prepareEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE7prepareEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE7prepareEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE7prepareEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE7prepareEPNS_12RuntimeStateE
Line
Count
Source
333
12
    Status prepare(RuntimeState* state) override { return Status::OK(); }
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE7prepareEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE7prepareEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE7prepareEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE7prepareEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE7prepareEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE7prepareEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE7prepareEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE7prepareEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE7prepareEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE7prepareEPNS_12RuntimeStateE
334
    Status open(RuntimeState* state) override;
335
336
    virtual std::string name_suffix() const;
337
338
    Status close(RuntimeState* state) override;
339
    Status terminate(RuntimeState* state) override;
340
341
    [[nodiscard]] std::string debug_string(int indentation_level = 0) const override;
342
343
26.6M
    std::vector<Dependency*> dependencies() const override {
344
26.6M
        return _dependency ? std::vector<Dependency*> {_dependency} : std::vector<Dependency*> {};
345
26.6M
    }
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_15FakeSharedStateEE12dependenciesEv
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_14AggSharedStateEE12dependenciesEv
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE12dependenciesEv
_ZNK5doris19PipelineXLocalStateINS_15SortSharedStateEE12dependenciesEv
Line
Count
Source
343
6
    std::vector<Dependency*> dependencies() const override {
344
6
        return _dependency ? std::vector<Dependency*> {_dependency} : std::vector<Dependency*> {};
345
6
    }
_ZNK5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE12dependenciesEv
Line
Count
Source
343
26.6M
    std::vector<Dependency*> dependencies() const override {
344
26.6M
        return _dependency ? std::vector<Dependency*> {_dependency} : std::vector<Dependency*> {};
345
26.6M
    }
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE12dependenciesEv
_ZNK5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE12dependenciesEv
Line
Count
Source
343
2
    std::vector<Dependency*> dependencies() const override {
344
2
        return _dependency ? std::vector<Dependency*> {_dependency} : std::vector<Dependency*> {};
345
2
    }
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE12dependenciesEv
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE12dependenciesEv
_ZNK5doris19PipelineXLocalStateINS_14SetSharedStateEE12dependenciesEv
Line
Count
Source
343
11
    std::vector<Dependency*> dependencies() const override {
344
11
        return _dependency ? std::vector<Dependency*> {_dependency} : std::vector<Dependency*> {};
345
11
    }
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE12dependenciesEv
_ZNK5doris19PipelineXLocalStateINS_16UnionSharedStateEE12dependenciesEv
Line
Count
Source
343
7
    std::vector<Dependency*> dependencies() const override {
344
7
        return _dependency ? std::vector<Dependency*> {_dependency} : std::vector<Dependency*> {};
345
7
    }
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE12dependenciesEv
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE12dependenciesEv
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE12dependenciesEv
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_16BasicSharedStateEE12dependenciesEv
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_17RecCTESharedStateEE12dependenciesEv
346
347
24.3k
    virtual bool must_set_shared_state() const {
348
24.3k
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
349
24.3k
    }
_ZNK5doris19PipelineXLocalStateINS_15FakeSharedStateEE21must_set_shared_stateEv
Line
Count
Source
347
60
    virtual bool must_set_shared_state() const {
348
60
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
349
60
    }
_ZNK5doris19PipelineXLocalStateINS_14AggSharedStateEE21must_set_shared_stateEv
Line
Count
Source
347
37
    virtual bool must_set_shared_state() const {
348
37
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
349
37
    }
_ZNK5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE21must_set_shared_stateEv
Line
Count
Source
347
9
    virtual bool must_set_shared_state() const {
348
9
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
349
9
    }
_ZNK5doris19PipelineXLocalStateINS_15SortSharedStateEE21must_set_shared_stateEv
Line
Count
Source
347
23
    virtual bool must_set_shared_state() const {
348
23
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
349
23
    }
_ZNK5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE21must_set_shared_stateEv
Line
Count
Source
347
102
    virtual bool must_set_shared_state() const {
348
102
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
349
102
    }
_ZNK5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE21must_set_shared_stateEv
Line
Count
Source
347
10
    virtual bool must_set_shared_state() const {
348
10
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
349
10
    }
_ZNK5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE21must_set_shared_stateEv
Line
Count
Source
347
24.0k
    virtual bool must_set_shared_state() const {
348
24.0k
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
349
24.0k
    }
_ZNK5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE21must_set_shared_stateEv
Line
Count
Source
347
1
    virtual bool must_set_shared_state() const {
348
1
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
349
1
    }
_ZNK5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE21must_set_shared_stateEv
Line
Count
Source
347
3
    virtual bool must_set_shared_state() const {
348
3
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
349
3
    }
_ZNK5doris19PipelineXLocalStateINS_14SetSharedStateEE21must_set_shared_stateEv
Line
Count
Source
347
12
    virtual bool must_set_shared_state() const {
348
12
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
349
12
    }
_ZNK5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE21must_set_shared_stateEv
Line
Count
Source
347
11
    virtual bool must_set_shared_state() const {
348
11
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
349
11
    }
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_16UnionSharedStateEE21must_set_shared_stateEv
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE21must_set_shared_stateEv
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE21must_set_shared_stateEv
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE21must_set_shared_stateEv
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_16BasicSharedStateEE21must_set_shared_stateEv
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_17RecCTESharedStateEE21must_set_shared_stateEv
350
351
protected:
352
    Dependency* _dependency = nullptr;
353
    SharedStateArg* _shared_state = nullptr;
354
};
355
356
template <typename SharedStateArg>
357
class PipelineXSpillLocalState : public PipelineXLocalState<SharedStateArg> {
358
public:
359
    using Base = PipelineXLocalState<SharedStateArg>;
360
    PipelineXSpillLocalState(RuntimeState* state, OperatorXBase* parent)
361
70
            : PipelineXLocalState<SharedStateArg>(state, parent) {}
Unexecuted instantiation: _ZN5doris24PipelineXSpillLocalStateINS_20MultiCastSharedStateEEC2EPNS_12RuntimeStateEPNS_13OperatorXBaseE
_ZN5doris24PipelineXSpillLocalStateINS_25PartitionedAggSharedStateEEC2EPNS_12RuntimeStateEPNS_13OperatorXBaseE
Line
Count
Source
361
19
            : PipelineXLocalState<SharedStateArg>(state, parent) {}
_ZN5doris24PipelineXSpillLocalStateINS_30PartitionedHashJoinSharedStateEEC2EPNS_12RuntimeStateEPNS_13OperatorXBaseE
Line
Count
Source
361
40
            : PipelineXLocalState<SharedStateArg>(state, parent) {}
_ZN5doris24PipelineXSpillLocalStateINS_20SpillSortSharedStateEEC2EPNS_12RuntimeStateEPNS_13OperatorXBaseE
Line
Count
Source
361
11
            : PipelineXLocalState<SharedStateArg>(state, parent) {}
362
70
    ~PipelineXSpillLocalState() override = default;
_ZN5doris24PipelineXSpillLocalStateINS_25PartitionedAggSharedStateEED2Ev
Line
Count
Source
362
19
    ~PipelineXSpillLocalState() override = default;
_ZN5doris24PipelineXSpillLocalStateINS_30PartitionedHashJoinSharedStateEED2Ev
Line
Count
Source
362
40
    ~PipelineXSpillLocalState() override = default;
_ZN5doris24PipelineXSpillLocalStateINS_20SpillSortSharedStateEED2Ev
Line
Count
Source
362
11
    ~PipelineXSpillLocalState() override = default;
Unexecuted instantiation: _ZN5doris24PipelineXSpillLocalStateINS_20MultiCastSharedStateEED2Ev
363
364
22
    Status init(RuntimeState* state, LocalStateInfo& info) override {
365
22
        RETURN_IF_ERROR(PipelineXLocalState<SharedStateArg>::init(state, info));
366
367
22
        init_spill_read_counters();
368
369
22
        return Status::OK();
370
22
    }
_ZN5doris24PipelineXSpillLocalStateINS_25PartitionedAggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
364
10
    Status init(RuntimeState* state, LocalStateInfo& info) override {
365
10
        RETURN_IF_ERROR(PipelineXLocalState<SharedStateArg>::init(state, info));
366
367
10
        init_spill_read_counters();
368
369
10
        return Status::OK();
370
10
    }
_ZN5doris24PipelineXSpillLocalStateINS_30PartitionedHashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
364
1
    Status init(RuntimeState* state, LocalStateInfo& info) override {
365
1
        RETURN_IF_ERROR(PipelineXLocalState<SharedStateArg>::init(state, info));
366
367
1
        init_spill_read_counters();
368
369
1
        return Status::OK();
370
1
    }
_ZN5doris24PipelineXSpillLocalStateINS_20SpillSortSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
364
11
    Status init(RuntimeState* state, LocalStateInfo& info) override {
365
11
        RETURN_IF_ERROR(PipelineXLocalState<SharedStateArg>::init(state, info));
366
367
11
        init_spill_read_counters();
368
369
11
        return Status::OK();
370
11
    }
Unexecuted instantiation: _ZN5doris24PipelineXSpillLocalStateINS_20MultiCastSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
371
372
70
    void init_spill_write_counters() {
373
70
        _write_counters.init(Base::custom_profile());
374
375
        // Source-only extra write counters
376
70
        _spill_write_file_total_size = ADD_COUNTER_WITH_LEVEL(
377
70
                Base::custom_profile(), profile::SPILL_WRITE_FILE_BYTES, TUnit::BYTES, 1);
378
70
        _spill_file_total_count = ADD_COUNTER_WITH_LEVEL(
379
70
                Base::custom_profile(), profile::SPILL_WRITE_FILE_TOTAL_COUNT, TUnit::UNIT, 1);
380
70
    }
_ZN5doris24PipelineXSpillLocalStateINS_25PartitionedAggSharedStateEE25init_spill_write_countersEv
Line
Count
Source
372
19
    void init_spill_write_counters() {
373
19
        _write_counters.init(Base::custom_profile());
374
375
        // Source-only extra write counters
376
19
        _spill_write_file_total_size = ADD_COUNTER_WITH_LEVEL(
377
19
                Base::custom_profile(), profile::SPILL_WRITE_FILE_BYTES, TUnit::BYTES, 1);
378
19
        _spill_file_total_count = ADD_COUNTER_WITH_LEVEL(
379
19
                Base::custom_profile(), profile::SPILL_WRITE_FILE_TOTAL_COUNT, TUnit::UNIT, 1);
380
19
    }
_ZN5doris24PipelineXSpillLocalStateINS_30PartitionedHashJoinSharedStateEE25init_spill_write_countersEv
Line
Count
Source
372
40
    void init_spill_write_counters() {
373
40
        _write_counters.init(Base::custom_profile());
374
375
        // Source-only extra write counters
376
40
        _spill_write_file_total_size = ADD_COUNTER_WITH_LEVEL(
377
40
                Base::custom_profile(), profile::SPILL_WRITE_FILE_BYTES, TUnit::BYTES, 1);
378
40
        _spill_file_total_count = ADD_COUNTER_WITH_LEVEL(
379
40
                Base::custom_profile(), profile::SPILL_WRITE_FILE_TOTAL_COUNT, TUnit::UNIT, 1);
380
40
    }
_ZN5doris24PipelineXSpillLocalStateINS_20SpillSortSharedStateEE25init_spill_write_countersEv
Line
Count
Source
372
11
    void init_spill_write_counters() {
373
11
        _write_counters.init(Base::custom_profile());
374
375
        // Source-only extra write counters
376
11
        _spill_write_file_total_size = ADD_COUNTER_WITH_LEVEL(
377
11
                Base::custom_profile(), profile::SPILL_WRITE_FILE_BYTES, TUnit::BYTES, 1);
378
11
        _spill_file_total_count = ADD_COUNTER_WITH_LEVEL(
379
11
                Base::custom_profile(), profile::SPILL_WRITE_FILE_TOTAL_COUNT, TUnit::UNIT, 1);
380
11
    }
381
382
70
    void init_spill_read_counters() {
383
70
        _spill_total_timer =
384
70
                ADD_TIMER_WITH_LEVEL(Base::custom_profile(), profile::SPILL_TOTAL_TIME, 1);
385
386
70
        _read_counters.init(Base::custom_profile());
387
388
70
        _spill_file_current_size = ADD_COUNTER_WITH_LEVEL(
389
70
                Base::custom_profile(), profile::SPILL_WRITE_FILE_CURRENT_BYTES, TUnit::BYTES, 1);
390
70
        _spill_file_current_count = ADD_COUNTER_WITH_LEVEL(
391
70
                Base::custom_profile(), profile::SPILL_WRITE_FILE_CURRENT_COUNT, TUnit::UNIT, 1);
392
70
    }
_ZN5doris24PipelineXSpillLocalStateINS_25PartitionedAggSharedStateEE24init_spill_read_countersEv
Line
Count
Source
382
19
    void init_spill_read_counters() {
383
19
        _spill_total_timer =
384
19
                ADD_TIMER_WITH_LEVEL(Base::custom_profile(), profile::SPILL_TOTAL_TIME, 1);
385
386
19
        _read_counters.init(Base::custom_profile());
387
388
19
        _spill_file_current_size = ADD_COUNTER_WITH_LEVEL(
389
19
                Base::custom_profile(), profile::SPILL_WRITE_FILE_CURRENT_BYTES, TUnit::BYTES, 1);
390
19
        _spill_file_current_count = ADD_COUNTER_WITH_LEVEL(
391
19
                Base::custom_profile(), profile::SPILL_WRITE_FILE_CURRENT_COUNT, TUnit::UNIT, 1);
392
19
    }
_ZN5doris24PipelineXSpillLocalStateINS_30PartitionedHashJoinSharedStateEE24init_spill_read_countersEv
Line
Count
Source
382
40
    void init_spill_read_counters() {
383
40
        _spill_total_timer =
384
40
                ADD_TIMER_WITH_LEVEL(Base::custom_profile(), profile::SPILL_TOTAL_TIME, 1);
385
386
40
        _read_counters.init(Base::custom_profile());
387
388
40
        _spill_file_current_size = ADD_COUNTER_WITH_LEVEL(
389
40
                Base::custom_profile(), profile::SPILL_WRITE_FILE_CURRENT_BYTES, TUnit::BYTES, 1);
390
40
        _spill_file_current_count = ADD_COUNTER_WITH_LEVEL(
391
40
                Base::custom_profile(), profile::SPILL_WRITE_FILE_CURRENT_COUNT, TUnit::UNIT, 1);
392
40
    }
_ZN5doris24PipelineXSpillLocalStateINS_20SpillSortSharedStateEE24init_spill_read_countersEv
Line
Count
Source
382
11
    void init_spill_read_counters() {
383
11
        _spill_total_timer =
384
11
                ADD_TIMER_WITH_LEVEL(Base::custom_profile(), profile::SPILL_TOTAL_TIME, 1);
385
386
11
        _read_counters.init(Base::custom_profile());
387
388
11
        _spill_file_current_size = ADD_COUNTER_WITH_LEVEL(
389
11
                Base::custom_profile(), profile::SPILL_WRITE_FILE_CURRENT_BYTES, TUnit::BYTES, 1);
390
11
        _spill_file_current_count = ADD_COUNTER_WITH_LEVEL(
391
11
                Base::custom_profile(), profile::SPILL_WRITE_FILE_CURRENT_COUNT, TUnit::UNIT, 1);
392
11
    }
Unexecuted instantiation: _ZN5doris24PipelineXSpillLocalStateINS_20MultiCastSharedStateEE24init_spill_read_countersEv
393
394
    // Total time of spill, including spill task scheduling time,
395
    // serialize block time, write disk file time,
396
    // and read disk file time, deserialize block time etc.
397
    RuntimeProfile::Counter* _spill_total_timer = nullptr;
398
399
    // Shared spill write counters
400
    SpillWriteCounters _write_counters;
401
    // Backward-compatible aliases for commonly accessed write counters
402
    RuntimeProfile::Counter*& _spill_write_file_timer = _write_counters.spill_write_file_timer;
403
    RuntimeProfile::Counter*& _spill_write_serialize_block_timer =
404
            _write_counters.spill_write_serialize_block_timer;
405
    RuntimeProfile::Counter*& _spill_write_block_count = _write_counters.spill_write_block_count;
406
    RuntimeProfile::Counter*& _spill_write_block_data_size =
407
            _write_counters.spill_write_block_data_size;
408
    RuntimeProfile::Counter*& _spill_write_rows_count = _write_counters.spill_write_rows_count;
409
410
    // Source-only write counters (not in SpillWriteCounters)
411
    // Total bytes of spill data written to disk file(after serialized)
412
    RuntimeProfile::Counter* _spill_write_file_total_size = nullptr;
413
    RuntimeProfile::Counter* _spill_file_total_count = nullptr;
414
    RuntimeProfile::Counter* _spill_file_current_count = nullptr;
415
    // Spilled file total size
416
    RuntimeProfile::Counter* _spill_file_total_size = nullptr;
417
    // Current spilled file size
418
    RuntimeProfile::Counter* _spill_file_current_size = nullptr;
419
420
    // Shared spill read counters
421
    SpillReadCounters _read_counters;
422
    // Backward-compatible aliases for commonly accessed read counters
423
    RuntimeProfile::Counter*& _spill_read_file_time = _read_counters.spill_read_file_time;
424
    RuntimeProfile::Counter*& _spill_read_deserialize_block_timer =
425
            _read_counters.spill_read_deserialize_block_timer;
426
    RuntimeProfile::Counter*& _spill_read_block_count = _read_counters.spill_read_block_count;
427
    RuntimeProfile::Counter*& _spill_read_block_data_size =
428
            _read_counters.spill_read_block_data_size;
429
    RuntimeProfile::Counter*& _spill_read_file_size = _read_counters.spill_read_file_size;
430
    RuntimeProfile::Counter*& _spill_read_rows_count = _read_counters.spill_read_rows_count;
431
    RuntimeProfile::Counter*& _spill_read_file_count = _read_counters.spill_read_file_count;
432
};
433
434
class DataSinkOperatorXBase;
435
436
class PipelineXSinkLocalStateBase {
437
public:
438
    PipelineXSinkLocalStateBase(DataSinkOperatorXBase* parent_, RuntimeState* state_);
439
72.3k
    virtual ~PipelineXSinkLocalStateBase() = default;
440
441
    // Do initialization. This step should be executed only once and in bthread, so we can do some
442
    // lightweight or non-idempotent operations (e.g. init profile, clone expr ctx from operatorX)
443
    virtual Status init(RuntimeState* state, LocalSinkStateInfo& info) = 0;
444
445
    virtual Status prepare(RuntimeState* state) = 0;
446
    // Do initialization. This step can be executed multiple times, so we should make sure it is
447
    // idempotent (e.g. wait for runtime filters).
448
    virtual Status open(RuntimeState* state) = 0;
449
    virtual Status terminate(RuntimeState* state) = 0;
450
    virtual Status close(RuntimeState* state, Status exec_status) = 0;
451
4
    [[nodiscard]] virtual bool is_finished() const { return false; }
452
0
    [[nodiscard]] virtual bool is_blockable() const { return false; }
453
454
    [[nodiscard]] virtual std::string debug_string(int indentation_level) const = 0;
455
456
    template <class TARGET>
457
312k
    TARGET& cast() {
458
312k
        DCHECK(dynamic_cast<TARGET*>(this))
459
0
                << " Mismatch type! Current type is " << typeid(*this).name()
460
0
                << " and expect type is" << typeid(TARGET).name();
461
312k
        return reinterpret_cast<TARGET&>(*this);
462
312k
    }
_ZN5doris27PipelineXSinkLocalStateBase4castINS_22ExchangeSinkLocalStateEEERT_v
Line
Count
Source
457
11
    TARGET& cast() {
458
11
        DCHECK(dynamic_cast<TARGET*>(this))
459
0
                << " Mismatch type! Current type is " << typeid(*this).name()
460
0
                << " and expect type is" << typeid(TARGET).name();
461
11
        return reinterpret_cast<TARGET&>(*this);
462
11
    }
_ZN5doris27PipelineXSinkLocalStateBase4castINS_17AggSinkLocalStateEEERT_v
Line
Count
Source
457
191
    TARGET& cast() {
458
191
        DCHECK(dynamic_cast<TARGET*>(this))
459
0
                << " Mismatch type! Current type is " << typeid(*this).name()
460
0
                << " and expect type is" << typeid(TARGET).name();
461
191
        return reinterpret_cast<TARGET&>(*this);
462
191
    }
_ZN5doris27PipelineXSinkLocalStateBase4castINS_27HashJoinBuildSinkLocalStateEEERT_v
Line
Count
Source
457
312k
    TARGET& cast() {
458
312k
        DCHECK(dynamic_cast<TARGET*>(this))
459
0
                << " Mismatch type! Current type is " << typeid(*this).name()
460
0
                << " and expect type is" << typeid(TARGET).name();
461
312k
        return reinterpret_cast<TARGET&>(*this);
462
312k
    }
_ZN5doris27PipelineXSinkLocalStateBase4castINS_19UnionSinkLocalStateEEERT_v
Line
Count
Source
457
16
    TARGET& cast() {
458
16
        DCHECK(dynamic_cast<TARGET*>(this))
459
0
                << " Mismatch type! Current type is " << typeid(*this).name()
460
0
                << " and expect type is" << typeid(TARGET).name();
461
16
        return reinterpret_cast<TARGET&>(*this);
462
16
    }
Unexecuted instantiation: _ZN5doris27PipelineXSinkLocalStateBase4castINS_27LocalExchangeSinkLocalStateEEERT_v
_ZN5doris27PipelineXSinkLocalStateBase4castINS_19DummySinkLocalStateEEERT_v
Line
Count
Source
457
2
    TARGET& cast() {
458
2
        DCHECK(dynamic_cast<TARGET*>(this))
459
0
                << " Mismatch type! Current type is " << typeid(*this).name()
460
0
                << " and expect type is" << typeid(TARGET).name();
461
2
        return reinterpret_cast<TARGET&>(*this);
462
2
    }
_ZN5doris27PipelineXSinkLocalStateBase4castINS_22AnalyticSinkLocalStateEEERT_v
Line
Count
Source
457
74
    TARGET& cast() {
458
74
        DCHECK(dynamic_cast<TARGET*>(this))
459
0
                << " Mismatch type! Current type is " << typeid(*this).name()
460
0
                << " and expect type is" << typeid(TARGET).name();
461
74
        return reinterpret_cast<TARGET&>(*this);
462
74
    }
_ZN5doris27PipelineXSinkLocalStateBase4castINS_19CacheSinkLocalStateEEERT_v
Line
Count
Source
457
3
    TARGET& cast() {
458
3
        DCHECK(dynamic_cast<TARGET*>(this))
459
0
                << " Mismatch type! Current type is " << typeid(*this).name()
460
0
                << " and expect type is" << typeid(TARGET).name();
461
3
        return reinterpret_cast<TARGET&>(*this);
462
3
    }
Unexecuted instantiation: _ZN5doris27PipelineXSinkLocalStateBase4castINS_33NestedLoopJoinBuildSinkLocalStateEEERT_v
Unexecuted instantiation: _ZN5doris27PipelineXSinkLocalStateBase4castINS_20ResultSinkLocalStateEEERT_v
Unexecuted instantiation: _ZN5doris27PipelineXSinkLocalStateBase4castINS_23JdbcTableSinkLocalStateEEERT_v
Unexecuted instantiation: _ZN5doris27PipelineXSinkLocalStateBase4castINS_27MemoryScratchSinkLocalStateEEERT_v
Unexecuted instantiation: _ZN5doris27PipelineXSinkLocalStateBase4castINS_24ResultFileSinkLocalStateEEERT_v
Unexecuted instantiation: _ZN5doris27PipelineXSinkLocalStateBase4castINS_23OlapTableSinkLocalStateEEERT_v
Unexecuted instantiation: _ZN5doris27PipelineXSinkLocalStateBase4castINS_25OlapTableSinkV2LocalStateEEERT_v
Unexecuted instantiation: _ZN5doris27PipelineXSinkLocalStateBase4castINS_23HiveTableSinkLocalStateEEERT_v
Unexecuted instantiation: _ZN5doris27PipelineXSinkLocalStateBase4castINS_22TVFTableSinkLocalStateEEERT_v
Unexecuted instantiation: _ZN5doris27PipelineXSinkLocalStateBase4castINS_26IcebergTableSinkLocalStateEEERT_v
Unexecuted instantiation: _ZN5doris27PipelineXSinkLocalStateBase4castINS_31SpillIcebergTableSinkLocalStateEEERT_v
Unexecuted instantiation: _ZN5doris27PipelineXSinkLocalStateBase4castINS_27IcebergDeleteSinkLocalStateEEERT_v
Unexecuted instantiation: _ZN5doris27PipelineXSinkLocalStateBase4castINS_26IcebergMergeSinkLocalStateEEERT_v
Unexecuted instantiation: _ZN5doris27PipelineXSinkLocalStateBase4castINS_21MCTableSinkLocalStateEEERT_v
Unexecuted instantiation: _ZN5doris27PipelineXSinkLocalStateBase4castINS_23BlackholeSinkLocalStateEEERT_v
_ZN5doris27PipelineXSinkLocalStateBase4castINS_18SortSinkLocalStateEEERT_v
Line
Count
Source
457
112
    TARGET& cast() {
458
112
        DCHECK(dynamic_cast<TARGET*>(this))
459
0
                << " Mismatch type! Current type is " << typeid(*this).name()
460
0
                << " and expect type is" << typeid(TARGET).name();
461
112
        return reinterpret_cast<TARGET&>(*this);
462
112
    }
_ZN5doris27PipelineXSinkLocalStateBase4castINS_23SpillSortSinkLocalStateEEERT_v
Line
Count
Source
457
45
    TARGET& cast() {
458
45
        DCHECK(dynamic_cast<TARGET*>(this))
459
0
                << " Mismatch type! Current type is " << typeid(*this).name()
460
0
                << " and expect type is" << typeid(TARGET).name();
461
45
        return reinterpret_cast<TARGET&>(*this);
462
45
    }
_ZN5doris27PipelineXSinkLocalStateBase4castINS_28PartitionedAggSinkLocalStateEEERT_v
Line
Count
Source
457
104
    TARGET& cast() {
458
104
        DCHECK(dynamic_cast<TARGET*>(this))
459
0
                << " Mismatch type! Current type is " << typeid(*this).name()
460
0
                << " and expect type is" << typeid(TARGET).name();
461
104
        return reinterpret_cast<TARGET&>(*this);
462
104
    }
Unexecuted instantiation: _ZN5doris27PipelineXSinkLocalStateBase4castINS_33MultiCastDataStreamSinkLocalStateEEERT_v
_ZN5doris27PipelineXSinkLocalStateBase4castINS_27PartitionSortSinkLocalStateEEERT_v
Line
Count
Source
457
104
    TARGET& cast() {
458
104
        DCHECK(dynamic_cast<TARGET*>(this))
459
0
                << " Mismatch type! Current type is " << typeid(*this).name()
460
0
                << " and expect type is" << typeid(TARGET).name();
461
104
        return reinterpret_cast<TARGET&>(*this);
462
104
    }
_ZN5doris27PipelineXSinkLocalStateBase4castINS_22SetProbeSinkLocalStateILb1EEEEERT_v
Line
Count
Source
457
9
    TARGET& cast() {
458
9
        DCHECK(dynamic_cast<TARGET*>(this))
459
0
                << " Mismatch type! Current type is " << typeid(*this).name()
460
0
                << " and expect type is" << typeid(TARGET).name();
461
9
        return reinterpret_cast<TARGET&>(*this);
462
9
    }
_ZN5doris27PipelineXSinkLocalStateBase4castINS_22SetProbeSinkLocalStateILb0EEEEERT_v
Line
Count
Source
457
6
    TARGET& cast() {
458
6
        DCHECK(dynamic_cast<TARGET*>(this))
459
0
                << " Mismatch type! Current type is " << typeid(*this).name()
460
0
                << " and expect type is" << typeid(TARGET).name();
461
6
        return reinterpret_cast<TARGET&>(*this);
462
6
    }
_ZN5doris27PipelineXSinkLocalStateBase4castINS_17SetSinkLocalStateILb1EEEEERT_v
Line
Count
Source
457
15
    TARGET& cast() {
458
15
        DCHECK(dynamic_cast<TARGET*>(this))
459
0
                << " Mismatch type! Current type is " << typeid(*this).name()
460
0
                << " and expect type is" << typeid(TARGET).name();
461
15
        return reinterpret_cast<TARGET&>(*this);
462
15
    }
_ZN5doris27PipelineXSinkLocalStateBase4castINS_17SetSinkLocalStateILb0EEEEERT_v
Line
Count
Source
457
46
    TARGET& cast() {
458
46
        DCHECK(dynamic_cast<TARGET*>(this))
459
0
                << " Mismatch type! Current type is " << typeid(*this).name()
460
0
                << " and expect type is" << typeid(TARGET).name();
461
46
        return reinterpret_cast<TARGET&>(*this);
462
46
    }
_ZN5doris27PipelineXSinkLocalStateBase4castINS_33PartitionedHashJoinSinkLocalStateEEERT_v
Line
Count
Source
457
8
    TARGET& cast() {
458
8
        DCHECK(dynamic_cast<TARGET*>(this))
459
0
                << " Mismatch type! Current type is " << typeid(*this).name()
460
0
                << " and expect type is" << typeid(TARGET).name();
461
8
        return reinterpret_cast<TARGET&>(*this);
462
8
    }
Unexecuted instantiation: _ZN5doris27PipelineXSinkLocalStateBase4castINS_30GroupCommitBlockSinkLocalStateEEERT_v
Unexecuted instantiation: _ZN5doris27PipelineXSinkLocalStateBase4castINS_18DictSinkLocalStateEEERT_v
Unexecuted instantiation: _ZN5doris27PipelineXSinkLocalStateBase4castINS_20RecCTESinkLocalStateEEERT_v
Unexecuted instantiation: _ZN5doris27PipelineXSinkLocalStateBase4castINS_26RecCTEAnchorSinkLocalStateEEERT_v
463
    template <class TARGET>
464
    const TARGET& cast() const {
465
        DCHECK(dynamic_cast<const TARGET*>(this))
466
                << " Mismatch type! Current type is " << typeid(*this).name()
467
                << " and expect type is" << typeid(TARGET).name();
468
        return reinterpret_cast<const TARGET&>(*this);
469
    }
470
471
46.3k
    DataSinkOperatorXBase* parent() { return _parent; }
472
108
    RuntimeState* state() { return _state; }
473
104
    RuntimeProfile* operator_profile() { return _operator_profile; }
474
45
    RuntimeProfile* common_profile() { return _common_profile; }
475
795k
    RuntimeProfile* custom_profile() { return _custom_profile; }
476
477
6
    [[nodiscard]] RuntimeProfile* faker_runtime_profile() const {
478
6
        return _faker_runtime_profile.get();
479
6
    }
480
481
96.4k
    RuntimeProfile::Counter* rows_input_counter() { return _rows_input_counter; }
482
264k
    RuntimeProfile::Counter* exec_time_counter() { return _exec_timer; }
483
67
    RuntimeProfile::Counter* memory_used_counter() { return _memory_used_counter; }
484
485
0
    virtual std::vector<Dependency*> dependencies() const { return {nullptr}; }
486
487
    // override in exchange sink , AsyncWriterSink
488
0
    virtual Dependency* finishdependency() { return nullptr; }
489
490
20
    bool low_memory_mode() { return _state->low_memory_mode(); }
491
492
protected:
493
    DataSinkOperatorXBase* _parent = nullptr;
494
    RuntimeState* _state = nullptr;
495
    RuntimeProfile* _operator_profile = nullptr;
496
    RuntimeProfile* _common_profile = nullptr;
497
    RuntimeProfile* _custom_profile = nullptr;
498
    // Set to true after close() has been called. subclasses should check and set this in
499
    // close().
500
    bool _closed = false;
501
    bool _terminated = false;
502
    //NOTICE: now add a faker profile, because sometimes the profile record is useless
503
    //so we want remove some counters and timers, eg: in join node, if it's broadcast_join
504
    //and shared hash table, some counter/timer about build hash table is useless,
505
    //so we could add those counter/timer in faker profile, and those will not display in web profile.
506
    std::unique_ptr<RuntimeProfile> _faker_runtime_profile =
507
            std::make_unique<RuntimeProfile>(profile::FAKER_PROFILE);
508
509
    RuntimeProfile::Counter* _rows_input_counter = nullptr;
510
    RuntimeProfile::Counter* _init_timer = nullptr;
511
    RuntimeProfile::Counter* _open_timer = nullptr;
512
    RuntimeProfile::Counter* _close_timer = nullptr;
513
    RuntimeProfile::Counter* _wait_for_dependency_timer = nullptr;
514
    RuntimeProfile::Counter* _wait_for_finish_dependency_timer = nullptr;
515
    RuntimeProfile::Counter* _exec_timer = nullptr;
516
    RuntimeProfile::HighWaterMarkCounter* _memory_used_counter = nullptr;
517
};
518
519
template <typename SharedStateArg = FakeSharedState>
520
class PipelineXSinkLocalState : public PipelineXSinkLocalStateBase {
521
public:
522
    using SharedStateType = SharedStateArg;
523
    PipelineXSinkLocalState(DataSinkOperatorXBase* parent, RuntimeState* state)
524
72.3k
            : PipelineXSinkLocalStateBase(parent, state) {}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Line
Count
Source
524
27
            : PipelineXSinkLocalStateBase(parent, state) {}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Line
Count
Source
524
9
            : PipelineXSinkLocalStateBase(parent, state) {}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Line
Count
Source
524
102
            : PipelineXSinkLocalStateBase(parent, state) {}
_ZN5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Line
Count
Source
524
7
            : PipelineXSinkLocalStateBase(parent, state) {}
_ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Line
Count
Source
524
3
            : PipelineXSinkLocalStateBase(parent, state) {}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Line
Count
Source
524
27
            : PipelineXSinkLocalStateBase(parent, state) {}
_ZN5doris23PipelineXSinkLocalStateINS_15SortSharedStateEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Line
Count
Source
524
26
            : PipelineXSinkLocalStateBase(parent, state) {}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Line
Count
Source
524
3
            : PipelineXSinkLocalStateBase(parent, state) {}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Line
Count
Source
524
21
            : PipelineXSinkLocalStateBase(parent, state) {}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Line
Count
Source
524
47
            : PipelineXSinkLocalStateBase(parent, state) {}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Line
Count
Source
524
72.0k
            : PipelineXSinkLocalStateBase(parent, state) {}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Line
Count
Source
524
17
            : PipelineXSinkLocalStateBase(parent, state) {}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Line
Count
Source
524
20
            : PipelineXSinkLocalStateBase(parent, state) {}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Line
Count
Source
524
16
            : PipelineXSinkLocalStateBase(parent, state) {}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
525
72.3k
    ~PipelineXSinkLocalState() override = default;
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEED2Ev
Line
Count
Source
525
27
    ~PipelineXSinkLocalState() override = default;
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEED2Ev
Line
Count
Source
525
9
    ~PipelineXSinkLocalState() override = default;
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEED2Ev
Line
Count
Source
525
102
    ~PipelineXSinkLocalState() override = default;
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEED2Ev
Line
Count
Source
525
20
    ~PipelineXSinkLocalState() override = default;
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEED2Ev
Line
Count
Source
525
72.0k
    ~PipelineXSinkLocalState() override = default;
_ZN5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEED2Ev
Line
Count
Source
525
7
    ~PipelineXSinkLocalState() override = default;
_ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEED2Ev
Line
Count
Source
525
3
    ~PipelineXSinkLocalState() override = default;
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEED2Ev
Line
Count
Source
525
27
    ~PipelineXSinkLocalState() override = default;
_ZN5doris23PipelineXSinkLocalStateINS_15SortSharedStateEED2Ev
Line
Count
Source
525
26
    ~PipelineXSinkLocalState() override = default;
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEED2Ev
Line
Count
Source
525
3
    ~PipelineXSinkLocalState() override = default;
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEED2Ev
Line
Count
Source
525
21
    ~PipelineXSinkLocalState() override = default;
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEED2Ev
Line
Count
Source
525
47
    ~PipelineXSinkLocalState() override = default;
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEED2Ev
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEED2Ev
Line
Count
Source
525
16
    ~PipelineXSinkLocalState() override = default;
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEED2Ev
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEED2Ev
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEED2Ev
Line
Count
Source
525
17
    ~PipelineXSinkLocalState() override = default;
526
527
    Status init(RuntimeState* state, LocalSinkStateInfo& info) override;
528
529
68
    Status prepare(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE7prepareEPNS_12RuntimeStateE
Line
Count
Source
529
22
    Status prepare(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE7prepareEPNS_12RuntimeStateE
Line
Count
Source
529
34
    Status prepare(RuntimeState* state) override { return Status::OK(); }
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE7prepareEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE7prepareEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE7prepareEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE7prepareEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE7prepareEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE7prepareEPNS_12RuntimeStateE
Line
Count
Source
529
12
    Status prepare(RuntimeState* state) override { return Status::OK(); }
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE7prepareEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE7prepareEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE7prepareEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE7prepareEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE7prepareEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE7prepareEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE7prepareEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE7prepareEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE7prepareEPNS_12RuntimeStateE
530
72.3k
    Status open(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
530
7
    Status open(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
530
9
    Status open(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
530
47
    Status open(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
530
9
    Status open(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
530
102
    Status open(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
530
20
    Status open(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
530
2
    Status open(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
530
72.0k
    Status open(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
530
3
    Status open(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
530
27
    Status open(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
530
26
    Status open(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
530
17
    Status open(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
530
3
    Status open(RuntimeState* state) override { return Status::OK(); }
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE4openEPNS_12RuntimeStateE
531
532
    Status terminate(RuntimeState* state) override;
533
    Status close(RuntimeState* state, Status exec_status) override;
534
535
    [[nodiscard]] std::string debug_string(int indentation_level) const override;
536
537
    virtual std::string name_suffix();
538
539
44
    std::vector<Dependency*> dependencies() const override {
540
44
        return _dependency ? std::vector<Dependency*> {_dependency} : std::vector<Dependency*> {};
541
44
    }
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE12dependenciesEv
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE12dependenciesEv
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE12dependenciesEv
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE12dependenciesEv
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE12dependenciesEv
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE12dependenciesEv
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE12dependenciesEv
_ZNK5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE12dependenciesEv
Line
Count
Source
539
2
    std::vector<Dependency*> dependencies() const override {
540
2
        return _dependency ? std::vector<Dependency*> {_dependency} : std::vector<Dependency*> {};
541
2
    }
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE12dependenciesEv
_ZNK5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE12dependenciesEv
Line
Count
Source
539
35
    std::vector<Dependency*> dependencies() const override {
540
35
        return _dependency ? std::vector<Dependency*> {_dependency} : std::vector<Dependency*> {};
541
35
    }
_ZNK5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE12dependenciesEv
Line
Count
Source
539
1
    std::vector<Dependency*> dependencies() const override {
540
1
        return _dependency ? std::vector<Dependency*> {_dependency} : std::vector<Dependency*> {};
541
1
    }
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE12dependenciesEv
_ZNK5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE12dependenciesEv
Line
Count
Source
539
6
    std::vector<Dependency*> dependencies() const override {
540
6
        return _dependency ? std::vector<Dependency*> {_dependency} : std::vector<Dependency*> {};
541
6
    }
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE12dependenciesEv
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE12dependenciesEv
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE12dependenciesEv
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE12dependenciesEv
542
543
72.3k
    virtual bool must_set_shared_state() const {
544
72.3k
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
545
72.3k
    }
_ZNK5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE21must_set_shared_stateEv
Line
Count
Source
543
7
    virtual bool must_set_shared_state() const {
544
7
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
545
7
    }
_ZNK5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE21must_set_shared_stateEv
Line
Count
Source
543
16
    virtual bool must_set_shared_state() const {
544
16
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
545
16
    }
_ZNK5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE21must_set_shared_stateEv
Line
Count
Source
543
47
    virtual bool must_set_shared_state() const {
544
47
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
545
47
    }
_ZNK5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE21must_set_shared_stateEv
Line
Count
Source
543
9
    virtual bool must_set_shared_state() const {
544
9
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
545
9
    }
_ZNK5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE21must_set_shared_stateEv
Line
Count
Source
543
102
    virtual bool must_set_shared_state() const {
544
102
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
545
102
    }
_ZNK5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE21must_set_shared_stateEv
Line
Count
Source
543
20
    virtual bool must_set_shared_state() const {
544
20
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
545
20
    }
_ZNK5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE21must_set_shared_stateEv
Line
Count
Source
543
2
    virtual bool must_set_shared_state() const {
544
2
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
545
2
    }
_ZNK5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE21must_set_shared_stateEv
Line
Count
Source
543
72.0k
    virtual bool must_set_shared_state() const {
544
72.0k
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
545
72.0k
    }
_ZNK5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE21must_set_shared_stateEv
Line
Count
Source
543
3
    virtual bool must_set_shared_state() const {
544
3
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
545
3
    }
_ZNK5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE21must_set_shared_stateEv
Line
Count
Source
543
27
    virtual bool must_set_shared_state() const {
544
27
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
545
27
    }
_ZNK5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE21must_set_shared_stateEv
Line
Count
Source
543
26
    virtual bool must_set_shared_state() const {
544
26
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
545
26
    }
_ZNK5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE21must_set_shared_stateEv
Line
Count
Source
543
17
    virtual bool must_set_shared_state() const {
544
17
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
545
17
    }
_ZNK5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE21must_set_shared_stateEv
Line
Count
Source
543
3
    virtual bool must_set_shared_state() const {
544
3
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
545
3
    }
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE21must_set_shared_stateEv
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE21must_set_shared_stateEv
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE21must_set_shared_stateEv
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE21must_set_shared_stateEv
546
547
protected:
548
    Dependency* _dependency = nullptr;
549
    SharedStateType* _shared_state = nullptr;
550
};
551
552
class DataSinkOperatorXBase : public OperatorBase {
553
public:
554
    DataSinkOperatorXBase(const int operator_id, const int node_id, const int dest_id)
555
105
            : _operator_id(operator_id), _node_id(node_id), _dests_id({dest_id}) {}
556
    DataSinkOperatorXBase(const int operator_id, const TPlanNode& tnode, const int dest_id)
557
72.1k
            : OperatorBase(tnode.__isset.is_serial_operator && tnode.is_serial_operator),
558
72.1k
              _operator_id(operator_id),
559
72.1k
              _node_id(tnode.node_id),
560
72.1k
              _dests_id({dest_id}) {}
561
562
    DataSinkOperatorXBase(const int operator_id, const int node_id, std::vector<int>& dests)
563
0
            : _operator_id(operator_id), _node_id(node_id), _dests_id(dests) {}
564
565
#ifdef BE_TEST
566
72.2k
    DataSinkOperatorXBase() : _operator_id(-1), _node_id(0), _dests_id({-1}) {};
567
#endif
568
569
144k
    ~DataSinkOperatorXBase() override = default;
570
571
    // For agg/sort/join sink.
572
    virtual Status init(const TPlanNode& tnode, RuntimeState* state);
573
574
11
    virtual bool reset_to_rerun(RuntimeState* state, OperatorXBase* root) const { return false; }
575
576
    Status init(const TDataSink& tsink) override;
577
    [[nodiscard]] virtual Status init(RuntimeState* state, ExchangeType type, const int num_buckets,
578
                                      const bool use_global_hash_shuffle,
579
0
                                      const std::map<int, int>& shuffle_idx_to_instance_idx) {
580
0
        return Status::InternalError("init() is only implemented in local exchange!");
581
0
    }
582
583
72.1k
    Status prepare(RuntimeState* state) override { return Status::OK(); }
584
    Status terminate(RuntimeState* state) override;
585
1.59M
    [[nodiscard]] bool is_finished(RuntimeState* state) const {
586
1.59M
        auto result = state->get_sink_local_state_result();
587
1.59M
        if (!result) {
588
0
            return result.error();
589
0
        }
590
1.59M
        return result.value()->is_finished();
591
1.59M
    }
592
593
    [[nodiscard]] virtual Status sink(RuntimeState* state, Block* block, bool eos) = 0;
594
595
    [[nodiscard]] virtual Status setup_local_state(RuntimeState* state,
596
                                                   LocalSinkStateInfo& info) = 0;
597
598
    // Returns the memory this sink operator expects to allocate in the next
599
    // execution round (sink only — pipeline task sums all operators + sink).
600
938
    [[nodiscard]] virtual size_t get_reserve_mem_size(RuntimeState* state, bool eos) {
601
938
        return state->minimum_operator_memory_required_bytes();
602
938
    }
603
0
    bool is_blockable(RuntimeState* state) const override {
604
0
        return state->get_sink_local_state()->is_blockable();
605
0
    }
606
607
0
    [[nodiscard]] bool is_spillable() const { return _spillable; }
608
609
    template <class TARGET>
610
814k
    TARGET& cast() {
611
814k
        DCHECK(dynamic_cast<TARGET*>(this))
612
0
                << " Mismatch type! Current type is " << typeid(*this).name()
613
0
                << " and expect type is" << typeid(TARGET).name();
614
814k
        return reinterpret_cast<TARGET&>(*this);
615
814k
    }
_ZN5doris21DataSinkOperatorXBase4castINS_18DummySinkOperatorXEEERT_v
Line
Count
Source
610
39
    TARGET& cast() {
611
39
        DCHECK(dynamic_cast<TARGET*>(this))
612
0
                << " Mismatch type! Current type is " << typeid(*this).name()
613
0
                << " and expect type is" << typeid(TARGET).name();
614
39
        return reinterpret_cast<TARGET&>(*this);
615
39
    }
Unexecuted instantiation: _ZN5doris21DataSinkOperatorXBase4castINS_26LocalExchangeSinkOperatorXEEERT_v
_ZN5doris21DataSinkOperatorXBase4castINS_16AggSinkOperatorXEEERT_v
Line
Count
Source
610
178
    TARGET& cast() {
611
178
        DCHECK(dynamic_cast<TARGET*>(this))
612
0
                << " Mismatch type! Current type is " << typeid(*this).name()
613
0
                << " and expect type is" << typeid(TARGET).name();
614
178
        return reinterpret_cast<TARGET&>(*this);
615
178
    }
_ZN5doris21DataSinkOperatorXBase4castINS_21AnalyticSinkOperatorXEEERT_v
Line
Count
Source
610
101
    TARGET& cast() {
611
101
        DCHECK(dynamic_cast<TARGET*>(this))
612
0
                << " Mismatch type! Current type is " << typeid(*this).name()
613
0
                << " and expect type is" << typeid(TARGET).name();
614
101
        return reinterpret_cast<TARGET&>(*this);
615
101
    }
_ZN5doris21DataSinkOperatorXBase4castINS_21ExchangeSinkOperatorXEEERT_v
Line
Count
Source
610
24
    TARGET& cast() {
611
24
        DCHECK(dynamic_cast<TARGET*>(this))
612
0
                << " Mismatch type! Current type is " << typeid(*this).name()
613
0
                << " and expect type is" << typeid(TARGET).name();
614
24
        return reinterpret_cast<TARGET&>(*this);
615
24
    }
_ZN5doris21DataSinkOperatorXBase4castINS_26HashJoinBuildSinkOperatorXEEERT_v
Line
Count
Source
610
814k
    TARGET& cast() {
611
814k
        DCHECK(dynamic_cast<TARGET*>(this))
612
0
                << " Mismatch type! Current type is " << typeid(*this).name()
613
0
                << " and expect type is" << typeid(TARGET).name();
614
814k
        return reinterpret_cast<TARGET&>(*this);
615
814k
    }
Unexecuted instantiation: _ZN5doris21DataSinkOperatorXBase4castINS_32NestedLoopJoinBuildSinkOperatorXEEERT_v
_ZN5doris21DataSinkOperatorXBase4castINS_32PartitionedHashJoinSinkOperatorXEEERT_v
Line
Count
Source
610
17
    TARGET& cast() {
611
17
        DCHECK(dynamic_cast<TARGET*>(this))
612
0
                << " Mismatch type! Current type is " << typeid(*this).name()
613
0
                << " and expect type is" << typeid(TARGET).name();
614
17
        return reinterpret_cast<TARGET&>(*this);
615
17
    }
Unexecuted instantiation: _ZN5doris21DataSinkOperatorXBase4castINS_23ResultFileSinkOperatorXEEERT_v
Unexecuted instantiation: _ZN5doris21DataSinkOperatorXBase4castINS_22JdbcTableSinkOperatorXEEERT_v
Unexecuted instantiation: _ZN5doris21DataSinkOperatorXBase4castINS_22OlapTableSinkOperatorXEEERT_v
Unexecuted instantiation: _ZN5doris21DataSinkOperatorXBase4castINS_24OlapTableSinkV2OperatorXEEERT_v
Unexecuted instantiation: _ZN5doris21DataSinkOperatorXBase4castINS_22HiveTableSinkOperatorXEEERT_v
Unexecuted instantiation: _ZN5doris21DataSinkOperatorXBase4castINS_25IcebergTableSinkOperatorXEEERT_v
Unexecuted instantiation: _ZN5doris21DataSinkOperatorXBase4castINS_30SpillIcebergTableSinkOperatorXEEERT_v
Unexecuted instantiation: _ZN5doris21DataSinkOperatorXBase4castINS_26IcebergDeleteSinkOperatorXEEERT_v
Unexecuted instantiation: _ZN5doris21DataSinkOperatorXBase4castINS_25IcebergMergeSinkOperatorXEEERT_v
Unexecuted instantiation: _ZN5doris21DataSinkOperatorXBase4castINS_20MCTableSinkOperatorXEEERT_v
Unexecuted instantiation: _ZN5doris21DataSinkOperatorXBase4castINS_21TVFTableSinkOperatorXEEERT_v
Unexecuted instantiation: _ZN5doris21DataSinkOperatorXBase4castINS_26MemoryScratchSinkOperatorXEEERT_v
Unexecuted instantiation: _ZN5doris21DataSinkOperatorXBase4castINS_29GroupCommitBlockSinkOperatorXEEERT_v
Unexecuted instantiation: _ZN5doris21DataSinkOperatorXBase4castINS_17DictSinkOperatorXEEERT_v
_ZN5doris21DataSinkOperatorXBase4castINS_26PartitionSortSinkOperatorXEEERT_v
Line
Count
Source
610
102
    TARGET& cast() {
611
102
        DCHECK(dynamic_cast<TARGET*>(this))
612
0
                << " Mismatch type! Current type is " << typeid(*this).name()
613
0
                << " and expect type is" << typeid(TARGET).name();
614
102
        return reinterpret_cast<TARGET&>(*this);
615
102
    }
_ZN5doris21DataSinkOperatorXBase4castINS_27PartitionedAggSinkOperatorXEEERT_v
Line
Count
Source
610
173
    TARGET& cast() {
611
173
        DCHECK(dynamic_cast<TARGET*>(this))
612
0
                << " Mismatch type! Current type is " << typeid(*this).name()
613
0
                << " and expect type is" << typeid(TARGET).name();
614
173
        return reinterpret_cast<TARGET&>(*this);
615
173
    }
Unexecuted instantiation: _ZN5doris21DataSinkOperatorXBase4castINS_25RecCTEAnchorSinkOperatorXEEERT_v
Unexecuted instantiation: _ZN5doris21DataSinkOperatorXBase4castINS_19RecCTESinkOperatorXEEERT_v
Unexecuted instantiation: _ZN5doris21DataSinkOperatorXBase4castINS_19ResultSinkOperatorXEEERT_v
_ZN5doris21DataSinkOperatorXBase4castINS_21SetProbeSinkOperatorXILb1EEEEERT_v
Line
Count
Source
610
9
    TARGET& cast() {
611
9
        DCHECK(dynamic_cast<TARGET*>(this))
612
0
                << " Mismatch type! Current type is " << typeid(*this).name()
613
0
                << " and expect type is" << typeid(TARGET).name();
614
9
        return reinterpret_cast<TARGET&>(*this);
615
9
    }
_ZN5doris21DataSinkOperatorXBase4castINS_21SetProbeSinkOperatorXILb0EEEEERT_v
Line
Count
Source
610
6
    TARGET& cast() {
611
6
        DCHECK(dynamic_cast<TARGET*>(this))
612
0
                << " Mismatch type! Current type is " << typeid(*this).name()
613
0
                << " and expect type is" << typeid(TARGET).name();
614
6
        return reinterpret_cast<TARGET&>(*this);
615
6
    }
_ZN5doris21DataSinkOperatorXBase4castINS_16SetSinkOperatorXILb1EEEEERT_v
Line
Count
Source
610
14
    TARGET& cast() {
611
14
        DCHECK(dynamic_cast<TARGET*>(this))
612
0
                << " Mismatch type! Current type is " << typeid(*this).name()
613
0
                << " and expect type is" << typeid(TARGET).name();
614
14
        return reinterpret_cast<TARGET&>(*this);
615
14
    }
_ZN5doris21DataSinkOperatorXBase4castINS_16SetSinkOperatorXILb0EEEEERT_v
Line
Count
Source
610
10
    TARGET& cast() {
611
10
        DCHECK(dynamic_cast<TARGET*>(this))
612
0
                << " Mismatch type! Current type is " << typeid(*this).name()
613
0
                << " and expect type is" << typeid(TARGET).name();
614
10
        return reinterpret_cast<TARGET&>(*this);
615
10
    }
_ZN5doris21DataSinkOperatorXBase4castINS_17SortSinkOperatorXEEERT_v
Line
Count
Source
610
26
    TARGET& cast() {
611
26
        DCHECK(dynamic_cast<TARGET*>(this))
612
0
                << " Mismatch type! Current type is " << typeid(*this).name()
613
0
                << " and expect type is" << typeid(TARGET).name();
614
26
        return reinterpret_cast<TARGET&>(*this);
615
26
    }
_ZN5doris21DataSinkOperatorXBase4castINS_22SpillSortSinkOperatorXEEERT_v
Line
Count
Source
610
45
    TARGET& cast() {
611
45
        DCHECK(dynamic_cast<TARGET*>(this))
612
0
                << " Mismatch type! Current type is " << typeid(*this).name()
613
0
                << " and expect type is" << typeid(TARGET).name();
614
45
        return reinterpret_cast<TARGET&>(*this);
615
45
    }
_ZN5doris21DataSinkOperatorXBase4castINS_18UnionSinkOperatorXEEERT_v
Line
Count
Source
610
6
    TARGET& cast() {
611
6
        DCHECK(dynamic_cast<TARGET*>(this))
612
0
                << " Mismatch type! Current type is " << typeid(*this).name()
613
0
                << " and expect type is" << typeid(TARGET).name();
614
6
        return reinterpret_cast<TARGET&>(*this);
615
6
    }
616
    template <class TARGET>
617
    const TARGET& cast() const {
618
        DCHECK(dynamic_cast<const TARGET*>(this))
619
                << " Mismatch type! Current type is " << typeid(*this).name()
620
                << " and expect type is" << typeid(TARGET).name();
621
        return reinterpret_cast<const TARGET&>(*this);
622
    }
623
624
    [[nodiscard]] virtual std::shared_ptr<BasicSharedState> create_shared_state() const = 0;
625
626
0
    Status close(RuntimeState* state) override {
627
0
        return Status::InternalError("Should not reach here!");
628
0
    }
629
630
    [[nodiscard]] virtual std::string debug_string(int indentation_level) const;
631
632
    [[nodiscard]] virtual std::string debug_string(RuntimeState* state,
633
                                                   int indentation_level) const;
634
635
144k
    [[nodiscard]] bool is_sink() const override { return true; }
636
637
72.0k
    static Status close(RuntimeState* state, Status exec_status) {
638
72.0k
        auto result = state->get_sink_local_state_result();
639
72.0k
        if (!result) {
640
0
            return result.error();
641
0
        }
642
72.0k
        return result.value()->close(state, exec_status);
643
72.0k
    }
644
645
264k
    [[nodiscard]] int operator_id() const { return _operator_id; }
646
647
289k
    [[nodiscard]] const std::vector<int>& dests_id() const { return _dests_id; }
648
649
144k
    [[nodiscard]] int nereids_id() const { return _nereids_id; }
650
651
305k
    [[nodiscard]] int node_id() const override { return _node_id; }
652
653
218k
    [[nodiscard]] std::string get_name() const override { return _name; }
654
655
12
    virtual bool should_dry_run(RuntimeState* state) { return false; }
656
657
0
    [[nodiscard]] virtual bool count_down_destination() { return true; }
658
659
protected:
660
    template <typename Writer, typename Parent>
661
        requires(std::is_base_of_v<AsyncResultWriter, Writer>)
662
    friend class AsyncWriterSink;
663
    // _operator_id : the current Operator's ID, which is not visible to the user.
664
    // _node_id : the plan node ID corresponding to the Operator, which is visible on the profile.
665
    // _dests_id : the target _operator_id of the sink, for example, in the case of a multi-sink, there are multiple targets.
666
    const int _operator_id;
667
    const int _node_id;
668
    int _nereids_id = -1;
669
    bool _spillable = false;
670
    std::vector<int> _dests_id;
671
    std::string _name;
672
};
673
674
template <typename LocalStateType>
675
class DataSinkOperatorX : public DataSinkOperatorXBase {
676
public:
677
    DataSinkOperatorX(const int id, const int node_id, const int dest_id)
678
105
            : DataSinkOperatorXBase(id, node_id, dest_id) {}
_ZN5doris17DataSinkOperatorXINS_17AggSinkLocalStateEEC2Eiii
Line
Count
Source
678
27
            : DataSinkOperatorXBase(id, node_id, dest_id) {}
_ZN5doris17DataSinkOperatorXINS_19DummySinkLocalStateEEC2Eiii
Line
Count
Source
678
19
            : DataSinkOperatorXBase(id, node_id, dest_id) {}
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_22AnalyticSinkLocalStateEEC2Eiii
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_19CacheSinkLocalStateEEC2Eiii
_ZN5doris17DataSinkOperatorXINS_22ExchangeSinkLocalStateEEC2Eiii
Line
Count
Source
678
10
            : DataSinkOperatorXBase(id, node_id, dest_id) {}
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_27HashJoinBuildSinkLocalStateEEC2Eiii
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_20ResultSinkLocalStateEEC2Eiii
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_23JdbcTableSinkLocalStateEEC2Eiii
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_27MemoryScratchSinkLocalStateEEC2Eiii
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_24ResultFileSinkLocalStateEEC2Eiii
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_23OlapTableSinkLocalStateEEC2Eiii
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_25OlapTableSinkV2LocalStateEEC2Eiii
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_23HiveTableSinkLocalStateEEC2Eiii
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_22TVFTableSinkLocalStateEEC2Eiii
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_26IcebergTableSinkLocalStateEEC2Eiii
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_31SpillIcebergTableSinkLocalStateEEC2Eiii
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_27IcebergDeleteSinkLocalStateEEC2Eiii
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_26IcebergMergeSinkLocalStateEEC2Eiii
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_21MCTableSinkLocalStateEEC2Eiii
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_23BlackholeSinkLocalStateEEC2Eiii
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_18SortSinkLocalStateEEC2Eiii
_ZN5doris17DataSinkOperatorXINS_23SpillSortSinkLocalStateEEC2Eiii
Line
Count
Source
678
19
            : DataSinkOperatorXBase(id, node_id, dest_id) {}
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_27LocalExchangeSinkLocalStateEEC2Eiii
_ZN5doris17DataSinkOperatorXINS_28PartitionedAggSinkLocalStateEEC2Eiii
Line
Count
Source
678
30
            : DataSinkOperatorXBase(id, node_id, dest_id) {}
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_33NestedLoopJoinBuildSinkLocalStateEEC2Eiii
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_19UnionSinkLocalStateEEC2Eiii
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_33MultiCastDataStreamSinkLocalStateEEC2Eiii
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_27PartitionSortSinkLocalStateEEC2Eiii
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb1EEEEC2Eiii
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb0EEEEC2Eiii
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb1EEEEC2Eiii
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb0EEEEC2Eiii
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_33PartitionedHashJoinSinkLocalStateEEC2Eiii
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_30GroupCommitBlockSinkLocalStateEEC2Eiii
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_18DictSinkLocalStateEEC2Eiii
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_20RecCTESinkLocalStateEEC2Eiii
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_26RecCTEAnchorSinkLocalStateEEC2Eiii
679
    DataSinkOperatorX(const int id, const TPlanNode& tnode, const int dest_id)
680
72.1k
            : DataSinkOperatorXBase(id, tnode, dest_id) {}
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_19DummySinkLocalStateEEC2EiRKNS_9TPlanNodeEi
_ZN5doris17DataSinkOperatorXINS_17AggSinkLocalStateEEC2EiRKNS_9TPlanNodeEi
Line
Count
Source
680
30
            : DataSinkOperatorXBase(id, tnode, dest_id) {}
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_22AnalyticSinkLocalStateEEC2EiRKNS_9TPlanNodeEi
_ZN5doris17DataSinkOperatorXINS_27HashJoinBuildSinkLocalStateEEC2EiRKNS_9TPlanNodeEi
Line
Count
Source
680
72.0k
            : DataSinkOperatorXBase(id, tnode, dest_id) {}
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_33NestedLoopJoinBuildSinkLocalStateEEC2EiRKNS_9TPlanNodeEi
_ZN5doris17DataSinkOperatorXINS_33PartitionedHashJoinSinkLocalStateEEC2EiRKNS_9TPlanNodeEi
Line
Count
Source
680
50
            : DataSinkOperatorXBase(id, tnode, dest_id) {}
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_20ResultSinkLocalStateEEC2EiRKNS_9TPlanNodeEi
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_23JdbcTableSinkLocalStateEEC2EiRKNS_9TPlanNodeEi
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_27MemoryScratchSinkLocalStateEEC2EiRKNS_9TPlanNodeEi
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_24ResultFileSinkLocalStateEEC2EiRKNS_9TPlanNodeEi
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_23OlapTableSinkLocalStateEEC2EiRKNS_9TPlanNodeEi
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_25OlapTableSinkV2LocalStateEEC2EiRKNS_9TPlanNodeEi
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_23HiveTableSinkLocalStateEEC2EiRKNS_9TPlanNodeEi
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_22TVFTableSinkLocalStateEEC2EiRKNS_9TPlanNodeEi
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_26IcebergTableSinkLocalStateEEC2EiRKNS_9TPlanNodeEi
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_31SpillIcebergTableSinkLocalStateEEC2EiRKNS_9TPlanNodeEi
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_27IcebergDeleteSinkLocalStateEEC2EiRKNS_9TPlanNodeEi
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_26IcebergMergeSinkLocalStateEEC2EiRKNS_9TPlanNodeEi
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_21MCTableSinkLocalStateEEC2EiRKNS_9TPlanNodeEi
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_23BlackholeSinkLocalStateEEC2EiRKNS_9TPlanNodeEi
_ZN5doris17DataSinkOperatorXINS_18SortSinkLocalStateEEC2EiRKNS_9TPlanNodeEi
Line
Count
Source
680
19
            : DataSinkOperatorXBase(id, tnode, dest_id) {}
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_23SpillSortSinkLocalStateEEC2EiRKNS_9TPlanNodeEi
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_27LocalExchangeSinkLocalStateEEC2EiRKNS_9TPlanNodeEi
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_28PartitionedAggSinkLocalStateEEC2EiRKNS_9TPlanNodeEi
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_22ExchangeSinkLocalStateEEC2EiRKNS_9TPlanNodeEi
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_19UnionSinkLocalStateEEC2EiRKNS_9TPlanNodeEi
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_33MultiCastDataStreamSinkLocalStateEEC2EiRKNS_9TPlanNodeEi
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_27PartitionSortSinkLocalStateEEC2EiRKNS_9TPlanNodeEi
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb1EEEEC2EiRKNS_9TPlanNodeEi
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb0EEEEC2EiRKNS_9TPlanNodeEi
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb1EEEEC2EiRKNS_9TPlanNodeEi
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb0EEEEC2EiRKNS_9TPlanNodeEi
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_30GroupCommitBlockSinkLocalStateEEC2EiRKNS_9TPlanNodeEi
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_19CacheSinkLocalStateEEC2EiRKNS_9TPlanNodeEi
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_18DictSinkLocalStateEEC2EiRKNS_9TPlanNodeEi
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_20RecCTESinkLocalStateEEC2EiRKNS_9TPlanNodeEi
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_26RecCTEAnchorSinkLocalStateEEC2EiRKNS_9TPlanNodeEi
681
682
    DataSinkOperatorX(const int id, const int node_id, std::vector<int> dest_ids)
683
0
            : DataSinkOperatorXBase(id, node_id, dest_ids) {}
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_19DummySinkLocalStateEEC2EiiSt6vectorIiSaIiEE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_22AnalyticSinkLocalStateEEC2EiiSt6vectorIiSaIiEE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_27HashJoinBuildSinkLocalStateEEC2EiiSt6vectorIiSaIiEE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_20ResultSinkLocalStateEEC2EiiSt6vectorIiSaIiEE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_23JdbcTableSinkLocalStateEEC2EiiSt6vectorIiSaIiEE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_27MemoryScratchSinkLocalStateEEC2EiiSt6vectorIiSaIiEE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_24ResultFileSinkLocalStateEEC2EiiSt6vectorIiSaIiEE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_23OlapTableSinkLocalStateEEC2EiiSt6vectorIiSaIiEE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_25OlapTableSinkV2LocalStateEEC2EiiSt6vectorIiSaIiEE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_23HiveTableSinkLocalStateEEC2EiiSt6vectorIiSaIiEE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_22TVFTableSinkLocalStateEEC2EiiSt6vectorIiSaIiEE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_26IcebergTableSinkLocalStateEEC2EiiSt6vectorIiSaIiEE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_31SpillIcebergTableSinkLocalStateEEC2EiiSt6vectorIiSaIiEE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_27IcebergDeleteSinkLocalStateEEC2EiiSt6vectorIiSaIiEE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_26IcebergMergeSinkLocalStateEEC2EiiSt6vectorIiSaIiEE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_21MCTableSinkLocalStateEEC2EiiSt6vectorIiSaIiEE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_23BlackholeSinkLocalStateEEC2EiiSt6vectorIiSaIiEE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_18SortSinkLocalStateEEC2EiiSt6vectorIiSaIiEE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_23SpillSortSinkLocalStateEEC2EiiSt6vectorIiSaIiEE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_27LocalExchangeSinkLocalStateEEC2EiiSt6vectorIiSaIiEE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_17AggSinkLocalStateEEC2EiiSt6vectorIiSaIiEE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_28PartitionedAggSinkLocalStateEEC2EiiSt6vectorIiSaIiEE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_22ExchangeSinkLocalStateEEC2EiiSt6vectorIiSaIiEE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_33NestedLoopJoinBuildSinkLocalStateEEC2EiiSt6vectorIiSaIiEE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_19UnionSinkLocalStateEEC2EiiSt6vectorIiSaIiEE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_33MultiCastDataStreamSinkLocalStateEEC2EiiSt6vectorIiSaIiEE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_27PartitionSortSinkLocalStateEEC2EiiSt6vectorIiSaIiEE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb1EEEEC2EiiSt6vectorIiSaIiEE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb0EEEEC2EiiSt6vectorIiSaIiEE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb1EEEEC2EiiSt6vectorIiSaIiEE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb0EEEEC2EiiSt6vectorIiSaIiEE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_33PartitionedHashJoinSinkLocalStateEEC2EiiSt6vectorIiSaIiEE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_30GroupCommitBlockSinkLocalStateEEC2EiiSt6vectorIiSaIiEE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_19CacheSinkLocalStateEEC2EiiSt6vectorIiSaIiEE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_18DictSinkLocalStateEEC2EiiSt6vectorIiSaIiEE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_20RecCTESinkLocalStateEEC2EiiSt6vectorIiSaIiEE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_26RecCTEAnchorSinkLocalStateEEC2EiiSt6vectorIiSaIiEE
684
#ifdef BE_TEST
685
154
    DataSinkOperatorX() = default;
_ZN5doris17DataSinkOperatorXINS_22AnalyticSinkLocalStateEEC2Ev
Line
Count
Source
685
9
    DataSinkOperatorX() = default;
_ZN5doris17DataSinkOperatorXINS_27PartitionSortSinkLocalStateEEC2Ev
Line
Count
Source
685
102
    DataSinkOperatorX() = default;
_ZN5doris17DataSinkOperatorXINS_19CacheSinkLocalStateEEC2Ev
Line
Count
Source
685
3
    DataSinkOperatorX() = default;
_ZN5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb1EEEEC2Ev
Line
Count
Source
685
7
    DataSinkOperatorX() = default;
_ZN5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb1EEEEC2Ev
Line
Count
Source
685
9
    DataSinkOperatorX() = default;
_ZN5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb0EEEEC2Ev
Line
Count
Source
685
5
    DataSinkOperatorX() = default;
_ZN5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb0EEEEC2Ev
Line
Count
Source
685
6
    DataSinkOperatorX() = default;
_ZN5doris17DataSinkOperatorXINS_18SortSinkLocalStateEEC2Ev
Line
Count
Source
685
9
    DataSinkOperatorX() = default;
_ZN5doris17DataSinkOperatorXINS_19UnionSinkLocalStateEEC2Ev
Line
Count
Source
685
3
    DataSinkOperatorX() = default;
_ZN5doris17DataSinkOperatorXINS_27LocalExchangeSinkLocalStateEEC2Ev
Line
Count
Source
685
1
    DataSinkOperatorX() = default;
686
#endif
687
72.4k
    ~DataSinkOperatorX() override = default;
_ZN5doris17DataSinkOperatorXINS_17AggSinkLocalStateEED2Ev
Line
Count
Source
687
57
    ~DataSinkOperatorX() override = default;
_ZN5doris17DataSinkOperatorXINS_22AnalyticSinkLocalStateEED2Ev
Line
Count
Source
687
9
    ~DataSinkOperatorX() override = default;
_ZN5doris17DataSinkOperatorXINS_22ExchangeSinkLocalStateEED2Ev
Line
Count
Source
687
10
    ~DataSinkOperatorX() override = default;
_ZN5doris17DataSinkOperatorXINS_27PartitionSortSinkLocalStateEED2Ev
Line
Count
Source
687
102
    ~DataSinkOperatorX() override = default;
_ZN5doris17DataSinkOperatorXINS_27HashJoinBuildSinkLocalStateEED2Ev
Line
Count
Source
687
72.0k
    ~DataSinkOperatorX() override = default;
_ZN5doris17DataSinkOperatorXINS_33PartitionedHashJoinSinkLocalStateEED2Ev
Line
Count
Source
687
50
    ~DataSinkOperatorX() override = default;
_ZN5doris17DataSinkOperatorXINS_19CacheSinkLocalStateEED2Ev
Line
Count
Source
687
3
    ~DataSinkOperatorX() override = default;
_ZN5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb1EEEED2Ev
Line
Count
Source
687
7
    ~DataSinkOperatorX() override = default;
_ZN5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb1EEEED2Ev
Line
Count
Source
687
9
    ~DataSinkOperatorX() override = default;
_ZN5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb0EEEED2Ev
Line
Count
Source
687
5
    ~DataSinkOperatorX() override = default;
_ZN5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb0EEEED2Ev
Line
Count
Source
687
6
    ~DataSinkOperatorX() override = default;
_ZN5doris17DataSinkOperatorXINS_18SortSinkLocalStateEED2Ev
Line
Count
Source
687
28
    ~DataSinkOperatorX() override = default;
_ZN5doris17DataSinkOperatorXINS_23SpillSortSinkLocalStateEED2Ev
Line
Count
Source
687
19
    ~DataSinkOperatorX() override = default;
_ZN5doris17DataSinkOperatorXINS_19UnionSinkLocalStateEED2Ev
Line
Count
Source
687
3
    ~DataSinkOperatorX() override = default;
_ZN5doris17DataSinkOperatorXINS_27LocalExchangeSinkLocalStateEED2Ev
Line
Count
Source
687
1
    ~DataSinkOperatorX() override = default;
_ZN5doris17DataSinkOperatorXINS_19DummySinkLocalStateEED2Ev
Line
Count
Source
687
19
    ~DataSinkOperatorX() override = default;
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_33NestedLoopJoinBuildSinkLocalStateEED2Ev
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_30GroupCommitBlockSinkLocalStateEED2Ev
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_23HiveTableSinkLocalStateEED2Ev
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_27IcebergDeleteSinkLocalStateEED2Ev
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_26IcebergMergeSinkLocalStateEED2Ev
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_26IcebergTableSinkLocalStateEED2Ev
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_21MCTableSinkLocalStateEED2Ev
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_33MultiCastDataStreamSinkLocalStateEED2Ev
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_23OlapTableSinkLocalStateEED2Ev
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_25OlapTableSinkV2LocalStateEED2Ev
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_26RecCTEAnchorSinkLocalStateEED2Ev
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_20RecCTESinkLocalStateEED2Ev
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_22TVFTableSinkLocalStateEED2Ev
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_20ResultSinkLocalStateEED2Ev
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_23JdbcTableSinkLocalStateEED2Ev
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_27MemoryScratchSinkLocalStateEED2Ev
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_24ResultFileSinkLocalStateEED2Ev
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_31SpillIcebergTableSinkLocalStateEED2Ev
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_23BlackholeSinkLocalStateEED2Ev
_ZN5doris17DataSinkOperatorXINS_28PartitionedAggSinkLocalStateEED2Ev
Line
Count
Source
687
30
    ~DataSinkOperatorX() override = default;
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_18DictSinkLocalStateEED2Ev
688
689
    Status setup_local_state(RuntimeState* state, LocalSinkStateInfo& info) override;
690
    std::shared_ptr<BasicSharedState> create_shared_state() const override;
691
692
    using LocalState = LocalStateType;
693
312k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
694
312k
        return state->get_sink_local_state()->template cast<LocalState>();
695
312k
    }
_ZNK5doris17DataSinkOperatorXINS_22ExchangeSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
693
10
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
694
10
        return state->get_sink_local_state()->template cast<LocalState>();
695
10
    }
_ZNK5doris17DataSinkOperatorXINS_17AggSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
693
191
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
694
191
        return state->get_sink_local_state()->template cast<LocalState>();
695
191
    }
_ZNK5doris17DataSinkOperatorXINS_19UnionSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
693
16
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
694
16
        return state->get_sink_local_state()->template cast<LocalState>();
695
16
    }
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_27LocalExchangeSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_19DummySinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
_ZNK5doris17DataSinkOperatorXINS_22AnalyticSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
693
74
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
694
74
        return state->get_sink_local_state()->template cast<LocalState>();
695
74
    }
_ZNK5doris17DataSinkOperatorXINS_19CacheSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
693
3
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
694
3
        return state->get_sink_local_state()->template cast<LocalState>();
695
3
    }
_ZNK5doris17DataSinkOperatorXINS_27HashJoinBuildSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
693
312k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
694
312k
        return state->get_sink_local_state()->template cast<LocalState>();
695
312k
    }
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_33NestedLoopJoinBuildSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_20ResultSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_23JdbcTableSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_27MemoryScratchSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_24ResultFileSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_23OlapTableSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_25OlapTableSinkV2LocalStateEE15get_local_stateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_23HiveTableSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22TVFTableSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_26IcebergTableSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_31SpillIcebergTableSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_27IcebergDeleteSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_26IcebergMergeSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_21MCTableSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_23BlackholeSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
_ZNK5doris17DataSinkOperatorXINS_18SortSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
693
112
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
694
112
        return state->get_sink_local_state()->template cast<LocalState>();
695
112
    }
_ZNK5doris17DataSinkOperatorXINS_23SpillSortSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
693
45
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
694
45
        return state->get_sink_local_state()->template cast<LocalState>();
695
45
    }
_ZNK5doris17DataSinkOperatorXINS_28PartitionedAggSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
693
104
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
694
104
        return state->get_sink_local_state()->template cast<LocalState>();
695
104
    }
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_33MultiCastDataStreamSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
_ZNK5doris17DataSinkOperatorXINS_27PartitionSortSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
693
104
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
694
104
        return state->get_sink_local_state()->template cast<LocalState>();
695
104
    }
_ZNK5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb1EEEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
693
9
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
694
9
        return state->get_sink_local_state()->template cast<LocalState>();
695
9
    }
_ZNK5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb0EEEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
693
6
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
694
6
        return state->get_sink_local_state()->template cast<LocalState>();
695
6
    }
_ZNK5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb1EEEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
693
15
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
694
15
        return state->get_sink_local_state()->template cast<LocalState>();
695
15
    }
_ZNK5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb0EEEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
693
46
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
694
46
        return state->get_sink_local_state()->template cast<LocalState>();
695
46
    }
_ZNK5doris17DataSinkOperatorXINS_33PartitionedHashJoinSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
693
8
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
694
8
        return state->get_sink_local_state()->template cast<LocalState>();
695
8
    }
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_30GroupCommitBlockSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_18DictSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_20RecCTESinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_26RecCTEAnchorSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
696
};
697
698
template <typename SharedStateArg>
699
class PipelineXSpillSinkLocalState : public PipelineXSinkLocalState<SharedStateArg> {
700
public:
701
    using Base = PipelineXSinkLocalState<SharedStateArg>;
702
    PipelineXSpillSinkLocalState(DataSinkOperatorXBase* parent, RuntimeState* state)
703
44
            : Base(parent, state) {}
_ZN5doris28PipelineXSpillSinkLocalStateINS_30PartitionedHashJoinSharedStateEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Line
Count
Source
703
7
            : Base(parent, state) {}
Unexecuted instantiation: _ZN5doris28PipelineXSpillSinkLocalStateINS_20MultiCastSharedStateEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
_ZN5doris28PipelineXSpillSinkLocalStateINS_25PartitionedAggSharedStateEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Line
Count
Source
703
20
            : Base(parent, state) {}
_ZN5doris28PipelineXSpillSinkLocalStateINS_20SpillSortSharedStateEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Line
Count
Source
703
17
            : Base(parent, state) {}
704
44
    ~PipelineXSpillSinkLocalState() override = default;
_ZN5doris28PipelineXSpillSinkLocalStateINS_25PartitionedAggSharedStateEED2Ev
Line
Count
Source
704
20
    ~PipelineXSpillSinkLocalState() override = default;
_ZN5doris28PipelineXSpillSinkLocalStateINS_30PartitionedHashJoinSharedStateEED2Ev
Line
Count
Source
704
7
    ~PipelineXSpillSinkLocalState() override = default;
Unexecuted instantiation: _ZN5doris28PipelineXSpillSinkLocalStateINS_20MultiCastSharedStateEED2Ev
_ZN5doris28PipelineXSpillSinkLocalStateINS_20SpillSortSharedStateEED2Ev
Line
Count
Source
704
17
    ~PipelineXSpillSinkLocalState() override = default;
705
706
39
    Status init(RuntimeState* state, LocalSinkStateInfo& info) override {
707
39
        RETURN_IF_ERROR(Base::init(state, info));
708
39
        init_spill_counters();
709
39
        return Status::OK();
710
39
    }
_ZN5doris28PipelineXSpillSinkLocalStateINS_25PartitionedAggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
706
20
    Status init(RuntimeState* state, LocalSinkStateInfo& info) override {
707
20
        RETURN_IF_ERROR(Base::init(state, info));
708
20
        init_spill_counters();
709
20
        return Status::OK();
710
20
    }
_ZN5doris28PipelineXSpillSinkLocalStateINS_30PartitionedHashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
706
2
    Status init(RuntimeState* state, LocalSinkStateInfo& info) override {
707
2
        RETURN_IF_ERROR(Base::init(state, info));
708
2
        init_spill_counters();
709
2
        return Status::OK();
710
2
    }
_ZN5doris28PipelineXSpillSinkLocalStateINS_20SpillSortSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
706
17
    Status init(RuntimeState* state, LocalSinkStateInfo& info) override {
707
17
        RETURN_IF_ERROR(Base::init(state, info));
708
17
        init_spill_counters();
709
17
        return Status::OK();
710
17
    }
Unexecuted instantiation: _ZN5doris28PipelineXSpillSinkLocalStateINS_20MultiCastSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
711
712
44
    void init_spill_counters() {
713
44
        _spill_total_timer =
714
44
                ADD_TIMER_WITH_LEVEL(Base::custom_profile(), profile::SPILL_TOTAL_TIME, 1);
715
716
44
        _write_counters.init(Base::custom_profile());
717
718
        // SpillFileWriter looks up these counters via get_counter() in its
719
        // constructor. They must be registered on the CustomCounters profile
720
        // before any SpillFileWriter is created, otherwise the lookups return
721
        // nullptr and COUNTER_UPDATE will SEGV.
722
44
        _spill_write_file_total_size = ADD_COUNTER_WITH_LEVEL(
723
44
                Base::custom_profile(), profile::SPILL_WRITE_FILE_BYTES, TUnit::BYTES, 1);
724
44
        _spill_file_total_count = ADD_COUNTER_WITH_LEVEL(
725
44
                Base::custom_profile(), profile::SPILL_WRITE_FILE_TOTAL_COUNT, TUnit::UNIT, 1);
726
727
44
        _spill_max_rows_of_partition = ADD_COUNTER_WITH_LEVEL(
728
44
                Base::custom_profile(), profile::SPILL_MAX_ROWS_OF_PARTITION, TUnit::UNIT, 1);
729
44
        _spill_min_rows_of_partition = ADD_COUNTER_WITH_LEVEL(
730
44
                Base::custom_profile(), profile::SPILL_MIN_ROWS_OF_PARTITION, TUnit::UNIT, 1);
731
44
    }
_ZN5doris28PipelineXSpillSinkLocalStateINS_25PartitionedAggSharedStateEE19init_spill_countersEv
Line
Count
Source
712
20
    void init_spill_counters() {
713
20
        _spill_total_timer =
714
20
                ADD_TIMER_WITH_LEVEL(Base::custom_profile(), profile::SPILL_TOTAL_TIME, 1);
715
716
20
        _write_counters.init(Base::custom_profile());
717
718
        // SpillFileWriter looks up these counters via get_counter() in its
719
        // constructor. They must be registered on the CustomCounters profile
720
        // before any SpillFileWriter is created, otherwise the lookups return
721
        // nullptr and COUNTER_UPDATE will SEGV.
722
20
        _spill_write_file_total_size = ADD_COUNTER_WITH_LEVEL(
723
20
                Base::custom_profile(), profile::SPILL_WRITE_FILE_BYTES, TUnit::BYTES, 1);
724
20
        _spill_file_total_count = ADD_COUNTER_WITH_LEVEL(
725
20
                Base::custom_profile(), profile::SPILL_WRITE_FILE_TOTAL_COUNT, TUnit::UNIT, 1);
726
727
20
        _spill_max_rows_of_partition = ADD_COUNTER_WITH_LEVEL(
728
20
                Base::custom_profile(), profile::SPILL_MAX_ROWS_OF_PARTITION, TUnit::UNIT, 1);
729
20
        _spill_min_rows_of_partition = ADD_COUNTER_WITH_LEVEL(
730
20
                Base::custom_profile(), profile::SPILL_MIN_ROWS_OF_PARTITION, TUnit::UNIT, 1);
731
20
    }
_ZN5doris28PipelineXSpillSinkLocalStateINS_30PartitionedHashJoinSharedStateEE19init_spill_countersEv
Line
Count
Source
712
7
    void init_spill_counters() {
713
7
        _spill_total_timer =
714
7
                ADD_TIMER_WITH_LEVEL(Base::custom_profile(), profile::SPILL_TOTAL_TIME, 1);
715
716
7
        _write_counters.init(Base::custom_profile());
717
718
        // SpillFileWriter looks up these counters via get_counter() in its
719
        // constructor. They must be registered on the CustomCounters profile
720
        // before any SpillFileWriter is created, otherwise the lookups return
721
        // nullptr and COUNTER_UPDATE will SEGV.
722
7
        _spill_write_file_total_size = ADD_COUNTER_WITH_LEVEL(
723
7
                Base::custom_profile(), profile::SPILL_WRITE_FILE_BYTES, TUnit::BYTES, 1);
724
7
        _spill_file_total_count = ADD_COUNTER_WITH_LEVEL(
725
7
                Base::custom_profile(), profile::SPILL_WRITE_FILE_TOTAL_COUNT, TUnit::UNIT, 1);
726
727
7
        _spill_max_rows_of_partition = ADD_COUNTER_WITH_LEVEL(
728
7
                Base::custom_profile(), profile::SPILL_MAX_ROWS_OF_PARTITION, TUnit::UNIT, 1);
729
7
        _spill_min_rows_of_partition = ADD_COUNTER_WITH_LEVEL(
730
7
                Base::custom_profile(), profile::SPILL_MIN_ROWS_OF_PARTITION, TUnit::UNIT, 1);
731
7
    }
_ZN5doris28PipelineXSpillSinkLocalStateINS_20SpillSortSharedStateEE19init_spill_countersEv
Line
Count
Source
712
17
    void init_spill_counters() {
713
17
        _spill_total_timer =
714
17
                ADD_TIMER_WITH_LEVEL(Base::custom_profile(), profile::SPILL_TOTAL_TIME, 1);
715
716
17
        _write_counters.init(Base::custom_profile());
717
718
        // SpillFileWriter looks up these counters via get_counter() in its
719
        // constructor. They must be registered on the CustomCounters profile
720
        // before any SpillFileWriter is created, otherwise the lookups return
721
        // nullptr and COUNTER_UPDATE will SEGV.
722
17
        _spill_write_file_total_size = ADD_COUNTER_WITH_LEVEL(
723
17
                Base::custom_profile(), profile::SPILL_WRITE_FILE_BYTES, TUnit::BYTES, 1);
724
17
        _spill_file_total_count = ADD_COUNTER_WITH_LEVEL(
725
17
                Base::custom_profile(), profile::SPILL_WRITE_FILE_TOTAL_COUNT, TUnit::UNIT, 1);
726
727
17
        _spill_max_rows_of_partition = ADD_COUNTER_WITH_LEVEL(
728
17
                Base::custom_profile(), profile::SPILL_MAX_ROWS_OF_PARTITION, TUnit::UNIT, 1);
729
17
        _spill_min_rows_of_partition = ADD_COUNTER_WITH_LEVEL(
730
17
                Base::custom_profile(), profile::SPILL_MIN_ROWS_OF_PARTITION, TUnit::UNIT, 1);
731
17
    }
Unexecuted instantiation: _ZN5doris28PipelineXSpillSinkLocalStateINS_20MultiCastSharedStateEE19init_spill_countersEv
732
733
0
    std::vector<Dependency*> dependencies() const override {
734
0
        auto dependencies = Base::dependencies();
735
0
        return dependencies;
736
0
    }
Unexecuted instantiation: _ZNK5doris28PipelineXSpillSinkLocalStateINS_25PartitionedAggSharedStateEE12dependenciesEv
Unexecuted instantiation: _ZNK5doris28PipelineXSpillSinkLocalStateINS_30PartitionedHashJoinSharedStateEE12dependenciesEv
Unexecuted instantiation: _ZNK5doris28PipelineXSpillSinkLocalStateINS_20SpillSortSharedStateEE12dependenciesEv
Unexecuted instantiation: _ZNK5doris28PipelineXSpillSinkLocalStateINS_20MultiCastSharedStateEE12dependenciesEv
737
738
47
    void update_max_min_rows_counter() {
739
47
        int64_t max_rows = 0;
740
47
        int64_t min_rows = std::numeric_limits<int64_t>::max();
741
742
376
        for (auto rows : _rows_in_partitions) {
743
376
            if (rows > max_rows) {
744
11
                max_rows = rows;
745
11
            }
746
376
            if (rows < min_rows) {
747
49
                min_rows = rows;
748
49
            }
749
376
        }
750
751
47
        COUNTER_SET(_spill_max_rows_of_partition, max_rows);
752
47
        COUNTER_SET(_spill_min_rows_of_partition, min_rows);
753
47
    }
_ZN5doris28PipelineXSpillSinkLocalStateINS_25PartitionedAggSharedStateEE27update_max_min_rows_counterEv
Line
Count
Source
738
43
    void update_max_min_rows_counter() {
739
43
        int64_t max_rows = 0;
740
43
        int64_t min_rows = std::numeric_limits<int64_t>::max();
741
742
344
        for (auto rows : _rows_in_partitions) {
743
344
            if (rows > max_rows) {
744
7
                max_rows = rows;
745
7
            }
746
344
            if (rows < min_rows) {
747
43
                min_rows = rows;
748
43
            }
749
344
        }
750
751
43
        COUNTER_SET(_spill_max_rows_of_partition, max_rows);
752
43
        COUNTER_SET(_spill_min_rows_of_partition, min_rows);
753
43
    }
_ZN5doris28PipelineXSpillSinkLocalStateINS_30PartitionedHashJoinSharedStateEE27update_max_min_rows_counterEv
Line
Count
Source
738
4
    void update_max_min_rows_counter() {
739
4
        int64_t max_rows = 0;
740
4
        int64_t min_rows = std::numeric_limits<int64_t>::max();
741
742
32
        for (auto rows : _rows_in_partitions) {
743
32
            if (rows > max_rows) {
744
4
                max_rows = rows;
745
4
            }
746
32
            if (rows < min_rows) {
747
6
                min_rows = rows;
748
6
            }
749
32
        }
750
751
4
        COUNTER_SET(_spill_max_rows_of_partition, max_rows);
752
4
        COUNTER_SET(_spill_min_rows_of_partition, min_rows);
753
4
    }
754
755
    std::vector<int64_t> _rows_in_partitions;
756
757
    // Total time of spill, including spill task scheduling time,
758
    // serialize block time, write disk file time,
759
    // and read disk file time, deserialize block time etc.
760
    RuntimeProfile::Counter* _spill_total_timer = nullptr;
761
762
    // Shared spill write counters
763
    SpillWriteCounters _write_counters;
764
    // Backward-compatible aliases for commonly accessed write counters
765
    RuntimeProfile::Counter*& _spill_write_file_timer = _write_counters.spill_write_file_timer;
766
    RuntimeProfile::Counter*& _spill_write_serialize_block_timer =
767
            _write_counters.spill_write_serialize_block_timer;
768
    RuntimeProfile::Counter*& _spill_write_block_count = _write_counters.spill_write_block_count;
769
    RuntimeProfile::Counter*& _spill_write_block_data_size =
770
            _write_counters.spill_write_block_data_size;
771
    RuntimeProfile::Counter*& _spill_write_rows_count = _write_counters.spill_write_rows_count;
772
773
    // Sink-only counters
774
    // Spilled file total size
775
    RuntimeProfile::Counter* _spill_file_total_size = nullptr;
776
    // Total bytes written to spill files (required by SpillFileWriter)
777
    RuntimeProfile::Counter* _spill_write_file_total_size = nullptr;
778
    // Total number of spill files created (required by SpillFileWriter)
779
    RuntimeProfile::Counter* _spill_file_total_count = nullptr;
780
    RuntimeProfile::Counter* _spill_max_rows_of_partition = nullptr;
781
    RuntimeProfile::Counter* _spill_min_rows_of_partition = nullptr;
782
};
783
784
class OperatorXBase : public OperatorBase {
785
public:
786
    OperatorXBase(ObjectPool* pool, const TPlanNode& tnode, const int operator_id,
787
                  const DescriptorTbl& descs)
788
72.2k
            : OperatorBase(tnode.__isset.is_serial_operator && tnode.is_serial_operator),
789
72.2k
              _operator_id(operator_id),
790
72.2k
              _node_id(tnode.node_id),
791
72.2k
              _type(tnode.node_type),
792
72.2k
              _pool(pool),
793
72.2k
              _tuple_ids(tnode.row_tuples),
794
72.2k
              _row_descriptor(descs, tnode.row_tuples),
795
72.2k
              _resource_profile(tnode.resource_profile),
796
72.2k
              _limit(tnode.limit) {
797
72.2k
        if (tnode.__isset.output_tuple_id) {
798
72.1k
            _output_row_descriptor =
799
72.1k
                    std::make_unique<RowDescriptor>(descs, std::vector {tnode.output_tuple_id});
800
72.1k
        }
801
72.2k
        if (!tnode.intermediate_output_tuple_id_list.empty()) {
802
            // common subexpression elimination
803
0
            _intermediate_output_row_descriptor.reserve(
804
0
                    tnode.intermediate_output_tuple_id_list.size());
805
0
            for (auto output_tuple_id : tnode.intermediate_output_tuple_id_list) {
806
0
                _intermediate_output_row_descriptor.push_back(
807
0
                        RowDescriptor(descs, std::vector {output_tuple_id}));
808
0
            }
809
0
        }
810
72.2k
    }
811
812
    OperatorXBase(ObjectPool* pool, int node_id, int operator_id)
813
19
            : OperatorBase(),
814
19
              _operator_id(operator_id),
815
19
              _node_id(node_id),
816
19
              _pool(pool),
817
19
              _limit(-1) {}
818
819
#ifdef BE_TEST
820
144k
    OperatorXBase() : _operator_id(-1), _node_id(0), _limit(-1) {};
821
#endif
822
    virtual Status init(const TPlanNode& tnode, RuntimeState* state);
823
0
    Status init(const TDataSink& tsink) override {
824
0
        throw Exception(Status::FatalError("should not reach here!"));
825
0
    }
826
0
    virtual Status init(ExchangeType type) {
827
0
        throw Exception(Status::FatalError("should not reach here!"));
828
0
    }
829
0
    [[noreturn]] virtual const std::vector<TRuntimeFilterDesc>& runtime_filter_descs() {
830
0
        throw doris::Exception(ErrorCode::NOT_IMPLEMENTED_ERROR, _op_name);
831
0
    }
832
50.5k
    [[nodiscard]] std::string get_name() const override { return _op_name; }
833
1.45M
    [[nodiscard]] virtual bool need_more_input_data(RuntimeState* state) const { return true; }
834
0
    bool is_blockable(RuntimeState* state) const override {
835
0
        return state->get_sink_local_state()->is_blockable() || _blockable;
836
0
    }
837
838
    Status prepare(RuntimeState* state) override;
839
840
    Status terminate(RuntimeState* state) override;
841
    [[nodiscard]] virtual Status get_block(RuntimeState* state, Block* block, bool* eos) = 0;
842
843
    Status close(RuntimeState* state) override;
844
845
24.2k
    [[nodiscard]] virtual const RowDescriptor& intermediate_row_desc() const {
846
24.2k
        return _row_descriptor;
847
24.2k
    }
848
849
0
    [[nodiscard]] const RowDescriptor& intermediate_row_desc(int idx) {
850
0
        if (idx == 0) {
851
0
            return intermediate_row_desc();
852
0
        }
853
0
        DCHECK((idx - 1) < _intermediate_output_row_descriptor.size());
854
0
        return _intermediate_output_row_descriptor[idx - 1];
855
0
    }
856
857
48.2k
    [[nodiscard]] const RowDescriptor& projections_row_desc() const {
858
48.2k
        if (_intermediate_output_row_descriptor.empty()) {
859
48.2k
            return intermediate_row_desc();
860
48.2k
        } else {
861
0
            return _intermediate_output_row_descriptor.back();
862
0
        }
863
48.2k
    }
864
865
    // Returns the memory this single operator expects to allocate in the next
866
    // execution round.  Each operator reports only its OWN requirement — the
867
    // pipeline task is responsible for summing all operators + sink.
868
    // After the value is consumed the caller should invoke
869
    // reset_reserve_mem_size() so the next round starts from zero.
870
    // If this method is not overridden by a subclass, its default value is the
871
    // minimum operator memory (typically 1 MB).
872
0
    [[nodiscard]] virtual size_t get_reserve_mem_size(RuntimeState* state) {
873
0
        return state->minimum_operator_memory_required_bytes();
874
0
    }
875
876
    virtual std::string debug_string(int indentation_level = 0) const;
877
878
    virtual std::string debug_string(RuntimeState* state, int indentation_level = 0) const;
879
880
    virtual Status setup_local_state(RuntimeState* state, LocalStateInfo& info) = 0;
881
882
    template <class TARGET>
883
96.8k
    TARGET& cast() {
884
96.8k
        DCHECK(dynamic_cast<TARGET*>(this))
885
0
                << " Mismatch type! Current type is " << typeid(*this).name()
886
0
                << " and expect type is" << typeid(TARGET).name();
887
96.8k
        return reinterpret_cast<TARGET&>(*this);
888
96.8k
    }
_ZN5doris13OperatorXBase4castINS_22TableFunctionOperatorXEEERT_v
Line
Count
Source
883
195
    TARGET& cast() {
884
195
        DCHECK(dynamic_cast<TARGET*>(this))
885
0
                << " Mismatch type! Current type is " << typeid(*this).name()
886
0
                << " and expect type is" << typeid(TARGET).name();
887
195
        return reinterpret_cast<TARGET&>(*this);
888
195
    }
_ZN5doris13OperatorXBase4castINS_13DummyOperatorEEERT_v
Line
Count
Source
883
44
    TARGET& cast() {
884
44
        DCHECK(dynamic_cast<TARGET*>(this))
885
0
                << " Mismatch type! Current type is " << typeid(*this).name()
886
0
                << " and expect type is" << typeid(TARGET).name();
887
44
        return reinterpret_cast<TARGET&>(*this);
888
44
    }
_ZN5doris13OperatorXBase4castINS_23ExchangeSourceOperatorXEEERT_v
Line
Count
Source
883
23
    TARGET& cast() {
884
23
        DCHECK(dynamic_cast<TARGET*>(this))
885
0
                << " Mismatch type! Current type is " << typeid(*this).name()
886
0
                << " and expect type is" << typeid(TARGET).name();
887
23
        return reinterpret_cast<TARGET&>(*this);
888
23
    }
_ZN5doris13OperatorXBase4castINS_18AggSourceOperatorXEEERT_v
Line
Count
Source
883
53
    TARGET& cast() {
884
53
        DCHECK(dynamic_cast<TARGET*>(this))
885
0
                << " Mismatch type! Current type is " << typeid(*this).name()
886
0
                << " and expect type is" << typeid(TARGET).name();
887
53
        return reinterpret_cast<TARGET&>(*this);
888
53
    }
_ZN5doris13OperatorXBase4castINS_20CacheSourceOperatorXEEERT_v
Line
Count
Source
883
6
    TARGET& cast() {
884
6
        DCHECK(dynamic_cast<TARGET*>(this))
885
0
                << " Mismatch type! Current type is " << typeid(*this).name()
886
0
                << " and expect type is" << typeid(TARGET).name();
887
6
        return reinterpret_cast<TARGET&>(*this);
888
6
    }
_ZN5doris13OperatorXBase4castINS_22DataGenSourceOperatorXEEERT_v
Line
Count
Source
883
3
    TARGET& cast() {
884
3
        DCHECK(dynamic_cast<TARGET*>(this))
885
0
                << " Mismatch type! Current type is " << typeid(*this).name()
886
0
                << " and expect type is" << typeid(TARGET).name();
887
3
        return reinterpret_cast<TARGET&>(*this);
888
3
    }
_ZN5doris13OperatorXBase4castINS_29DistinctStreamingAggOperatorXEEERT_v
Line
Count
Source
883
30
    TARGET& cast() {
884
30
        DCHECK(dynamic_cast<TARGET*>(this))
885
0
                << " Mismatch type! Current type is " << typeid(*this).name()
886
0
                << " and expect type is" << typeid(TARGET).name();
887
30
        return reinterpret_cast<TARGET&>(*this);
888
30
    }
_ZN5doris13OperatorXBase4castINS_17FileScanOperatorXEEERT_v
Line
Count
Source
883
17
    TARGET& cast() {
884
17
        DCHECK(dynamic_cast<TARGET*>(this))
885
0
                << " Mismatch type! Current type is " << typeid(*this).name()
886
0
                << " and expect type is" << typeid(TARGET).name();
887
17
        return reinterpret_cast<TARGET&>(*this);
888
17
    }
_ZN5doris13OperatorXBase4castINS_22HashJoinProbeOperatorXEEERT_v
Line
Count
Source
883
96.1k
    TARGET& cast() {
884
96.1k
        DCHECK(dynamic_cast<TARGET*>(this))
885
0
                << " Mismatch type! Current type is " << typeid(*this).name()
886
0
                << " and expect type is" << typeid(TARGET).name();
887
96.1k
        return reinterpret_cast<TARGET&>(*this);
888
96.1k
    }
Unexecuted instantiation: _ZN5doris13OperatorXBase4castINS_28NestedLoopJoinProbeOperatorXEEERT_v
_ZN5doris13OperatorXBase4castINS_33PartitionedHashJoinProbeOperatorXEEERT_v
Line
Count
Source
883
21
    TARGET& cast() {
884
21
        DCHECK(dynamic_cast<TARGET*>(this))
885
0
                << " Mismatch type! Current type is " << typeid(*this).name()
886
0
                << " and expect type is" << typeid(TARGET).name();
887
21
        return reinterpret_cast<TARGET&>(*this);
888
21
    }
_ZN5doris13OperatorXBase4castINS_29LocalMergeSortSourceOperatorXEEERT_v
Line
Count
Source
883
4
    TARGET& cast() {
884
4
        DCHECK(dynamic_cast<TARGET*>(this))
885
0
                << " Mismatch type! Current type is " << typeid(*this).name()
886
0
                << " and expect type is" << typeid(TARGET).name();
887
4
        return reinterpret_cast<TARGET&>(*this);
888
4
    }
_ZN5doris13OperatorXBase4castINS_17OlapScanOperatorXEEERT_v
Line
Count
Source
883
33
    TARGET& cast() {
884
33
        DCHECK(dynamic_cast<TARGET*>(this))
885
0
                << " Mismatch type! Current type is " << typeid(*this).name()
886
0
                << " and expect type is" << typeid(TARGET).name();
887
33
        return reinterpret_cast<TARGET&>(*this);
888
33
    }
Unexecuted instantiation: _ZN5doris13OperatorXBase4castINS_20GroupCommitOperatorXEEERT_v
Unexecuted instantiation: _ZN5doris13OperatorXBase4castINS_17JDBCScanOperatorXEEERT_v
Unexecuted instantiation: _ZN5doris13OperatorXBase4castINS_15EsScanOperatorXEEERT_v
Unexecuted instantiation: _ZN5doris13OperatorXBase4castINS_36MultiCastDataStreamerSourceOperatorXEEERT_v
Unexecuted instantiation: _ZN5doris13OperatorXBase4castINS_17MetaScanOperatorXEEERT_v
_ZN5doris13OperatorXBase4castINS_29PartitionedAggSourceOperatorXEEERT_v
Line
Count
Source
883
15
    TARGET& cast() {
884
15
        DCHECK(dynamic_cast<TARGET*>(this))
885
0
                << " Mismatch type! Current type is " << typeid(*this).name()
886
0
                << " and expect type is" << typeid(TARGET).name();
887
15
        return reinterpret_cast<TARGET&>(*this);
888
15
    }
Unexecuted instantiation: _ZN5doris13OperatorXBase4castINS_21RecCTESourceOperatorXEEERT_v
_ZN5doris13OperatorXBase4castINS_15RepeatOperatorXEEERT_v
Line
Count
Source
883
13
    TARGET& cast() {
884
13
        DCHECK(dynamic_cast<TARGET*>(this))
885
0
                << " Mismatch type! Current type is " << typeid(*this).name()
886
0
                << " and expect type is" << typeid(TARGET).name();
887
13
        return reinterpret_cast<TARGET&>(*this);
888
13
    }
_ZN5doris13OperatorXBase4castINS_17MockScanOperatorXEEERT_v
Line
Count
Source
883
101
    TARGET& cast() {
884
101
        DCHECK(dynamic_cast<TARGET*>(this))
885
0
                << " Mismatch type! Current type is " << typeid(*this).name()
886
0
                << " and expect type is" << typeid(TARGET).name();
887
101
        return reinterpret_cast<TARGET&>(*this);
888
101
    }
Unexecuted instantiation: _ZN5doris13OperatorXBase4castINS_19SchemaScanOperatorXEEERT_v
_ZN5doris13OperatorXBase4castINS_18SetSourceOperatorXILb1EEEEERT_v
Line
Count
Source
883
14
    TARGET& cast() {
884
14
        DCHECK(dynamic_cast<TARGET*>(this))
885
0
                << " Mismatch type! Current type is " << typeid(*this).name()
886
0
                << " and expect type is" << typeid(TARGET).name();
887
14
        return reinterpret_cast<TARGET&>(*this);
888
14
    }
_ZN5doris13OperatorXBase4castINS_18SetSourceOperatorXILb0EEEEERT_v
Line
Count
Source
883
10
    TARGET& cast() {
884
10
        DCHECK(dynamic_cast<TARGET*>(this))
885
0
                << " Mismatch type! Current type is " << typeid(*this).name()
886
0
                << " and expect type is" << typeid(TARGET).name();
887
10
        return reinterpret_cast<TARGET&>(*this);
888
10
    }
_ZN5doris13OperatorXBase4castINS_24SpillSortSourceOperatorXEEERT_v
Line
Count
Source
883
20
    TARGET& cast() {
884
20
        DCHECK(dynamic_cast<TARGET*>(this))
885
0
                << " Mismatch type! Current type is " << typeid(*this).name()
886
0
                << " and expect type is" << typeid(TARGET).name();
887
20
        return reinterpret_cast<TARGET&>(*this);
888
20
    }
_ZN5doris13OperatorXBase4castINS_21StreamingAggOperatorXEEERT_v
Line
Count
Source
883
64
    TARGET& cast() {
884
64
        DCHECK(dynamic_cast<TARGET*>(this))
885
0
                << " Mismatch type! Current type is " << typeid(*this).name()
886
0
                << " and expect type is" << typeid(TARGET).name();
887
64
        return reinterpret_cast<TARGET&>(*this);
888
64
    }
_ZN5doris13OperatorXBase4castINS_20UnionSourceOperatorXEEERT_v
Line
Count
Source
883
6
    TARGET& cast() {
884
6
        DCHECK(dynamic_cast<TARGET*>(this))
885
0
                << " Mismatch type! Current type is " << typeid(*this).name()
886
0
                << " and expect type is" << typeid(TARGET).name();
887
6
        return reinterpret_cast<TARGET&>(*this);
888
6
    }
889
    template <class TARGET>
890
    const TARGET& cast() const {
891
        DCHECK(dynamic_cast<const TARGET*>(this))
892
                << " Mismatch type! Current type is " << typeid(*this).name()
893
                << " and expect type is" << typeid(TARGET).name();
894
        return reinterpret_cast<const TARGET&>(*this);
895
    }
896
897
53
    [[nodiscard]] OperatorPtr get_child() { return _child; }
898
899
0
    [[nodiscard]] VExprContextSPtrs& conjuncts() { return _conjuncts; }
900
0
    [[nodiscard]] VExprContextSPtrs& projections() { return _projections; }
901
15
    [[nodiscard]] virtual RowDescriptor& row_descriptor() { return _row_descriptor; }
902
903
4.49M
    [[nodiscard]] int operator_id() const { return _operator_id; }
904
89.4k
    [[nodiscard]] int node_id() const override { return _node_id; }
905
48.3k
    [[nodiscard]] int nereids_id() const { return _nereids_id; }
906
907
0
    [[nodiscard]] int64_t limit() const { return _limit; }
908
909
1.83M
    [[nodiscard]] const RowDescriptor& row_desc() const override {
910
1.83M
        return _output_row_descriptor ? *_output_row_descriptor : _row_descriptor;
911
1.83M
    }
912
913
17
    [[nodiscard]] const RowDescriptor* output_row_descriptor() {
914
17
        return _output_row_descriptor.get();
915
17
    }
916
917
48.2k
    bool has_output_row_desc() const { return _output_row_descriptor != nullptr; }
918
919
    [[nodiscard]] virtual Status get_block_after_projects(RuntimeState* state, Block* block,
920
                                                          bool* eos);
921
922
    /// Only use in vectorized exec engine try to do projections to trans _row_desc -> _output_row_desc
923
    Status do_projections(RuntimeState* state, Block* origin_block, Block* output_block) const;
924
144k
    void set_parallel_tasks(int parallel_tasks) { _parallel_tasks = parallel_tasks; }
925
0
    int parallel_tasks() const { return _parallel_tasks; }
926
927
    // To keep compatibility with older FE
928
1
    void set_serial_operator() { _is_serial_operator = true; }
929
930
    // Resets this operator's estimated memory usage to zero so that the next
931
    // call to get_reserve_mem_size() starts fresh.  The pipeline task calls
932
    // this after consuming the reserve size for all operators in a round.
933
0
    virtual void reset_reserve_mem_size(RuntimeState* state) {}
934
935
protected:
936
    template <typename Dependency>
937
    friend class PipelineXLocalState;
938
    friend class PipelineXLocalStateBase;
939
    friend class Scanner;
940
    const int _operator_id;
941
    const int _node_id; // unique w/in single plan tree
942
    int _nereids_id = -1;
943
    TPlanNodeType::type _type;
944
    ObjectPool* _pool = nullptr;
945
    std::vector<TupleId> _tuple_ids;
946
947
private:
948
    // The expr of operator set to private permissions, as cannot be executed concurrently,
949
    // should use local state's expr.
950
    VExprContextSPtrs _conjuncts;
951
    VExprContextSPtrs _projections;
952
    // Used in common subexpression elimination to compute intermediate results.
953
    std::vector<VExprContextSPtrs> _intermediate_projections;
954
955
protected:
956
    RowDescriptor _row_descriptor;
957
    std::unique_ptr<RowDescriptor> _output_row_descriptor = nullptr;
958
    std::vector<RowDescriptor> _intermediate_output_row_descriptor;
959
960
    /// Resource information sent from the frontend.
961
    const TBackendResourceProfile _resource_profile;
962
963
    int64_t _limit; // -1: no limit
964
965
    uint32_t _debug_point_count = 0;
966
    std::atomic_uint32_t _bytes_per_row = 0;
967
968
    std::string _op_name;
969
    int _parallel_tasks = 0;
970
971
    //_keep_origin is used to avoid copying during projection,
972
    // currently set to false only in the nestloop join.
973
    bool _keep_origin = true;
974
975
    // _blockable is true if the operator contains expressions that may block execution
976
    bool _blockable = false;
977
};
978
979
template <typename LocalStateType>
980
class OperatorX : public OperatorXBase {
981
public:
982
    OperatorX(ObjectPool* pool, const TPlanNode& tnode, const int operator_id,
983
              const DescriptorTbl& descs)
984
72.2k
            : OperatorXBase(pool, tnode, operator_id, descs) {}
Unexecuted instantiation: _ZN5doris9OperatorXINS_23DummyOperatorLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
_ZN5doris9OperatorXINS_14MockLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
984
3
            : OperatorXBase(pool, tnode, operator_id, descs) {}
_ZN5doris9OperatorXINS_13AggLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
984
30
            : OperatorXBase(pool, tnode, operator_id, descs) {}
Unexecuted instantiation: _ZN5doris9OperatorXINS_18AnalyticLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Unexecuted instantiation: _ZN5doris9OperatorXINS_23AssertNumRowsLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Unexecuted instantiation: _ZN5doris9OperatorXINS_17DataGenLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Unexecuted instantiation: _ZN5doris9OperatorXINS_30DistinctStreamingAggLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
_ZN5doris9OperatorXINS_18ExchangeLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
984
4
            : OperatorXBase(pool, tnode, operator_id, descs) {}
_ZN5doris9OperatorXINS_23HashJoinProbeLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
984
72.0k
            : OperatorXBase(pool, tnode, operator_id, descs) {}
Unexecuted instantiation: _ZN5doris9OperatorXINS_29NestedLoopJoinProbeLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
_ZN5doris9OperatorXINS_34PartitionedHashJoinProbeLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
984
48
            : OperatorXBase(pool, tnode, operator_id, descs) {}
Unexecuted instantiation: _ZN5doris9OperatorXINS_24LocalMergeSortLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
_ZN5doris9OperatorXINS_18OlapScanLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
984
17
            : OperatorXBase(pool, tnode, operator_id, descs) {}
Unexecuted instantiation: _ZN5doris9OperatorXINS_21GroupCommitLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Unexecuted instantiation: _ZN5doris9OperatorXINS_18JDBCScanLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
_ZN5doris9OperatorXINS_18FileScanLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
984
3
            : OperatorXBase(pool, tnode, operator_id, descs) {}
Unexecuted instantiation: _ZN5doris9OperatorXINS_16EsScanLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
_ZN5doris9OperatorXINS_14SortLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
984
20
            : OperatorXBase(pool, tnode, operator_id, descs) {}
_ZN5doris9OperatorXINS_19SpillSortLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
984
19
            : OperatorXBase(pool, tnode, operator_id, descs) {}
_ZN5doris9OperatorXINS_24PartitionedAggLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
984
30
            : OperatorXBase(pool, tnode, operator_id, descs) {}
_ZN5doris9OperatorXINS_23TableFunctionLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
984
5
            : OperatorXBase(pool, tnode, operator_id, descs) {}
Unexecuted instantiation: _ZN5doris9OperatorXINS_16RepeatLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Unexecuted instantiation: _ZN5doris9OperatorXINS_18EmptySetLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Unexecuted instantiation: _ZN5doris9OperatorXINS_21UnionSourceLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Unexecuted instantiation: _ZN5doris9OperatorXINS_35MultiCastDataStreamSourceLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Unexecuted instantiation: _ZN5doris9OperatorXINS_29PartitionSortSourceLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Unexecuted instantiation: _ZN5doris9OperatorXINS_19SetSourceLocalStateILb1EEEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Unexecuted instantiation: _ZN5doris9OperatorXINS_19SetSourceLocalStateILb0EEEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Unexecuted instantiation: _ZN5doris9OperatorXINS_20SchemaScanLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Unexecuted instantiation: _ZN5doris9OperatorXINS_18MetaScanLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Unexecuted instantiation: _ZN5doris9OperatorXINS_29LocalExchangeSourceLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Unexecuted instantiation: _ZN5doris9OperatorXINS_21CacheSourceLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Unexecuted instantiation: _ZN5doris9OperatorXINS_22RecCTESourceLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Unexecuted instantiation: _ZN5doris9OperatorXINS_20RecCTEScanLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Unexecuted instantiation: _ZN5doris9OperatorXINS_18MockScanLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Unexecuted instantiation: _ZN5doris9OperatorXINS_16SelectLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Unexecuted instantiation: _ZN5doris9OperatorXINS_25MaterializationLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Unexecuted instantiation: _ZN5doris9OperatorXINS_22StreamingAggLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
985
    OperatorX(ObjectPool* pool, int node_id, int operator_id)
986
19
            : OperatorXBase(pool, node_id, operator_id) {};
_ZN5doris9OperatorXINS_23DummyOperatorLocalStateEEC2EPNS_10ObjectPoolEii
Line
Count
Source
986
19
            : OperatorXBase(pool, node_id, operator_id) {};
Unexecuted instantiation: _ZN5doris9OperatorXINS_23HashJoinProbeLocalStateEEC2EPNS_10ObjectPoolEii
Unexecuted instantiation: _ZN5doris9OperatorXINS_18OlapScanLocalStateEEC2EPNS_10ObjectPoolEii
Unexecuted instantiation: _ZN5doris9OperatorXINS_21GroupCommitLocalStateEEC2EPNS_10ObjectPoolEii
Unexecuted instantiation: _ZN5doris9OperatorXINS_18JDBCScanLocalStateEEC2EPNS_10ObjectPoolEii
Unexecuted instantiation: _ZN5doris9OperatorXINS_18FileScanLocalStateEEC2EPNS_10ObjectPoolEii
Unexecuted instantiation: _ZN5doris9OperatorXINS_16EsScanLocalStateEEC2EPNS_10ObjectPoolEii
Unexecuted instantiation: _ZN5doris9OperatorXINS_18AnalyticLocalStateEEC2EPNS_10ObjectPoolEii
Unexecuted instantiation: _ZN5doris9OperatorXINS_14SortLocalStateEEC2EPNS_10ObjectPoolEii
Unexecuted instantiation: _ZN5doris9OperatorXINS_19SpillSortLocalStateEEC2EPNS_10ObjectPoolEii
Unexecuted instantiation: _ZN5doris9OperatorXINS_24LocalMergeSortLocalStateEEC2EPNS_10ObjectPoolEii
Unexecuted instantiation: _ZN5doris9OperatorXINS_13AggLocalStateEEC2EPNS_10ObjectPoolEii
Unexecuted instantiation: _ZN5doris9OperatorXINS_24PartitionedAggLocalStateEEC2EPNS_10ObjectPoolEii
Unexecuted instantiation: _ZN5doris9OperatorXINS_23TableFunctionLocalStateEEC2EPNS_10ObjectPoolEii
Unexecuted instantiation: _ZN5doris9OperatorXINS_18ExchangeLocalStateEEC2EPNS_10ObjectPoolEii
Unexecuted instantiation: _ZN5doris9OperatorXINS_16RepeatLocalStateEEC2EPNS_10ObjectPoolEii
Unexecuted instantiation: _ZN5doris9OperatorXINS_29NestedLoopJoinProbeLocalStateEEC2EPNS_10ObjectPoolEii
Unexecuted instantiation: _ZN5doris9OperatorXINS_23AssertNumRowsLocalStateEEC2EPNS_10ObjectPoolEii
Unexecuted instantiation: _ZN5doris9OperatorXINS_18EmptySetLocalStateEEC2EPNS_10ObjectPoolEii
Unexecuted instantiation: _ZN5doris9OperatorXINS_21UnionSourceLocalStateEEC2EPNS_10ObjectPoolEii
Unexecuted instantiation: _ZN5doris9OperatorXINS_35MultiCastDataStreamSourceLocalStateEEC2EPNS_10ObjectPoolEii
Unexecuted instantiation: _ZN5doris9OperatorXINS_29PartitionSortSourceLocalStateEEC2EPNS_10ObjectPoolEii
Unexecuted instantiation: _ZN5doris9OperatorXINS_19SetSourceLocalStateILb1EEEEC2EPNS_10ObjectPoolEii
Unexecuted instantiation: _ZN5doris9OperatorXINS_19SetSourceLocalStateILb0EEEEC2EPNS_10ObjectPoolEii
Unexecuted instantiation: _ZN5doris9OperatorXINS_17DataGenLocalStateEEC2EPNS_10ObjectPoolEii
Unexecuted instantiation: _ZN5doris9OperatorXINS_20SchemaScanLocalStateEEC2EPNS_10ObjectPoolEii
Unexecuted instantiation: _ZN5doris9OperatorXINS_18MetaScanLocalStateEEC2EPNS_10ObjectPoolEii
Unexecuted instantiation: _ZN5doris9OperatorXINS_29LocalExchangeSourceLocalStateEEC2EPNS_10ObjectPoolEii
Unexecuted instantiation: _ZN5doris9OperatorXINS_34PartitionedHashJoinProbeLocalStateEEC2EPNS_10ObjectPoolEii
Unexecuted instantiation: _ZN5doris9OperatorXINS_21CacheSourceLocalStateEEC2EPNS_10ObjectPoolEii
Unexecuted instantiation: _ZN5doris9OperatorXINS_22RecCTESourceLocalStateEEC2EPNS_10ObjectPoolEii
Unexecuted instantiation: _ZN5doris9OperatorXINS_20RecCTEScanLocalStateEEC2EPNS_10ObjectPoolEii
Unexecuted instantiation: _ZN5doris9OperatorXINS_14MockLocalStateEEC2EPNS_10ObjectPoolEii
Unexecuted instantiation: _ZN5doris9OperatorXINS_18MockScanLocalStateEEC2EPNS_10ObjectPoolEii
987
988
#ifdef BE_TEST
989
232
    OperatorX() = default;
_ZN5doris9OperatorXINS_13AggLocalStateEEC2Ev
Line
Count
Source
989
27
    OperatorX() = default;
_ZN5doris9OperatorXINS_18AnalyticLocalStateEEC2Ev
Line
Count
Source
989
9
    OperatorX() = default;
_ZN5doris9OperatorXINS_23AssertNumRowsLocalStateEEC2Ev
Line
Count
Source
989
3
    OperatorX() = default;
_ZN5doris9OperatorXINS_14MockLocalStateEEC2Ev
Line
Count
Source
989
16
    OperatorX() = default;
_ZN5doris9OperatorXINS_17DataGenLocalStateEEC2Ev
Line
Count
Source
989
3
    OperatorX() = default;
_ZN5doris9OperatorXINS_30DistinctStreamingAggLocalStateEEC2Ev
Line
Count
Source
989
3
    OperatorX() = default;
_ZN5doris9OperatorXINS_18EmptySetLocalStateEEC2Ev
Line
Count
Source
989
1
    OperatorX() = default;
_ZN5doris9OperatorXINS_18ExchangeLocalStateEEC2Ev
Line
Count
Source
989
2
    OperatorX() = default;
_ZN5doris9OperatorXINS_24LocalMergeSortLocalStateEEC2Ev
Line
Count
Source
989
1
    OperatorX() = default;
_ZN5doris9OperatorXINS_29PartitionSortSourceLocalStateEEC2Ev
Line
Count
Source
989
102
    OperatorX() = default;
_ZN5doris9OperatorXINS_21CacheSourceLocalStateEEC2Ev
Line
Count
Source
989
3
    OperatorX() = default;
_ZN5doris9OperatorXINS_16RepeatLocalStateEEC2Ev
Line
Count
Source
989
3
    OperatorX() = default;
_ZN5doris9OperatorXINS_18MockScanLocalStateEEC2Ev
Line
Count
Source
989
21
    OperatorX() = default;
_ZN5doris9OperatorXINS_19SetSourceLocalStateILb1EEEEC2Ev
Line
Count
Source
989
7
    OperatorX() = default;
_ZN5doris9OperatorXINS_19SetSourceLocalStateILb0EEEEC2Ev
Line
Count
Source
989
5
    OperatorX() = default;
_ZN5doris9OperatorXINS_14SortLocalStateEEC2Ev
Line
Count
Source
989
9
    OperatorX() = default;
_ZN5doris9OperatorXINS_22StreamingAggLocalStateEEC2Ev
Line
Count
Source
989
4
    OperatorX() = default;
_ZN5doris9OperatorXINS_23TableFunctionLocalStateEEC2Ev
Line
Count
Source
989
11
    OperatorX() = default;
_ZN5doris9OperatorXINS_21UnionSourceLocalStateEEC2Ev
Line
Count
Source
989
2
    OperatorX() = default;
990
#endif
991
992
72.5k
    ~OperatorX() override = default;
_ZN5doris9OperatorXINS_13AggLocalStateEED2Ev
Line
Count
Source
992
57
    ~OperatorX() override = default;
_ZN5doris9OperatorXINS_18AnalyticLocalStateEED2Ev
Line
Count
Source
992
9
    ~OperatorX() override = default;
_ZN5doris9OperatorXINS_23AssertNumRowsLocalStateEED2Ev
Line
Count
Source
992
3
    ~OperatorX() override = default;
_ZN5doris9OperatorXINS_14MockLocalStateEED2Ev
Line
Count
Source
992
19
    ~OperatorX() override = default;
_ZN5doris9OperatorXINS_17DataGenLocalStateEED2Ev
Line
Count
Source
992
3
    ~OperatorX() override = default;
_ZN5doris9OperatorXINS_30DistinctStreamingAggLocalStateEED2Ev
Line
Count
Source
992
3
    ~OperatorX() override = default;
_ZN5doris9OperatorXINS_18EmptySetLocalStateEED2Ev
Line
Count
Source
992
1
    ~OperatorX() override = default;
_ZN5doris9OperatorXINS_18ExchangeLocalStateEED2Ev
Line
Count
Source
992
6
    ~OperatorX() override = default;
_ZN5doris9OperatorXINS_24LocalMergeSortLocalStateEED2Ev
Line
Count
Source
992
1
    ~OperatorX() override = default;
_ZN5doris9OperatorXINS_29PartitionSortSourceLocalStateEED2Ev
Line
Count
Source
992
102
    ~OperatorX() override = default;
_ZN5doris9OperatorXINS_23HashJoinProbeLocalStateEED2Ev
Line
Count
Source
992
72.0k
    ~OperatorX() override = default;
_ZN5doris9OperatorXINS_34PartitionedHashJoinProbeLocalStateEED2Ev
Line
Count
Source
992
48
    ~OperatorX() override = default;
_ZN5doris9OperatorXINS_21CacheSourceLocalStateEED2Ev
Line
Count
Source
992
3
    ~OperatorX() override = default;
_ZN5doris9OperatorXINS_16RepeatLocalStateEED2Ev
Line
Count
Source
992
3
    ~OperatorX() override = default;
_ZN5doris9OperatorXINS_18MockScanLocalStateEED2Ev
Line
Count
Source
992
21
    ~OperatorX() override = default;
_ZN5doris9OperatorXINS_19SetSourceLocalStateILb1EEEED2Ev
Line
Count
Source
992
7
    ~OperatorX() override = default;
_ZN5doris9OperatorXINS_19SetSourceLocalStateILb0EEEED2Ev
Line
Count
Source
992
5
    ~OperatorX() override = default;
_ZN5doris9OperatorXINS_14SortLocalStateEED2Ev
Line
Count
Source
992
29
    ~OperatorX() override = default;
_ZN5doris9OperatorXINS_22StreamingAggLocalStateEED2Ev
Line
Count
Source
992
4
    ~OperatorX() override = default;
_ZN5doris9OperatorXINS_23TableFunctionLocalStateEED2Ev
Line
Count
Source
992
16
    ~OperatorX() override = default;
_ZN5doris9OperatorXINS_21UnionSourceLocalStateEED2Ev
Line
Count
Source
992
2
    ~OperatorX() override = default;
_ZN5doris9OperatorXINS_23DummyOperatorLocalStateEED2Ev
Line
Count
Source
992
19
    ~OperatorX() override = default;
_ZN5doris9OperatorXINS_18OlapScanLocalStateEED2Ev
Line
Count
Source
992
17
    ~OperatorX() override = default;
_ZN5doris9OperatorXINS_18FileScanLocalStateEED2Ev
Line
Count
Source
992
3
    ~OperatorX() override = default;
Unexecuted instantiation: _ZN5doris9OperatorXINS_29LocalExchangeSourceLocalStateEED2Ev
Unexecuted instantiation: _ZN5doris9OperatorXINS_29NestedLoopJoinProbeLocalStateEED2Ev
Unexecuted instantiation: _ZN5doris9OperatorXINS_25MaterializationLocalStateEED2Ev
Unexecuted instantiation: _ZN5doris9OperatorXINS_35MultiCastDataStreamSourceLocalStateEED2Ev
Unexecuted instantiation: _ZN5doris9OperatorXINS_20RecCTEScanLocalStateEED2Ev
Unexecuted instantiation: _ZN5doris9OperatorXINS_22RecCTESourceLocalStateEED2Ev
Unexecuted instantiation: _ZN5doris9OperatorXINS_16SelectLocalStateEED2Ev
Unexecuted instantiation: _ZN5doris9OperatorXINS_21GroupCommitLocalStateEED2Ev
Unexecuted instantiation: _ZN5doris9OperatorXINS_18JDBCScanLocalStateEED2Ev
Unexecuted instantiation: _ZN5doris9OperatorXINS_16EsScanLocalStateEED2Ev
_ZN5doris9OperatorXINS_19SpillSortLocalStateEED2Ev
Line
Count
Source
992
19
    ~OperatorX() override = default;
_ZN5doris9OperatorXINS_24PartitionedAggLocalStateEED2Ev
Line
Count
Source
992
30
    ~OperatorX() override = default;
Unexecuted instantiation: _ZN5doris9OperatorXINS_20SchemaScanLocalStateEED2Ev
Unexecuted instantiation: _ZN5doris9OperatorXINS_18MetaScanLocalStateEED2Ev
993
994
    Status setup_local_state(RuntimeState* state, LocalStateInfo& info) override;
995
    using LocalState = LocalStateType;
996
2.90M
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
997
2.90M
        return state->get_local_state(operator_id())->template cast<LocalState>();
998
2.90M
    }
_ZNK5doris9OperatorXINS_23DummyOperatorLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
996
2.90M
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
997
2.90M
        return state->get_local_state(operator_id())->template cast<LocalState>();
998
2.90M
    }
_ZNK5doris9OperatorXINS_13AggLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
996
130
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
997
130
        return state->get_local_state(operator_id())->template cast<LocalState>();
998
130
    }
_ZNK5doris9OperatorXINS_18AnalyticLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
996
46
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
997
46
        return state->get_local_state(operator_id())->template cast<LocalState>();
998
46
    }
_ZNK5doris9OperatorXINS_23AssertNumRowsLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
996
4
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
997
4
        return state->get_local_state(operator_id())->template cast<LocalState>();
998
4
    }
Unexecuted instantiation: _ZNK5doris9OperatorXINS_14MockLocalStateEE15get_local_stateEPNS_12RuntimeStateE
_ZNK5doris9OperatorXINS_17DataGenLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
996
3
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
997
3
        return state->get_local_state(operator_id())->template cast<LocalState>();
998
3
    }
_ZNK5doris9OperatorXINS_30DistinctStreamingAggLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
996
24
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
997
24
        return state->get_local_state(operator_id())->template cast<LocalState>();
998
24
    }
Unexecuted instantiation: _ZNK5doris9OperatorXINS_18EmptySetLocalStateEE15get_local_stateEPNS_12RuntimeStateE
_ZNK5doris9OperatorXINS_18ExchangeLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
996
39
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
997
39
        return state->get_local_state(operator_id())->template cast<LocalState>();
998
39
    }
_ZNK5doris9OperatorXINS_23HashJoinProbeLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
996
178
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
997
178
        return state->get_local_state(operator_id())->template cast<LocalState>();
998
178
    }
_ZNK5doris9OperatorXINS_24LocalMergeSortLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
996
6
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
997
6
        return state->get_local_state(operator_id())->template cast<LocalState>();
998
6
    }
Unexecuted instantiation: _ZNK5doris9OperatorXINS_25MaterializationLocalStateEE15get_local_stateEPNS_12RuntimeStateE
_ZNK5doris9OperatorXINS_29PartitionSortSourceLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
996
402
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
997
402
        return state->get_local_state(operator_id())->template cast<LocalState>();
998
402
    }
_ZNK5doris9OperatorXINS_24PartitionedAggLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
996
84
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
997
84
        return state->get_local_state(operator_id())->template cast<LocalState>();
998
84
    }
_ZNK5doris9OperatorXINS_34PartitionedHashJoinProbeLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
996
59
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
997
59
        return state->get_local_state(operator_id())->template cast<LocalState>();
998
59
    }
_ZNK5doris9OperatorXINS_21CacheSourceLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
996
6
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
997
6
        return state->get_local_state(operator_id())->template cast<LocalState>();
998
6
    }
_ZNK5doris9OperatorXINS_16RepeatLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
996
9
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
997
9
        return state->get_local_state(operator_id())->template cast<LocalState>();
998
9
    }
Unexecuted instantiation: _ZNK5doris9OperatorXINS_18MockScanLocalStateEE15get_local_stateEPNS_12RuntimeStateE
_ZNK5doris9OperatorXINS_19SetSourceLocalStateILb1EEEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
996
7
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
997
7
        return state->get_local_state(operator_id())->template cast<LocalState>();
998
7
    }
_ZNK5doris9OperatorXINS_19SetSourceLocalStateILb0EEEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
996
845
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
997
845
        return state->get_local_state(operator_id())->template cast<LocalState>();
998
845
    }
_ZNK5doris9OperatorXINS_14SortLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
996
38
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
997
38
        return state->get_local_state(operator_id())->template cast<LocalState>();
998
38
    }
_ZNK5doris9OperatorXINS_19SpillSortLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
996
48
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
997
48
        return state->get_local_state(operator_id())->template cast<LocalState>();
998
48
    }
_ZNK5doris9OperatorXINS_22StreamingAggLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
996
21
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
997
21
        return state->get_local_state(operator_id())->template cast<LocalState>();
998
21
    }
_ZNK5doris9OperatorXINS_23TableFunctionLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
996
38
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
997
38
        return state->get_local_state(operator_id())->template cast<LocalState>();
998
38
    }
_ZNK5doris9OperatorXINS_21UnionSourceLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
996
37
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
997
37
        return state->get_local_state(operator_id())->template cast<LocalState>();
998
37
    }
Unexecuted instantiation: _ZNK5doris9OperatorXINS_29LocalExchangeSourceLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZNK5doris9OperatorXINS_18OlapScanLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZNK5doris9OperatorXINS_18FileScanLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZNK5doris9OperatorXINS_29NestedLoopJoinProbeLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZNK5doris9OperatorXINS_35MultiCastDataStreamSourceLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZNK5doris9OperatorXINS_21GroupCommitLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZNK5doris9OperatorXINS_18JDBCScanLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZNK5doris9OperatorXINS_16EsScanLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZNK5doris9OperatorXINS_20SchemaScanLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZNK5doris9OperatorXINS_18MetaScanLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZNK5doris9OperatorXINS_22RecCTESourceLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZNK5doris9OperatorXINS_20RecCTEScanLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZNK5doris9OperatorXINS_16SelectLocalStateEE15get_local_stateEPNS_12RuntimeStateE
999
1000
    // Returns memory this single operator expects to allocate in the next round.
1001
    // Does NOT include child operators — the pipeline task iterates all
1002
    // operators itself.
1003
1.45M
    size_t get_reserve_mem_size(RuntimeState* state) override {
1004
1.45M
        auto& local_state = get_local_state(state);
1005
1.45M
        auto estimated_size = local_state.estimate_memory_usage();
1006
1.45M
        if (estimated_size < state->minimum_operator_memory_required_bytes()) {
1007
1.45M
            estimated_size = state->minimum_operator_memory_required_bytes();
1008
1.45M
        }
1009
1.45M
        return estimated_size;
1010
1.45M
    }
_ZN5doris9OperatorXINS_23DummyOperatorLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1003
1.45M
    size_t get_reserve_mem_size(RuntimeState* state) override {
1004
1.45M
        auto& local_state = get_local_state(state);
1005
1.45M
        auto estimated_size = local_state.estimate_memory_usage();
1006
1.45M
        if (estimated_size < state->minimum_operator_memory_required_bytes()) {
1007
1.45M
            estimated_size = state->minimum_operator_memory_required_bytes();
1008
1.45M
        }
1009
1.45M
        return estimated_size;
1010
1.45M
    }
Unexecuted instantiation: _ZN5doris9OperatorXINS_13AggLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris9OperatorXINS_18AnalyticLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris9OperatorXINS_23AssertNumRowsLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris9OperatorXINS_14MockLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris9OperatorXINS_17DataGenLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris9OperatorXINS_30DistinctStreamingAggLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris9OperatorXINS_18EmptySetLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
_ZN5doris9OperatorXINS_18ExchangeLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1003
11
    size_t get_reserve_mem_size(RuntimeState* state) override {
1004
11
        auto& local_state = get_local_state(state);
1005
11
        auto estimated_size = local_state.estimate_memory_usage();
1006
11
        if (estimated_size < state->minimum_operator_memory_required_bytes()) {
1007
11
            estimated_size = state->minimum_operator_memory_required_bytes();
1008
11
        }
1009
11
        return estimated_size;
1010
11
    }
_ZN5doris9OperatorXINS_23HashJoinProbeLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1003
4
    size_t get_reserve_mem_size(RuntimeState* state) override {
1004
4
        auto& local_state = get_local_state(state);
1005
4
        auto estimated_size = local_state.estimate_memory_usage();
1006
4
        if (estimated_size < state->minimum_operator_memory_required_bytes()) {
1007
4
            estimated_size = state->minimum_operator_memory_required_bytes();
1008
4
        }
1009
4
        return estimated_size;
1010
4
    }
Unexecuted instantiation: _ZN5doris9OperatorXINS_24LocalMergeSortLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris9OperatorXINS_25MaterializationLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris9OperatorXINS_29PartitionSortSourceLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris9OperatorXINS_24PartitionedAggLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
_ZN5doris9OperatorXINS_34PartitionedHashJoinProbeLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1003
1
    size_t get_reserve_mem_size(RuntimeState* state) override {
1004
1
        auto& local_state = get_local_state(state);
1005
1
        auto estimated_size = local_state.estimate_memory_usage();
1006
1
        if (estimated_size < state->minimum_operator_memory_required_bytes()) {
1007
1
            estimated_size = state->minimum_operator_memory_required_bytes();
1008
1
        }
1009
1
        return estimated_size;
1010
1
    }
Unexecuted instantiation: _ZN5doris9OperatorXINS_21CacheSourceLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris9OperatorXINS_16RepeatLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris9OperatorXINS_18MockScanLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris9OperatorXINS_19SetSourceLocalStateILb1EEEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris9OperatorXINS_19SetSourceLocalStateILb0EEEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris9OperatorXINS_14SortLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris9OperatorXINS_19SpillSortLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris9OperatorXINS_22StreamingAggLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris9OperatorXINS_23TableFunctionLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris9OperatorXINS_21UnionSourceLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris9OperatorXINS_29LocalExchangeSourceLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris9OperatorXINS_18OlapScanLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris9OperatorXINS_18FileScanLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris9OperatorXINS_29NestedLoopJoinProbeLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris9OperatorXINS_35MultiCastDataStreamSourceLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris9OperatorXINS_21GroupCommitLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris9OperatorXINS_18JDBCScanLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris9OperatorXINS_16EsScanLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris9OperatorXINS_20SchemaScanLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris9OperatorXINS_18MetaScanLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris9OperatorXINS_22RecCTESourceLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris9OperatorXINS_20RecCTEScanLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris9OperatorXINS_16SelectLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
1011
1012
1.45M
    void reset_reserve_mem_size(RuntimeState* state) override {
1013
1.45M
        auto& local_state = get_local_state(state);
1014
1.45M
        local_state.reset_estimate_memory_usage();
1015
1.45M
    }
_ZN5doris9OperatorXINS_23DummyOperatorLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1012
1.45M
    void reset_reserve_mem_size(RuntimeState* state) override {
1013
1.45M
        auto& local_state = get_local_state(state);
1014
1.45M
        local_state.reset_estimate_memory_usage();
1015
1.45M
    }
Unexecuted instantiation: _ZN5doris9OperatorXINS_13AggLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris9OperatorXINS_18AnalyticLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris9OperatorXINS_23AssertNumRowsLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris9OperatorXINS_14MockLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris9OperatorXINS_17DataGenLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris9OperatorXINS_30DistinctStreamingAggLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris9OperatorXINS_18EmptySetLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
_ZN5doris9OperatorXINS_18ExchangeLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1012
11
    void reset_reserve_mem_size(RuntimeState* state) override {
1013
11
        auto& local_state = get_local_state(state);
1014
11
        local_state.reset_estimate_memory_usage();
1015
11
    }
_ZN5doris9OperatorXINS_23HashJoinProbeLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1012
4
    void reset_reserve_mem_size(RuntimeState* state) override {
1013
4
        auto& local_state = get_local_state(state);
1014
4
        local_state.reset_estimate_memory_usage();
1015
4
    }
Unexecuted instantiation: _ZN5doris9OperatorXINS_24LocalMergeSortLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris9OperatorXINS_25MaterializationLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris9OperatorXINS_29PartitionSortSourceLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris9OperatorXINS_24PartitionedAggLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris9OperatorXINS_34PartitionedHashJoinProbeLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris9OperatorXINS_21CacheSourceLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris9OperatorXINS_16RepeatLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris9OperatorXINS_18MockScanLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris9OperatorXINS_19SetSourceLocalStateILb1EEEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris9OperatorXINS_19SetSourceLocalStateILb0EEEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris9OperatorXINS_14SortLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris9OperatorXINS_19SpillSortLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris9OperatorXINS_22StreamingAggLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris9OperatorXINS_23TableFunctionLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris9OperatorXINS_21UnionSourceLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris9OperatorXINS_29LocalExchangeSourceLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris9OperatorXINS_18OlapScanLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris9OperatorXINS_18FileScanLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris9OperatorXINS_29NestedLoopJoinProbeLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris9OperatorXINS_35MultiCastDataStreamSourceLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris9OperatorXINS_21GroupCommitLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris9OperatorXINS_18JDBCScanLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris9OperatorXINS_16EsScanLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris9OperatorXINS_20SchemaScanLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris9OperatorXINS_18MetaScanLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris9OperatorXINS_22RecCTESourceLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris9OperatorXINS_20RecCTEScanLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris9OperatorXINS_16SelectLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
1016
};
1017
1018
/**
1019
 * StreamingOperatorX indicates operators which always processes block in streaming way (one-in-one-out).
1020
 */
1021
template <typename LocalStateType>
1022
class StreamingOperatorX : public OperatorX<LocalStateType> {
1023
public:
1024
    StreamingOperatorX(ObjectPool* pool, const TPlanNode& tnode, int operator_id,
1025
                       const DescriptorTbl& descs)
1026
0
            : OperatorX<LocalStateType>(pool, tnode, operator_id, descs) {}
Unexecuted instantiation: _ZN5doris18StreamingOperatorXINS_23AssertNumRowsLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Unexecuted instantiation: _ZN5doris18StreamingOperatorXINS_16SelectLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
1027
1028
#ifdef BE_TEST
1029
3
    StreamingOperatorX() = default;
1030
#endif
1031
1032
3
    virtual ~StreamingOperatorX() = default;
_ZN5doris18StreamingOperatorXINS_23AssertNumRowsLocalStateEED2Ev
Line
Count
Source
1032
3
    virtual ~StreamingOperatorX() = default;
Unexecuted instantiation: _ZN5doris18StreamingOperatorXINS_16SelectLocalStateEED2Ev
1033
1034
    Status get_block(RuntimeState* state, Block* block, bool* eos) override;
1035
1036
    virtual Status pull(RuntimeState* state, Block* block, bool* eos) = 0;
1037
};
1038
1039
/**
1040
 * StatefulOperatorX indicates the operators with some states inside.
1041
 *
1042
 * Specifically, we called an operator stateful if an operator can determine its output by itself.
1043
 * For example, hash join probe operator is a typical StatefulOperator. When it gets a block from probe side, it will hold this block inside (e.g. _child_block).
1044
 * If there are still remain rows in probe block, we can get output block by calling `get_block` without any data from its child.
1045
 * In a nutshell, it is a one-to-many relation between input blocks and output blocks for StatefulOperator.
1046
 */
1047
template <typename LocalStateType>
1048
class StatefulOperatorX : public OperatorX<LocalStateType> {
1049
public:
1050
    StatefulOperatorX(ObjectPool* pool, const TPlanNode& tnode, const int operator_id,
1051
                      const DescriptorTbl& descs)
1052
72.1k
            : OperatorX<LocalStateType>(pool, tnode, operator_id, descs) {}
Unexecuted instantiation: _ZN5doris17StatefulOperatorXINS_30DistinctStreamingAggLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
_ZN5doris17StatefulOperatorXINS_23HashJoinProbeLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1052
72.0k
            : OperatorX<LocalStateType>(pool, tnode, operator_id, descs) {}
Unexecuted instantiation: _ZN5doris17StatefulOperatorXINS_29NestedLoopJoinProbeLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
_ZN5doris17StatefulOperatorXINS_34PartitionedHashJoinProbeLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1052
48
            : OperatorX<LocalStateType>(pool, tnode, operator_id, descs) {}
Unexecuted instantiation: _ZN5doris17StatefulOperatorXINS_16RepeatLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Unexecuted instantiation: _ZN5doris17StatefulOperatorXINS_25MaterializationLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Unexecuted instantiation: _ZN5doris17StatefulOperatorXINS_22StreamingAggLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
_ZN5doris17StatefulOperatorXINS_23TableFunctionLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1052
5
            : OperatorX<LocalStateType>(pool, tnode, operator_id, descs) {}
1053
#ifdef BE_TEST
1054
21
    StatefulOperatorX() = default;
_ZN5doris17StatefulOperatorXINS_30DistinctStreamingAggLocalStateEEC2Ev
Line
Count
Source
1054
3
    StatefulOperatorX() = default;
_ZN5doris17StatefulOperatorXINS_16RepeatLocalStateEEC2Ev
Line
Count
Source
1054
3
    StatefulOperatorX() = default;
_ZN5doris17StatefulOperatorXINS_22StreamingAggLocalStateEEC2Ev
Line
Count
Source
1054
4
    StatefulOperatorX() = default;
_ZN5doris17StatefulOperatorXINS_23TableFunctionLocalStateEEC2Ev
Line
Count
Source
1054
11
    StatefulOperatorX() = default;
1055
#endif
1056
72.1k
    virtual ~StatefulOperatorX() = default;
_ZN5doris17StatefulOperatorXINS_30DistinctStreamingAggLocalStateEED2Ev
Line
Count
Source
1056
3
    virtual ~StatefulOperatorX() = default;
_ZN5doris17StatefulOperatorXINS_23HashJoinProbeLocalStateEED2Ev
Line
Count
Source
1056
72.0k
    virtual ~StatefulOperatorX() = default;
_ZN5doris17StatefulOperatorXINS_34PartitionedHashJoinProbeLocalStateEED2Ev
Line
Count
Source
1056
48
    virtual ~StatefulOperatorX() = default;
_ZN5doris17StatefulOperatorXINS_16RepeatLocalStateEED2Ev
Line
Count
Source
1056
3
    virtual ~StatefulOperatorX() = default;
_ZN5doris17StatefulOperatorXINS_22StreamingAggLocalStateEED2Ev
Line
Count
Source
1056
4
    virtual ~StatefulOperatorX() = default;
_ZN5doris17StatefulOperatorXINS_23TableFunctionLocalStateEED2Ev
Line
Count
Source
1056
16
    virtual ~StatefulOperatorX() = default;
Unexecuted instantiation: _ZN5doris17StatefulOperatorXINS_29NestedLoopJoinProbeLocalStateEED2Ev
Unexecuted instantiation: _ZN5doris17StatefulOperatorXINS_25MaterializationLocalStateEED2Ev
1057
1058
    using OperatorX<LocalStateType>::get_local_state;
1059
1060
    [[nodiscard]] Status get_block(RuntimeState* state, Block* block, bool* eos) override;
1061
1062
    [[nodiscard]] virtual Status pull(RuntimeState* state, Block* block, bool* eos) const = 0;
1063
    [[nodiscard]] virtual Status push(RuntimeState* state, Block* input_block, bool eos) const = 0;
1064
0
    bool need_more_input_data(RuntimeState* state) const override { return true; }
Unexecuted instantiation: _ZNK5doris17StatefulOperatorXINS_30DistinctStreamingAggLocalStateEE20need_more_input_dataEPNS_12RuntimeStateE
Unexecuted instantiation: _ZNK5doris17StatefulOperatorXINS_23HashJoinProbeLocalStateEE20need_more_input_dataEPNS_12RuntimeStateE
Unexecuted instantiation: _ZNK5doris17StatefulOperatorXINS_25MaterializationLocalStateEE20need_more_input_dataEPNS_12RuntimeStateE
Unexecuted instantiation: _ZNK5doris17StatefulOperatorXINS_34PartitionedHashJoinProbeLocalStateEE20need_more_input_dataEPNS_12RuntimeStateE
Unexecuted instantiation: _ZNK5doris17StatefulOperatorXINS_16RepeatLocalStateEE20need_more_input_dataEPNS_12RuntimeStateE
Unexecuted instantiation: _ZNK5doris17StatefulOperatorXINS_22StreamingAggLocalStateEE20need_more_input_dataEPNS_12RuntimeStateE
Unexecuted instantiation: _ZNK5doris17StatefulOperatorXINS_23TableFunctionLocalStateEE20need_more_input_dataEPNS_12RuntimeStateE
Unexecuted instantiation: _ZNK5doris17StatefulOperatorXINS_29NestedLoopJoinProbeLocalStateEE20need_more_input_dataEPNS_12RuntimeStateE
1065
};
1066
1067
template <typename Writer, typename Parent>
1068
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
1069
class AsyncWriterSink : public PipelineXSinkLocalState<BasicSharedState> {
1070
public:
1071
    using Base = PipelineXSinkLocalState<BasicSharedState>;
1072
    AsyncWriterSink(DataSinkOperatorXBase* parent, RuntimeState* state)
1073
0
            : Base(parent, state), _async_writer_dependency(nullptr) {
1074
0
        _finish_dependency =
1075
0
                std::make_shared<Dependency>(parent->operator_id(), parent->node_id(),
1076
0
                                             parent->get_name() + "_FINISH_DEPENDENCY", true);
1077
0
    }
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_18VIcebergDeleteSinkENS_26IcebergDeleteSinkOperatorXEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_17VIcebergMergeSinkENS_25IcebergMergeSinkOperatorXEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
1078
1079
    Status init(RuntimeState* state, LocalSinkStateInfo& info) override;
1080
1081
    Status open(RuntimeState* state) override;
1082
1083
    Status sink(RuntimeState* state, Block* block, bool eos);
1084
1085
0
    std::vector<Dependency*> dependencies() const override {
1086
0
        return {_async_writer_dependency.get()};
1087
0
    }
Unexecuted instantiation: _ZNK5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE12dependenciesEv
Unexecuted instantiation: _ZNK5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE12dependenciesEv
Unexecuted instantiation: _ZNK5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE12dependenciesEv
Unexecuted instantiation: _ZNK5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE12dependenciesEv
Unexecuted instantiation: _ZNK5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE12dependenciesEv
Unexecuted instantiation: _ZNK5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE12dependenciesEv
Unexecuted instantiation: _ZNK5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE12dependenciesEv
Unexecuted instantiation: _ZNK5doris15AsyncWriterSinkINS_18VIcebergDeleteSinkENS_26IcebergDeleteSinkOperatorXEE12dependenciesEv
Unexecuted instantiation: _ZNK5doris15AsyncWriterSinkINS_17VIcebergMergeSinkENS_25IcebergMergeSinkOperatorXEE12dependenciesEv
Unexecuted instantiation: _ZNK5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE12dependenciesEv
Unexecuted instantiation: _ZNK5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE12dependenciesEv
1088
    Status close(RuntimeState* state, Status exec_status) override;
1089
1090
0
    Dependency* finishdependency() override { return _finish_dependency.get(); }
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE16finishdependencyEv
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE16finishdependencyEv
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE16finishdependencyEv
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE16finishdependencyEv
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE16finishdependencyEv
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE16finishdependencyEv
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE16finishdependencyEv
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_18VIcebergDeleteSinkENS_26IcebergDeleteSinkOperatorXEE16finishdependencyEv
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_17VIcebergMergeSinkENS_25IcebergMergeSinkOperatorXEE16finishdependencyEv
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE16finishdependencyEv
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE16finishdependencyEv
1091
1092
protected:
1093
    VExprContextSPtrs _output_vexpr_ctxs;
1094
    std::unique_ptr<Writer> _writer;
1095
1096
    std::shared_ptr<Dependency> _async_writer_dependency;
1097
    std::shared_ptr<Dependency> _finish_dependency;
1098
};
1099
1100
#ifdef BE_TEST
1101
class DummyOperatorLocalState final : public PipelineXLocalState<FakeSharedState> {
1102
public:
1103
    ENABLE_FACTORY_CREATOR(DummyOperatorLocalState);
1104
1105
    DummyOperatorLocalState(RuntimeState* state, OperatorXBase* parent)
1106
16
            : PipelineXLocalState<FakeSharedState>(state, parent) {
1107
16
        _tmp_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
1108
16
                                                    "DummyOperatorDependency", true);
1109
16
        _finish_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
1110
16
                                                       "DummyOperatorDependency", true);
1111
16
        _filter_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
1112
16
                                                       "DummyOperatorDependency", true);
1113
16
    }
1114
13
    Dependency* finishdependency() override { return _finish_dependency.get(); }
1115
16
    ~DummyOperatorLocalState() = default;
1116
1117
13
    std::vector<Dependency*> dependencies() const override { return {_tmp_dependency.get()}; }
1118
16
    std::vector<Dependency*> execution_dependencies() override {
1119
16
        return {_filter_dependency.get()};
1120
16
    }
1121
1122
private:
1123
    std::shared_ptr<Dependency> _tmp_dependency;
1124
    std::shared_ptr<Dependency> _finish_dependency;
1125
    std::shared_ptr<Dependency> _filter_dependency;
1126
};
1127
1128
class DummyOperator final : public OperatorX<DummyOperatorLocalState> {
1129
public:
1130
19
    DummyOperator() : OperatorX<DummyOperatorLocalState>(nullptr, 0, 0) {}
1131
1132
19
    [[nodiscard]] bool is_source() const override { return true; }
1133
1134
1.45M
    Status get_block(RuntimeState* state, Block* block, bool* eos) override {
1135
1.45M
        *eos = _eos;
1136
1.45M
        return Status::OK();
1137
1.45M
    }
1138
0
    void set_low_memory_mode(RuntimeState* state) override { _low_memory_mode = true; }
1139
5
    Status terminate(RuntimeState* state) override {
1140
5
        _terminated = true;
1141
5
        return Status::OK();
1142
5
    }
1143
6.00k
    size_t revocable_mem_size(RuntimeState* state) const override { return _revocable_mem_size; }
1144
1.45M
    size_t get_reserve_mem_size(RuntimeState* state) override {
1145
1.45M
        return _disable_reserve_mem
1146
1.45M
                       ? 0
1147
1.45M
                       : OperatorX<DummyOperatorLocalState>::get_reserve_mem_size(state);
1148
1.45M
    }
1149
2
    Status revoke_memory(RuntimeState* state) override {
1150
2
        _revoke_called = true;
1151
2
        return Status::OK();
1152
2
    }
1153
1154
private:
1155
    friend class AssertNumRowsLocalState;
1156
    bool _eos = false;
1157
    bool _low_memory_mode = false;
1158
    bool _terminated = false;
1159
    size_t _revocable_mem_size = 0;
1160
    bool _disable_reserve_mem = false;
1161
    bool _revoke_called = false;
1162
};
1163
1164
class DummySinkLocalState final : public PipelineXSinkLocalState<BasicSharedState> {
1165
public:
1166
    using Base = PipelineXSinkLocalState<BasicSharedState>;
1167
    ENABLE_FACTORY_CREATOR(DummySinkLocalState);
1168
16
    DummySinkLocalState(DataSinkOperatorXBase* parent, RuntimeState* state) : Base(parent, state) {
1169
16
        _tmp_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
1170
16
                                                    "DummyOperatorDependency", true);
1171
16
        _finish_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
1172
16
                                                       "DummyOperatorDependency", true);
1173
16
    }
1174
1175
13
    std::vector<Dependency*> dependencies() const override { return {_tmp_dependency.get()}; }
1176
10
    Dependency* finishdependency() override { return _finish_dependency.get(); }
1177
1.59M
    bool is_finished() const override { return _is_finished; }
1178
1179
private:
1180
    std::shared_ptr<Dependency> _tmp_dependency;
1181
    std::shared_ptr<Dependency> _finish_dependency;
1182
    std::atomic_bool _is_finished = false;
1183
};
1184
1185
class DummySinkOperatorX final : public DataSinkOperatorX<DummySinkLocalState> {
1186
public:
1187
    DummySinkOperatorX(int op_id, int node_id, int dest_id)
1188
19
            : DataSinkOperatorX<DummySinkLocalState>(op_id, node_id, dest_id) {}
1189
6
    Status sink(RuntimeState* state, Block* in_block, bool eos) override {
1190
6
        return _return_eof ? Status::Error<ErrorCode::END_OF_FILE>("source have closed")
1191
6
                           : Status::OK();
1192
6
    }
1193
0
    void set_low_memory_mode(RuntimeState* state) override { _low_memory_mode = true; }
1194
5
    Status terminate(RuntimeState* state) override {
1195
5
        _terminated = true;
1196
5
        return Status::OK();
1197
5
    }
1198
4.00k
    size_t revocable_mem_size(RuntimeState* state) const override { return _revocable_mem_size; }
1199
939
    size_t get_reserve_mem_size(RuntimeState* state, bool eos) override {
1200
939
        return _disable_reserve_mem
1201
939
                       ? 0
1202
939
                       : DataSinkOperatorX<DummySinkLocalState>::get_reserve_mem_size(state, eos);
1203
939
    }
1204
1
    Status revoke_memory(RuntimeState* state) override {
1205
1
        _revoke_called = true;
1206
1
        return Status::OK();
1207
1
    }
1208
1209
private:
1210
    bool _low_memory_mode = false;
1211
    bool _terminated = false;
1212
    std::atomic_bool _return_eof = false;
1213
    size_t _revocable_mem_size = 0;
1214
    bool _disable_reserve_mem = false;
1215
    bool _revoke_called = false;
1216
};
1217
#endif
1218
1219
} // namespace doris