Coverage Report

Created: 2026-03-21 15:29

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