Coverage Report

Created: 2026-07-31 14:55

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 <limits>
27
#include <memory>
28
#include <string>
29
#include <utility>
30
#include <vector>
31
32
#include "common/be_mock_util.h"
33
#include "common/exception.h"
34
#include "common/logging.h"
35
#include "common/status.h"
36
#include "core/block/block.h"
37
#include "exec/exchange/local_exchanger.h"
38
#include "exec/exchange/vdata_stream_recvr.h"
39
#include "exec/operator/operator.h"
40
#include "exec/operator/spill_counters.h"
41
#include "exec/operator/spill_utils.h"
42
#include "exec/pipeline/dependency.h"
43
#include "runtime/memory/mem_tracker.h"
44
#include "runtime/query_context.h"
45
#include "runtime/runtime_profile.h"
46
#include "runtime/runtime_profile_counter_names.h"
47
#include "runtime/runtime_state.h"
48
#include "runtime/thread_context.h"
49
#include "util/block_budget.h"
50
51
namespace doris {
52
class RowDescriptor;
53
class RuntimeState;
54
class TDataSink;
55
class AsyncResultWriter;
56
class ScoreRuntime;
57
class AnnTopNRuntime;
58
class ParsedPartitionBoundaries;
59
} // namespace doris
60
61
namespace doris {
62
63
class OperatorBase;
64
class OperatorXBase;
65
class DataSinkOperatorXBase;
66
67
using OperatorPtr = std::shared_ptr<OperatorXBase>;
68
using Operators = std::vector<OperatorPtr>;
69
70
using DataSinkOperatorPtr = std::shared_ptr<DataSinkOperatorXBase>;
71
72
// This struct is used only for initializing local state.
73
struct LocalStateInfo {
74
    RuntimeProfile* parent_profile = nullptr;
75
    const std::vector<TScanRangeParams>& scan_ranges;
76
    BasicSharedState* shared_state;
77
    const std::map<int, std::pair<std::shared_ptr<BasicSharedState>,
78
                                  std::vector<std::shared_ptr<Dependency>>>>& shared_state_map;
79
    const int task_idx;
80
};
81
82
// This struct is used only for initializing local sink state.
83
struct LocalSinkStateInfo {
84
    const int task_idx;
85
    RuntimeProfile* parent_profile = nullptr;
86
    const int sender_id;
87
    BasicSharedState* shared_state;
88
    const std::map<int, std::pair<std::shared_ptr<BasicSharedState>,
89
                                  std::vector<std::shared_ptr<Dependency>>>>& shared_state_map;
90
    const TDataSink& tsink;
91
};
92
93
class OperatorBase {
94
public:
95
710k
    explicit OperatorBase() : _child(nullptr), _is_closed(false) {}
96
    explicit OperatorBase(bool is_serial_operator)
97
1.22M
            : _child(nullptr), _is_closed(false), _is_serial_operator(is_serial_operator) {}
98
1.93M
    virtual ~OperatorBase() = default;
99
100
0
    virtual bool is_sink() const { return false; }
101
102
1.03M
    virtual bool is_source() const { return false; }
103
104
    [[nodiscard]] virtual const RowDescriptor& row_desc() const;
105
106
0
    [[nodiscard]] virtual Status init(const TDataSink& tsink) { return Status::OK(); }
107
108
    [[nodiscard]] virtual std::string get_name() const = 0;
109
    [[nodiscard]] virtual Status prepare(RuntimeState* state) = 0;
110
    [[nodiscard]] virtual Status terminate(RuntimeState* state) = 0;
111
    [[nodiscard]] virtual Status close(RuntimeState* state);
112
    [[nodiscard]] virtual int node_id() const = 0;
113
737k
    [[nodiscard]] virtual int parallelism(RuntimeState* state) const {
114
737k
        return _is_serial_operator ? 1 : state->query_parallel_instance_num();
115
737k
    }
116
117
1.22M
    [[nodiscard]] virtual Status set_child(OperatorPtr child) {
118
1.22M
        if (_child && child != nullptr) {
119
0
            return Status::InternalError("Child is already set in node name={}", get_name());
120
0
        }
121
1.22M
        _child = child;
122
1.22M
        return Status::OK();
123
1.22M
    }
124
125
    // Operators need to be executed serially. (e.g. finalized agg without key)
126
3.53M
    [[nodiscard]] virtual bool is_serial_operator() const { return _is_serial_operator; }
127
128
0
    [[nodiscard]] bool is_closed() const { return _is_closed; }
129
130
45.8k
    virtual size_t revocable_mem_size(RuntimeState* state) const { return 0; }
131
132
0
    virtual Status revoke_memory(RuntimeState* state) { return Status::OK(); }
133
134
10
    virtual bool is_hash_join_probe() const { return false; }
135
136
12
    virtual bool is_repeat() const { return false; }
137
138
    /**
139
     * Pipeline task is blockable means it will be blocked in the next run. So we should put the
140
     * pipeline task into the blocking task scheduler.
141
     */
142
    virtual bool is_blockable(RuntimeState* state) const = 0;
143
140
    virtual void set_low_memory_mode(RuntimeState* state) {}
144
145
    OperatorPtr child() { return _child; }
146
0
    virtual Status reset(RuntimeState* state) {
147
0
        return Status::InternalError("Reset is not implemented in operator: {}", get_name());
148
0
    }
149
150
    /* -------------- Interfaces to determine the input data properties -------------- */
151
    /**
152
     * Return True if this operator relies on the bucket distribution (e.g. COLOCATE join, 1-phase AGG).
153
     * Data input to this kind of operators must have the same distribution with the table buckets.
154
     * It is also means `required_data_distribution` should be `BUCKET_HASH_SHUFFLE`.
155
     * @return
156
     */
157
4.10M
    [[nodiscard]] virtual bool is_colocated_operator() const { return false; }
158
    /**
159
     * Return True if this operator relies on the bucket distribution or specific hash data distribution (e.g. SHUFFLED HASH join).
160
     * Data input to this kind of operators must be HASH distributed according to some rules.
161
     * All colocated operators are also shuffled operators.
162
     * It is also means `required_data_distribution` should be `BUCKET_HASH_SHUFFLE` or `HASH_SHUFFLE`.
163
     * @return
164
     */
165
4.10M
    [[nodiscard]] virtual bool is_shuffled_operator() const { return false; }
166
    /**
167
     * 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).
168
     *
169
     * For single child's operators, return true if this operator is followed by a shuffled operator.
170
     * For example, in the plan fragment:
171
     *   `UNION` -> `SHUFFLED HASH JOIN`
172
     * The `SHUFFLED HASH JOIN` is a shuffled operator so the UNION operator is followed by a shuffled operator.
173
     */
174
4.38M
    [[nodiscard]] virtual bool followed_by_shuffled_operator() const {
175
4.38M
        return _followed_by_shuffled_operator;
176
4.38M
    }
177
    /**
178
     * Update the operator properties according to the plan node.
179
     * This is called before `prepare`.
180
     */
181
    virtual void update_operator(const TPlanNode& tnode, bool followed_by_shuffled_operator,
182
935k
                                 bool require_bucket_distribution) {
183
935k
        _followed_by_shuffled_operator = followed_by_shuffled_operator;
184
935k
        _require_bucket_distribution = require_bucket_distribution;
185
935k
    }
186
    /**
187
     * Return the required data distribution of this operator.
188
     */
189
    [[nodiscard]] virtual DataDistribution required_data_distribution(
190
            RuntimeState* /*state*/) const;
191
192
protected:
193
    [[nodiscard]] bool child_breaks_local_key_distribution(RuntimeState* state) const;
194
195
    OperatorPtr _child = nullptr;
196
197
    bool _is_closed;
198
    bool _followed_by_shuffled_operator = false;
199
    bool _require_bucket_distribution = false;
200
    bool _is_serial_operator = false;
201
};
202
203
class PipelineXLocalStateBase {
204
public:
205
    PipelineXLocalStateBase(RuntimeState* state, OperatorXBase* parent);
206
2.55M
    virtual ~PipelineXLocalStateBase() = default;
207
208
    template <class TARGET>
209
25.1M
    TARGET& cast() {
210
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
211
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
212
18.4E
                << " and expect type is" << typeid(TARGET).name();
213
25.1M
        return reinterpret_cast<TARGET&>(*this);
214
25.1M
    }
_ZN5doris23PipelineXLocalStateBase4castINS_22RecCTESourceLocalStateEEERT_v
Line
Count
Source
209
12.7k
    TARGET& cast() {
210
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
211
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
212
18.4E
                << " and expect type is" << typeid(TARGET).name();
213
12.7k
        return reinterpret_cast<TARGET&>(*this);
214
12.7k
    }
_ZN5doris23PipelineXLocalStateBase4castINS_21CacheSourceLocalStateEEERT_v
Line
Count
Source
209
89
    TARGET& cast() {
210
89
        DCHECK(dynamic_cast<TARGET*>(this))
211
0
                << " Mismatch type! Current type is " << typeid(*this).name()
212
0
                << " and expect type is" << typeid(TARGET).name();
213
89
        return reinterpret_cast<TARGET&>(*this);
214
89
    }
_ZN5doris23PipelineXLocalStateBase4castINS_29LocalExchangeSourceLocalStateEEERT_v
Line
Count
Source
209
3.50M
    TARGET& cast() {
210
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
211
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
212
18.4E
                << " and expect type is" << typeid(TARGET).name();
213
3.50M
        return reinterpret_cast<TARGET&>(*this);
214
3.50M
    }
_ZN5doris23PipelineXLocalStateBase4castINS_35MultiCastDataStreamSourceLocalStateEEERT_v
Line
Count
Source
209
118k
    TARGET& cast() {
210
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
211
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
212
18.4E
                << " and expect type is" << typeid(TARGET).name();
213
118k
        return reinterpret_cast<TARGET&>(*this);
214
118k
    }
_ZN5doris23PipelineXLocalStateBase4castINS_18OlapScanLocalStateEEERT_v
Line
Count
Source
209
5.57M
    TARGET& cast() {
210
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
211
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
212
18.4E
                << " and expect type is" << typeid(TARGET).name();
213
5.57M
        return reinterpret_cast<TARGET&>(*this);
214
5.57M
    }
_ZN5doris23PipelineXLocalStateBase4castINS_21GroupCommitLocalStateEEERT_v
Line
Count
Source
209
4.77M
    TARGET& cast() {
210
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
211
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
212
18.4E
                << " and expect type is" << typeid(TARGET).name();
213
4.77M
        return reinterpret_cast<TARGET&>(*this);
214
4.77M
    }
Unexecuted instantiation: _ZN5doris23PipelineXLocalStateBase4castINS_18JDBCScanLocalStateEEERT_v
_ZN5doris23PipelineXLocalStateBase4castINS_18FileScanLocalStateEEERT_v
Line
Count
Source
209
500k
    TARGET& cast() {
210
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
211
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
212
18.4E
                << " and expect type is" << typeid(TARGET).name();
213
500k
        return reinterpret_cast<TARGET&>(*this);
214
500k
    }
_ZN5doris23PipelineXLocalStateBase4castINS_23HashJoinProbeLocalStateEEERT_v
Line
Count
Source
209
1.17M
    TARGET& cast() {
210
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
211
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
212
18.4E
                << " and expect type is" << typeid(TARGET).name();
213
1.17M
        return reinterpret_cast<TARGET&>(*this);
214
1.17M
    }
_ZN5doris23PipelineXLocalStateBase4castINS_34PartitionedHashJoinProbeLocalStateEEERT_v
Line
Count
Source
209
59
    TARGET& cast() {
210
59
        DCHECK(dynamic_cast<TARGET*>(this))
211
0
                << " Mismatch type! Current type is " << typeid(*this).name()
212
0
                << " and expect type is" << typeid(TARGET).name();
213
59
        return reinterpret_cast<TARGET&>(*this);
214
59
    }
_ZN5doris23PipelineXLocalStateBase4castINS_29NestedLoopJoinProbeLocalStateEEERT_v
Line
Count
Source
209
240k
    TARGET& cast() {
210
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
211
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
212
18.4E
                << " and expect type is" << typeid(TARGET).name();
213
240k
        return reinterpret_cast<TARGET&>(*this);
214
240k
    }
_ZN5doris23PipelineXLocalStateBase4castINS_21UnionSourceLocalStateEEERT_v
Line
Count
Source
209
363k
    TARGET& cast() {
210
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
211
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
212
18.4E
                << " and expect type is" << typeid(TARGET).name();
213
363k
        return reinterpret_cast<TARGET&>(*this);
214
363k
    }
_ZN5doris23PipelineXLocalStateBase4castINS_29PartitionSortSourceLocalStateEEERT_v
Line
Count
Source
209
3.27k
    TARGET& cast() {
210
3.27k
        DCHECK(dynamic_cast<TARGET*>(this))
211
0
                << " Mismatch type! Current type is " << typeid(*this).name()
212
0
                << " and expect type is" << typeid(TARGET).name();
213
3.27k
        return reinterpret_cast<TARGET&>(*this);
214
3.27k
    }
_ZN5doris23PipelineXLocalStateBase4castINS_25MaterializationLocalStateEEERT_v
Line
Count
Source
209
38.3k
    TARGET& cast() {
210
38.3k
        DCHECK(dynamic_cast<TARGET*>(this))
211
0
                << " Mismatch type! Current type is " << typeid(*this).name()
212
0
                << " and expect type is" << typeid(TARGET).name();
213
38.3k
        return reinterpret_cast<TARGET&>(*this);
214
38.3k
    }
_ZN5doris23PipelineXLocalStateBase4castINS_19SetSourceLocalStateILb1EEEEERT_v
Line
Count
Source
209
8.01k
    TARGET& cast() {
210
8.01k
        DCHECK(dynamic_cast<TARGET*>(this))
211
0
                << " Mismatch type! Current type is " << typeid(*this).name()
212
0
                << " and expect type is" << typeid(TARGET).name();
213
8.01k
        return reinterpret_cast<TARGET&>(*this);
214
8.01k
    }
_ZN5doris23PipelineXLocalStateBase4castINS_19SetSourceLocalStateILb0EEEEERT_v
Line
Count
Source
209
8.45k
    TARGET& cast() {
210
8.45k
        DCHECK(dynamic_cast<TARGET*>(this))
211
0
                << " Mismatch type! Current type is " << typeid(*this).name()
212
0
                << " and expect type is" << typeid(TARGET).name();
213
8.45k
        return reinterpret_cast<TARGET&>(*this);
214
8.45k
    }
_ZN5doris23PipelineXLocalStateBase4castINS_18EmptySetLocalStateEEERT_v
Line
Count
Source
209
3.99k
    TARGET& cast() {
210
3.99k
        DCHECK(dynamic_cast<TARGET*>(this))
211
0
                << " Mismatch type! Current type is " << typeid(*this).name()
212
0
                << " and expect type is" << typeid(TARGET).name();
213
3.99k
        return reinterpret_cast<TARGET&>(*this);
214
3.99k
    }
_ZN5doris23PipelineXLocalStateBase4castINS_18MetaScanLocalStateEEERT_v
Line
Count
Source
209
20.3k
    TARGET& cast() {
210
20.3k
        DCHECK(dynamic_cast<TARGET*>(this))
211
0
                << " Mismatch type! Current type is " << typeid(*this).name()
212
0
                << " and expect type is" << typeid(TARGET).name();
213
20.3k
        return reinterpret_cast<TARGET&>(*this);
214
20.3k
    }
_ZN5doris23PipelineXLocalStateBase4castINS_16SelectLocalStateEEERT_v
Line
Count
Source
209
47.9k
    TARGET& cast() {
210
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
211
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
212
18.4E
                << " and expect type is" << typeid(TARGET).name();
213
47.9k
        return reinterpret_cast<TARGET&>(*this);
214
47.9k
    }
_ZN5doris23PipelineXLocalStateBase4castINS_20RecCTEScanLocalStateEEERT_v
Line
Count
Source
209
14.9k
    TARGET& cast() {
210
14.9k
        DCHECK(dynamic_cast<TARGET*>(this))
211
0
                << " Mismatch type! Current type is " << typeid(*this).name()
212
0
                << " and expect type is" << typeid(TARGET).name();
213
14.9k
        return reinterpret_cast<TARGET&>(*this);
214
14.9k
    }
_ZN5doris23PipelineXLocalStateBase4castINS_23TableFunctionLocalStateEEERT_v
Line
Count
Source
209
56.1k
    TARGET& cast() {
210
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
211
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
212
18.4E
                << " and expect type is" << typeid(TARGET).name();
213
56.1k
        return reinterpret_cast<TARGET&>(*this);
214
56.1k
    }
_ZN5doris23PipelineXLocalStateBase4castINS_18ExchangeLocalStateEEERT_v
Line
Count
Source
209
2.21M
    TARGET& cast() {
210
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
211
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
212
18.4E
                << " and expect type is" << typeid(TARGET).name();
213
2.21M
        return reinterpret_cast<TARGET&>(*this);
214
2.21M
    }
_ZN5doris23PipelineXLocalStateBase4castINS_30DistinctStreamingAggLocalStateEEERT_v
Line
Count
Source
209
4.05M
    TARGET& cast() {
210
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
211
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
212
18.4E
                << " and expect type is" << typeid(TARGET).name();
213
4.05M
        return reinterpret_cast<TARGET&>(*this);
214
4.05M
    }
_ZN5doris23PipelineXLocalStateBase4castINS_22StreamingAggLocalStateEEERT_v
Line
Count
Source
209
292k
    TARGET& cast() {
210
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
211
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
212
18.4E
                << " and expect type is" << typeid(TARGET).name();
213
292k
        return reinterpret_cast<TARGET&>(*this);
214
292k
    }
_ZN5doris23PipelineXLocalStateBase4castINS_13AggLocalStateEEERT_v
Line
Count
Source
209
505k
    TARGET& cast() {
210
505k
        DCHECK(dynamic_cast<TARGET*>(this))
211
43
                << " Mismatch type! Current type is " << typeid(*this).name()
212
43
                << " and expect type is" << typeid(TARGET).name();
213
505k
        return reinterpret_cast<TARGET&>(*this);
214
505k
    }
_ZN5doris23PipelineXLocalStateBase4castINS_24PartitionedAggLocalStateEEERT_v
Line
Count
Source
209
940
    TARGET& cast() {
210
940
        DCHECK(dynamic_cast<TARGET*>(this))
211
0
                << " Mismatch type! Current type is " << typeid(*this).name()
212
0
                << " and expect type is" << typeid(TARGET).name();
213
940
        return reinterpret_cast<TARGET&>(*this);
214
940
    }
_ZN5doris23PipelineXLocalStateBase4castINS_21BucketedAggLocalStateEEERT_v
Line
Count
Source
209
15.8k
    TARGET& cast() {
210
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
211
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
212
18.4E
                << " and expect type is" << typeid(TARGET).name();
213
15.8k
        return reinterpret_cast<TARGET&>(*this);
214
15.8k
    }
_ZN5doris23PipelineXLocalStateBase4castINS_14SortLocalStateEEERT_v
Line
Count
Source
209
32.7k
    TARGET& cast() {
210
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
211
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
212
18.4E
                << " and expect type is" << typeid(TARGET).name();
213
32.7k
        return reinterpret_cast<TARGET&>(*this);
214
32.7k
    }
_ZN5doris23PipelineXLocalStateBase4castINS_19SpillSortLocalStateEEERT_v
Line
Count
Source
209
890
    TARGET& cast() {
210
890
        DCHECK(dynamic_cast<TARGET*>(this))
211
0
                << " Mismatch type! Current type is " << typeid(*this).name()
212
0
                << " and expect type is" << typeid(TARGET).name();
213
890
        return reinterpret_cast<TARGET&>(*this);
214
890
    }
_ZN5doris23PipelineXLocalStateBase4castINS_24LocalMergeSortLocalStateEEERT_v
Line
Count
Source
209
1.43M
    TARGET& cast() {
210
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
211
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
212
18.4E
                << " and expect type is" << typeid(TARGET).name();
213
1.43M
        return reinterpret_cast<TARGET&>(*this);
214
1.43M
    }
_ZN5doris23PipelineXLocalStateBase4castINS_18AnalyticLocalStateEEERT_v
Line
Count
Source
209
31.8k
    TARGET& cast() {
210
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
211
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
212
18.4E
                << " and expect type is" << typeid(TARGET).name();
213
31.8k
        return reinterpret_cast<TARGET&>(*this);
214
31.8k
    }
_ZN5doris23PipelineXLocalStateBase4castINS_16RepeatLocalStateEEERT_v
Line
Count
Source
209
35.5k
    TARGET& cast() {
210
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
211
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
212
18.4E
                << " and expect type is" << typeid(TARGET).name();
213
35.5k
        return reinterpret_cast<TARGET&>(*this);
214
35.5k
    }
_ZN5doris23PipelineXLocalStateBase4castINS_23AssertNumRowsLocalStateEEERT_v
Line
Count
Source
209
1.28k
    TARGET& cast() {
210
1.28k
        DCHECK(dynamic_cast<TARGET*>(this))
211
0
                << " Mismatch type! Current type is " << typeid(*this).name()
212
0
                << " and expect type is" << typeid(TARGET).name();
213
1.28k
        return reinterpret_cast<TARGET&>(*this);
214
1.28k
    }
_ZN5doris23PipelineXLocalStateBase4castINS_17DataGenLocalStateEEERT_v
Line
Count
Source
209
75.4k
    TARGET& cast() {
210
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
211
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
212
18.4E
                << " and expect type is" << typeid(TARGET).name();
213
75.4k
        return reinterpret_cast<TARGET&>(*this);
214
75.4k
    }
_ZN5doris23PipelineXLocalStateBase4castINS_20SchemaScanLocalStateEEERT_v
Line
Count
Source
209
11.8k
    TARGET& cast() {
210
11.8k
        DCHECK(dynamic_cast<TARGET*>(this))
211
0
                << " Mismatch type! Current type is " << typeid(*this).name()
212
0
                << " and expect type is" << typeid(TARGET).name();
213
11.8k
        return reinterpret_cast<TARGET&>(*this);
214
11.8k
    }
215
    template <class TARGET>
216
    const TARGET& cast() const {
217
        DCHECK(dynamic_cast<TARGET*>(this))
218
                << " Mismatch type! Current type is " << typeid(*this).name()
219
                << " and expect type is" << typeid(TARGET).name();
220
        return reinterpret_cast<const TARGET&>(*this);
221
    }
222
223
    // Do initialization. This step should be executed only once and in bthread, so we can do some
224
    // lightweight or non-idempotent operations (e.g. init profile, clone expr ctx from operatorX)
225
    virtual Status init(RuntimeState* state, LocalStateInfo& info) = 0;
226
    // Make sure all resources are ready before execution. For example, remote tablets should be
227
    // loaded to local storage.
228
    // This is called by execution pthread and different from `Operator::prepare` which is called
229
    // by bthread.
230
    virtual Status prepare(RuntimeState* state) = 0;
231
    // Do initialization. This step can be executed multiple times, so we should make sure it is
232
    // idempotent (e.g. wait for runtime filters).
233
    virtual Status open(RuntimeState* state) = 0;
234
    virtual Status close(RuntimeState* state) = 0;
235
    virtual Status terminate(RuntimeState* state) = 0;
236
237
    // If use projection, we should clear `_origin_block`.
238
    void clear_origin_block();
239
240
    void reached_limit(Block* block, bool* eos);
241
2.52M
    RuntimeProfile* operator_profile() { return _operator_profile.get(); }
242
774k
    RuntimeProfile* common_profile() { return _common_profile.get(); }
243
16.7M
    RuntimeProfile* custom_profile() { return _custom_profile.get(); }
244
245
14.1M
    RuntimeProfile::Counter* exec_time_counter() { return _exec_timer; }
246
0
    RuntimeProfile::Counter* memory_used_counter() { return _memory_used_counter; }
247
8.20k
    OperatorXBase* parent() { return _parent; }
248
4.75M
    RuntimeState* state() { return _state; }
249
7.80k
    [[nodiscard]] const BlockBudget& block_budget() const { return _budget; }
250
691k
    VExprContextSPtrs& conjuncts() { return _conjuncts; }
251
0
    VExprContextSPtrs& projections() { return _projections; }
252
21.6k
    [[nodiscard]] int64_t num_rows_returned() const { return _num_rows_returned; }
253
712k
    void add_num_rows_returned(int64_t delta) { _num_rows_returned += delta; }
254
6.73k
    void set_num_rows_returned(int64_t value) { _num_rows_returned = value; }
255
7.94M
    void update_output_block_counters(const Block& block) {
256
7.94M
        if (auto rows = block.rows()) {
257
1.41M
            COUNTER_UPDATE(_rows_returned_counter, rows);
258
1.41M
            COUNTER_UPDATE(_blocks_returned_counter, 1);
259
1.41M
            auto block_bytes = static_cast<int64_t>(block.bytes());
260
1.41M
            COUNTER_UPDATE(_output_block_bytes_counter, block_bytes);
261
1.41M
            if (block_bytes > _max_output_block_bytes) {
262
868k
                _max_output_block_bytes = block_bytes;
263
868k
                COUNTER_SET(_max_output_block_bytes_counter, block_bytes);
264
868k
            }
265
1.41M
            if (block_bytes < _min_output_block_bytes) {
266
871k
                _min_output_block_bytes = block_bytes;
267
871k
                COUNTER_SET(_min_output_block_bytes_counter, block_bytes);
268
871k
            }
269
1.41M
        }
270
7.94M
    }
271
272
    [[nodiscard]] virtual std::string debug_string(int indentation_level = 0) const = 0;
273
    [[nodiscard]] virtual bool is_blockable() const;
274
275
0
    virtual std::vector<Dependency*> dependencies() const { return {nullptr}; }
276
277
    // override in Scan
278
2.50M
    virtual Dependency* finishdependency() { return nullptr; }
279
    //  override in Scan  MultiCastSink
280
1.66M
    virtual std::vector<Dependency*> execution_dependencies() { return {}; }
281
282
    Status filter_block(const VExprContextSPtrs& expr_contexts, Block* block);
283
284
4.83M
    int64_t& estimate_memory_usage() { return _estimate_memory_usage; }
285
286
7.98M
    void reset_estimate_memory_usage() { _estimate_memory_usage = 0; }
287
288
9.62M
    bool low_memory_mode() {
289
#ifdef BE_TEST
290
        return false;
291
#else
292
9.62M
        return _state->low_memory_mode();
293
9.62M
#endif
294
9.62M
    }
295
296
protected:
297
    friend class OperatorXBase;
298
    template <typename LocalStateType>
299
    friend class ScanOperatorX;
300
301
    ObjectPool* _pool = nullptr;
302
    int64_t _num_rows_returned {0};
303
    int64_t _estimate_memory_usage {0};
304
305
    /*
306
    Each operator has its profile like this:
307
    XXXX_OPERATOR:
308
        CommonCounters:
309
            ...
310
        CustomCounters:
311
            ...
312
    */
313
    // Profile of this operator.
314
    // Should not modify this profile usually.
315
    std::unique_ptr<RuntimeProfile> _operator_profile;
316
    // CommonCounters of this operator.
317
    // CommonCounters are counters that will be used by all operators.
318
    std::unique_ptr<RuntimeProfile> _common_profile;
319
    // CustomCounters of this operator.
320
    // CustomCounters are counters that will be used by this operator only.
321
    std::unique_ptr<RuntimeProfile> _custom_profile;
322
323
    RuntimeProfile::Counter* _rows_returned_counter = nullptr;
324
    RuntimeProfile::Counter* _blocks_returned_counter = nullptr;
325
    RuntimeProfile::Counter* _output_block_bytes_counter = nullptr;
326
    RuntimeProfile::Counter* _max_output_block_bytes_counter = nullptr;
327
    RuntimeProfile::Counter* _min_output_block_bytes_counter = nullptr;
328
    int64_t _max_output_block_bytes = 0;
329
    int64_t _min_output_block_bytes = std::numeric_limits<int64_t>::max();
330
    RuntimeProfile::Counter* _wait_for_dependency_timer = nullptr;
331
    // Account for current memory and peak memory used by this node
332
    RuntimeProfile::HighWaterMarkCounter* _memory_used_counter = nullptr;
333
    RuntimeProfile::Counter* _projection_timer = nullptr;
334
    RuntimeProfile::Counter* _exec_timer = nullptr;
335
    RuntimeProfile::Counter* _init_timer = nullptr;
336
    RuntimeProfile::Counter* _open_timer = nullptr;
337
    RuntimeProfile::Counter* _close_timer = nullptr;
338
339
    OperatorXBase* _parent = nullptr;
340
    RuntimeState* _state = nullptr;
341
    // Execution-scoped row/byte budget derived from the session batch settings.
342
    const BlockBudget _budget;
343
    VExprContextSPtrs _conjuncts;
344
    VExprContextSPtrs _projections;
345
    std::shared_ptr<ScoreRuntime> _score_runtime;
346
    std::shared_ptr<segment_v2::AnnTopNRuntime> _ann_topn_runtime;
347
    // Used in common subexpression elimination to compute intermediate results.
348
    std::vector<VExprContextSPtrs> _intermediate_projections;
349
350
    bool _closed = false;
351
    std::atomic<bool> _terminated = false;
352
    Block _origin_block;
353
};
354
355
template <typename SharedStateArg = FakeSharedState>
356
class PipelineXLocalState : public PipelineXLocalStateBase {
357
public:
358
    using SharedStateType = SharedStateArg;
359
    PipelineXLocalState(RuntimeState* state, OperatorXBase* parent)
360
2.53M
            : PipelineXLocalStateBase(state, parent) {}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEEC2EPNS_12RuntimeStateEPNS_13OperatorXBaseE
Line
Count
Source
360
70.1k
            : PipelineXLocalStateBase(state, parent) {}
_ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEEC2EPNS_12RuntimeStateEPNS_13OperatorXBaseE
Line
Count
Source
360
42
            : PipelineXLocalStateBase(state, parent) {}
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEEC2EPNS_12RuntimeStateEPNS_13OperatorXBaseE
Line
Count
Source
360
273k
            : PipelineXLocalStateBase(state, parent) {}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEEC2EPNS_12RuntimeStateEPNS_13OperatorXBaseE
Line
Count
Source
360
37
            : PipelineXLocalStateBase(state, parent) {}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEEC2EPNS_12RuntimeStateEPNS_13OperatorXBaseE
Line
Count
Source
360
9.42k
            : PipelineXLocalStateBase(state, parent) {}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEEC2EPNS_12RuntimeStateEPNS_13OperatorXBaseE
Line
Count
Source
360
6.73k
            : PipelineXLocalStateBase(state, parent) {}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEEC2EPNS_12RuntimeStateEPNS_13OperatorXBaseE
Line
Count
Source
360
168k
            : PipelineXLocalStateBase(state, parent) {}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEEC2EPNS_12RuntimeStateEPNS_13OperatorXBaseE
Line
Count
Source
360
429
            : PipelineXLocalStateBase(state, parent) {}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEEC2EPNS_12RuntimeStateEPNS_13OperatorXBaseE
Line
Count
Source
360
236
            : PipelineXLocalStateBase(state, parent) {}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEEC2EPNS_12RuntimeStateEPNS_13OperatorXBaseE
Line
Count
Source
360
1.17M
            : PipelineXLocalStateBase(state, parent) {}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEEC2EPNS_12RuntimeStateEPNS_13OperatorXBaseE
Line
Count
Source
360
56.3k
            : PipelineXLocalStateBase(state, parent) {}
_ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEEC2EPNS_12RuntimeStateEPNS_13OperatorXBaseE
Line
Count
Source
360
25
            : PipelineXLocalStateBase(state, parent) {}
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEEC2EPNS_12RuntimeStateEPNS_13OperatorXBaseE
Line
Count
Source
360
10.0k
            : PipelineXLocalStateBase(state, parent) {}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEEC2EPNS_12RuntimeStateEPNS_13OperatorXBaseE
Line
Count
Source
360
409
            : PipelineXLocalStateBase(state, parent) {}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEEC2EPNS_12RuntimeStateEPNS_13OperatorXBaseE
Line
Count
Source
360
4.80k
            : PipelineXLocalStateBase(state, parent) {}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEEC2EPNS_12RuntimeStateEPNS_13OperatorXBaseE
Line
Count
Source
360
759k
            : PipelineXLocalStateBase(state, parent) {}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEEC2EPNS_12RuntimeStateEPNS_13OperatorXBaseE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEEC2EPNS_12RuntimeStateEPNS_13OperatorXBaseE
Line
Count
Source
360
164
            : PipelineXLocalStateBase(state, parent) {}
361
    ~PipelineXLocalState() override = default;
362
363
    Status init(RuntimeState* state, LocalStateInfo& info) override;
364
12.0M
    Status prepare(RuntimeState* state) override { return Status::OK(); }
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE7prepareEPNS_12RuntimeStateE
Line
Count
Source
364
4.79M
    Status prepare(RuntimeState* state) override { return Status::OK(); }
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE7prepareEPNS_12RuntimeStateE
Line
Count
Source
364
25.9k
    Status prepare(RuntimeState* state) override { return Status::OK(); }
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE7prepareEPNS_12RuntimeStateE
Line
Count
Source
364
1.43M
    Status prepare(RuntimeState* state) override { return Status::OK(); }
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE7prepareEPNS_12RuntimeStateE
Line
Count
Source
364
4.17M
    Status prepare(RuntimeState* state) override { return Status::OK(); }
_ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE7prepareEPNS_12RuntimeStateE
Line
Count
Source
364
62
    Status prepare(RuntimeState* state) override { return Status::OK(); }
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE7prepareEPNS_12RuntimeStateE
Line
Count
Source
364
1.67k
    Status prepare(RuntimeState* state) override { return Status::OK(); }
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE7prepareEPNS_12RuntimeStateE
Line
Count
Source
364
131k
    Status prepare(RuntimeState* state) override { return Status::OK(); }
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE7prepareEPNS_12RuntimeStateE
Line
Count
Source
364
386k
    Status prepare(RuntimeState* state) override { return Status::OK(); }
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE7prepareEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE7prepareEPNS_12RuntimeStateE
Line
Count
Source
364
220
    Status prepare(RuntimeState* state) override { return Status::OK(); }
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE7prepareEPNS_12RuntimeStateE
Line
Count
Source
364
72.5k
    Status prepare(RuntimeState* state) override { return Status::OK(); }
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE7prepareEPNS_12RuntimeStateE
Line
Count
Source
364
33.6k
    Status prepare(RuntimeState* state) override { return Status::OK(); }
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE7prepareEPNS_12RuntimeStateE
Line
Count
Source
364
835k
    Status prepare(RuntimeState* state) override { return Status::OK(); }
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE7prepareEPNS_12RuntimeStateE
Line
Count
Source
364
5.52k
    Status prepare(RuntimeState* state) override { return Status::OK(); }
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE7prepareEPNS_12RuntimeStateE
Line
Count
Source
364
1.08k
    Status prepare(RuntimeState* state) override { return Status::OK(); }
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE7prepareEPNS_12RuntimeStateE
Line
Count
Source
364
107k
    Status prepare(RuntimeState* state) override { return Status::OK(); }
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE7prepareEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE7prepareEPNS_12RuntimeStateE
Line
Count
Source
364
5.11k
    Status prepare(RuntimeState* state) override { return Status::OK(); }
365
    Status open(RuntimeState* state) override;
366
367
    virtual std::string name_suffix() const;
368
369
    Status close(RuntimeState* state) override;
370
    Status terminate(RuntimeState* state) override;
371
372
    [[nodiscard]] std::string debug_string(int indentation_level = 0) const override;
373
374
25.1M
    std::vector<Dependency*> dependencies() const override {
375
25.1M
        return _dependency ? std::vector<Dependency*> {_dependency} : std::vector<Dependency*> {};
376
25.1M
    }
_ZNK5doris19PipelineXLocalStateINS_15FakeSharedStateEE12dependenciesEv
Line
Count
Source
374
426k
    std::vector<Dependency*> dependencies() const override {
375
426k
        return _dependency ? std::vector<Dependency*> {_dependency} : std::vector<Dependency*> {};
376
426k
    }
_ZNK5doris19PipelineXLocalStateINS_14SetSharedStateEE12dependenciesEv
Line
Count
Source
374
5.15k
    std::vector<Dependency*> dependencies() const override {
375
5.15k
        return _dependency ? std::vector<Dependency*> {_dependency} : std::vector<Dependency*> {};
376
5.15k
    }
_ZNK5doris19PipelineXLocalStateINS_15SortSharedStateEE12dependenciesEv
Line
Count
Source
374
228k
    std::vector<Dependency*> dependencies() const override {
375
18.4E
        return _dependency ? std::vector<Dependency*> {_dependency} : std::vector<Dependency*> {};
376
228k
    }
_ZNK5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE12dependenciesEv
Line
Count
Source
374
749k
    std::vector<Dependency*> dependencies() const override {
375
18.4E
        return _dependency ? std::vector<Dependency*> {_dependency} : std::vector<Dependency*> {};
376
749k
    }
_ZNK5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE12dependenciesEv
Line
Count
Source
374
14
    std::vector<Dependency*> dependencies() const override {
375
14
        return _dependency ? std::vector<Dependency*> {_dependency} : std::vector<Dependency*> {};
376
14
    }
_ZNK5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE12dependenciesEv
Line
Count
Source
374
23.4M
    std::vector<Dependency*> dependencies() const override {
375
23.4M
        return _dependency ? std::vector<Dependency*> {_dependency} : std::vector<Dependency*> {};
376
23.4M
    }
_ZNK5doris19PipelineXLocalStateINS_16UnionSharedStateEE12dependenciesEv
Line
Count
Source
374
56.5k
    std::vector<Dependency*> dependencies() const override {
375
56.5k
        return _dependency ? std::vector<Dependency*> {_dependency} : std::vector<Dependency*> {};
376
56.5k
    }
_ZNK5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE12dependenciesEv
Line
Count
Source
374
46.2k
    std::vector<Dependency*> dependencies() const override {
375
18.4E
        return _dependency ? std::vector<Dependency*> {_dependency} : std::vector<Dependency*> {};
376
46.2k
    }
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE12dependenciesEv
_ZNK5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE12dependenciesEv
Line
Count
Source
374
26
    std::vector<Dependency*> dependencies() const override {
375
26
        return _dependency ? std::vector<Dependency*> {_dependency} : std::vector<Dependency*> {};
376
26
    }
_ZNK5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE12dependenciesEv
Line
Count
Source
374
9.42k
    std::vector<Dependency*> dependencies() const override {
375
9.42k
        return _dependency ? std::vector<Dependency*> {_dependency} : std::vector<Dependency*> {};
376
9.42k
    }
_ZNK5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE12dependenciesEv
Line
Count
Source
374
6.76k
    std::vector<Dependency*> dependencies() const override {
375
18.4E
        return _dependency ? std::vector<Dependency*> {_dependency} : std::vector<Dependency*> {};
376
6.76k
    }
_ZNK5doris19PipelineXLocalStateINS_14AggSharedStateEE12dependenciesEv
Line
Count
Source
374
167k
    std::vector<Dependency*> dependencies() const override {
375
18.4E
        return _dependency ? std::vector<Dependency*> {_dependency} : std::vector<Dependency*> {};
376
167k
    }
_ZNK5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE12dependenciesEv
Line
Count
Source
374
432
    std::vector<Dependency*> dependencies() const override {
375
432
        return _dependency ? std::vector<Dependency*> {_dependency} : std::vector<Dependency*> {};
376
432
    }
_ZNK5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE12dependenciesEv
Line
Count
Source
374
216
    std::vector<Dependency*> dependencies() const override {
375
216
        return _dependency ? std::vector<Dependency*> {_dependency} : std::vector<Dependency*> {};
376
216
    }
_ZNK5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE12dependenciesEv
Line
Count
Source
374
9.99k
    std::vector<Dependency*> dependencies() const override {
375
18.4E
        return _dependency ? std::vector<Dependency*> {_dependency} : std::vector<Dependency*> {};
376
9.99k
    }
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_16BasicSharedStateEE12dependenciesEv
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_17RecCTESharedStateEE12dependenciesEv
377
378
2.44M
    virtual bool must_set_shared_state() const {
379
2.44M
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
380
2.44M
    }
_ZNK5doris19PipelineXLocalStateINS_15FakeSharedStateEE21must_set_shared_stateEv
Line
Count
Source
378
1.16M
    virtual bool must_set_shared_state() const {
379
1.16M
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
380
1.16M
    }
_ZNK5doris19PipelineXLocalStateINS_14SetSharedStateEE21must_set_shared_stateEv
Line
Count
Source
378
4.38k
    virtual bool must_set_shared_state() const {
379
4.38k
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
380
4.38k
    }
_ZNK5doris19PipelineXLocalStateINS_15SortSharedStateEE21must_set_shared_stateEv
Line
Count
Source
378
268k
    virtual bool must_set_shared_state() const {
379
268k
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
380
268k
    }
_ZNK5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE21must_set_shared_stateEv
Line
Count
Source
378
750k
    virtual bool must_set_shared_state() const {
379
750k
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
380
750k
    }
_ZNK5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE21must_set_shared_stateEv
Line
Count
Source
378
26
    virtual bool must_set_shared_state() const {
379
26
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
380
26
    }
_ZNK5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE21must_set_shared_stateEv
Line
Count
Source
378
403
    virtual bool must_set_shared_state() const {
379
403
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
380
403
    }
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_16UnionSharedStateEE21must_set_shared_stateEv
_ZNK5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE21must_set_shared_stateEv
Line
Count
Source
378
69.5k
    virtual bool must_set_shared_state() const {
379
69.5k
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
380
69.5k
    }
_ZNK5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE21must_set_shared_stateEv
Line
Count
Source
378
1
    virtual bool must_set_shared_state() const {
379
1
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
380
1
    }
_ZNK5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE21must_set_shared_stateEv
Line
Count
Source
378
35
    virtual bool must_set_shared_state() const {
379
35
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
380
35
    }
_ZNK5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE21must_set_shared_stateEv
Line
Count
Source
378
9.39k
    virtual bool must_set_shared_state() const {
379
9.39k
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
380
9.39k
    }
_ZNK5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE21must_set_shared_stateEv
Line
Count
Source
378
6.64k
    virtual bool must_set_shared_state() const {
379
6.64k
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
380
6.64k
    }
_ZNK5doris19PipelineXLocalStateINS_14AggSharedStateEE21must_set_shared_stateEv
Line
Count
Source
378
166k
    virtual bool must_set_shared_state() const {
379
166k
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
380
166k
    }
_ZNK5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE21must_set_shared_stateEv
Line
Count
Source
378
426
    virtual bool must_set_shared_state() const {
379
426
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
380
426
    }
_ZNK5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE21must_set_shared_stateEv
Line
Count
Source
378
224
    virtual bool must_set_shared_state() const {
379
224
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
380
224
    }
_ZNK5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE21must_set_shared_stateEv
Line
Count
Source
378
10.0k
    virtual bool must_set_shared_state() const {
379
10.0k
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
380
10.0k
    }
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_16BasicSharedStateEE21must_set_shared_stateEv
_ZNK5doris19PipelineXLocalStateINS_17RecCTESharedStateEE21must_set_shared_stateEv
Line
Count
Source
378
164
    virtual bool must_set_shared_state() const {
379
164
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
380
164
    }
381
382
protected:
383
    Dependency* _dependency = nullptr;
384
    SharedStateArg* _shared_state = nullptr;
385
};
386
387
template <typename SharedStateArg>
388
class PipelineXSpillLocalState : public PipelineXLocalState<SharedStateArg> {
389
public:
390
    using Base = PipelineXLocalState<SharedStateArg>;
391
    PipelineXSpillLocalState(RuntimeState* state, OperatorXBase* parent)
392
10.3k
            : PipelineXLocalState<SharedStateArg>(state, parent) {}
_ZN5doris24PipelineXSpillLocalStateINS_30PartitionedHashJoinSharedStateEEC2EPNS_12RuntimeStateEPNS_13OperatorXBaseE
Line
Count
Source
392
42
            : PipelineXLocalState<SharedStateArg>(state, parent) {}
_ZN5doris24PipelineXSpillLocalStateINS_20SpillSortSharedStateEEC2EPNS_12RuntimeStateEPNS_13OperatorXBaseE
Line
Count
Source
392
37
            : PipelineXLocalState<SharedStateArg>(state, parent) {}
_ZN5doris24PipelineXSpillLocalStateINS_25PartitionedAggSharedStateEEC2EPNS_12RuntimeStateEPNS_13OperatorXBaseE
Line
Count
Source
392
238
            : PipelineXLocalState<SharedStateArg>(state, parent) {}
_ZN5doris24PipelineXSpillLocalStateINS_20MultiCastSharedStateEEC2EPNS_12RuntimeStateEPNS_13OperatorXBaseE
Line
Count
Source
392
10.0k
            : PipelineXLocalState<SharedStateArg>(state, parent) {}
393
    ~PipelineXSpillLocalState() override = default;
394
395
10.2k
    Status init(RuntimeState* state, LocalStateInfo& info) override {
396
10.2k
        RETURN_IF_ERROR(PipelineXLocalState<SharedStateArg>::init(state, info));
397
398
10.2k
        init_spill_read_counters();
399
400
10.2k
        return Status::OK();
401
10.2k
    }
_ZN5doris24PipelineXSpillLocalStateINS_20SpillSortSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
395
34
    Status init(RuntimeState* state, LocalStateInfo& info) override {
396
34
        RETURN_IF_ERROR(PipelineXLocalState<SharedStateArg>::init(state, info));
397
398
34
        init_spill_read_counters();
399
400
34
        return Status::OK();
401
34
    }
_ZN5doris24PipelineXSpillLocalStateINS_25PartitionedAggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
395
225
    Status init(RuntimeState* state, LocalStateInfo& info) override {
396
225
        RETURN_IF_ERROR(PipelineXLocalState<SharedStateArg>::init(state, info));
397
398
225
        init_spill_read_counters();
399
400
225
        return Status::OK();
401
225
    }
_ZN5doris24PipelineXSpillLocalStateINS_20MultiCastSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
395
10.0k
    Status init(RuntimeState* state, LocalStateInfo& info) override {
396
10.0k
        RETURN_IF_ERROR(PipelineXLocalState<SharedStateArg>::init(state, info));
397
398
10.0k
        init_spill_read_counters();
399
400
10.0k
        return Status::OK();
401
10.0k
    }
_ZN5doris24PipelineXSpillLocalStateINS_30PartitionedHashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
395
1
    Status init(RuntimeState* state, LocalStateInfo& info) override {
396
1
        RETURN_IF_ERROR(PipelineXLocalState<SharedStateArg>::init(state, info));
397
398
1
        init_spill_read_counters();
399
400
1
        return Status::OK();
401
1
    }
402
403
312
    void init_spill_write_counters() {
404
312
        _write_counters.init(Base::custom_profile());
405
406
        // Source-only extra write counters
407
312
        _spill_write_file_total_size = ADD_COUNTER_WITH_LEVEL(
408
312
                Base::custom_profile(), profile::SPILL_WRITE_FILE_BYTES, TUnit::BYTES, 1);
409
312
        _spill_file_total_count = ADD_COUNTER_WITH_LEVEL(
410
312
                Base::custom_profile(), profile::SPILL_WRITE_FILE_TOTAL_COUNT, TUnit::UNIT, 1);
411
312
    }
_ZN5doris24PipelineXSpillLocalStateINS_30PartitionedHashJoinSharedStateEE25init_spill_write_countersEv
Line
Count
Source
403
42
    void init_spill_write_counters() {
404
42
        _write_counters.init(Base::custom_profile());
405
406
        // Source-only extra write counters
407
42
        _spill_write_file_total_size = ADD_COUNTER_WITH_LEVEL(
408
42
                Base::custom_profile(), profile::SPILL_WRITE_FILE_BYTES, TUnit::BYTES, 1);
409
42
        _spill_file_total_count = ADD_COUNTER_WITH_LEVEL(
410
42
                Base::custom_profile(), profile::SPILL_WRITE_FILE_TOTAL_COUNT, TUnit::UNIT, 1);
411
42
    }
_ZN5doris24PipelineXSpillLocalStateINS_20SpillSortSharedStateEE25init_spill_write_countersEv
Line
Count
Source
403
33
    void init_spill_write_counters() {
404
33
        _write_counters.init(Base::custom_profile());
405
406
        // Source-only extra write counters
407
33
        _spill_write_file_total_size = ADD_COUNTER_WITH_LEVEL(
408
33
                Base::custom_profile(), profile::SPILL_WRITE_FILE_BYTES, TUnit::BYTES, 1);
409
33
        _spill_file_total_count = ADD_COUNTER_WITH_LEVEL(
410
33
                Base::custom_profile(), profile::SPILL_WRITE_FILE_TOTAL_COUNT, TUnit::UNIT, 1);
411
33
    }
_ZN5doris24PipelineXSpillLocalStateINS_25PartitionedAggSharedStateEE25init_spill_write_countersEv
Line
Count
Source
403
237
    void init_spill_write_counters() {
404
237
        _write_counters.init(Base::custom_profile());
405
406
        // Source-only extra write counters
407
237
        _spill_write_file_total_size = ADD_COUNTER_WITH_LEVEL(
408
237
                Base::custom_profile(), profile::SPILL_WRITE_FILE_BYTES, TUnit::BYTES, 1);
409
237
        _spill_file_total_count = ADD_COUNTER_WITH_LEVEL(
410
237
                Base::custom_profile(), profile::SPILL_WRITE_FILE_TOTAL_COUNT, TUnit::UNIT, 1);
411
237
    }
412
413
10.3k
    void init_spill_read_counters() {
414
10.3k
        _spill_total_timer =
415
10.3k
                ADD_TIMER_WITH_LEVEL(Base::custom_profile(), profile::SPILL_TOTAL_TIME, 1);
416
417
10.3k
        _read_counters.init(Base::custom_profile());
418
419
10.3k
        _spill_file_current_size = ADD_COUNTER_WITH_LEVEL(
420
10.3k
                Base::custom_profile(), profile::SPILL_WRITE_FILE_CURRENT_BYTES, TUnit::BYTES, 1);
421
10.3k
    }
_ZN5doris24PipelineXSpillLocalStateINS_20SpillSortSharedStateEE24init_spill_read_countersEv
Line
Count
Source
413
31
    void init_spill_read_counters() {
414
31
        _spill_total_timer =
415
31
                ADD_TIMER_WITH_LEVEL(Base::custom_profile(), profile::SPILL_TOTAL_TIME, 1);
416
417
31
        _read_counters.init(Base::custom_profile());
418
419
31
        _spill_file_current_size = ADD_COUNTER_WITH_LEVEL(
420
31
                Base::custom_profile(), profile::SPILL_WRITE_FILE_CURRENT_BYTES, TUnit::BYTES, 1);
421
31
    }
_ZN5doris24PipelineXSpillLocalStateINS_25PartitionedAggSharedStateEE24init_spill_read_countersEv
Line
Count
Source
413
237
    void init_spill_read_counters() {
414
237
        _spill_total_timer =
415
237
                ADD_TIMER_WITH_LEVEL(Base::custom_profile(), profile::SPILL_TOTAL_TIME, 1);
416
417
237
        _read_counters.init(Base::custom_profile());
418
419
237
        _spill_file_current_size = ADD_COUNTER_WITH_LEVEL(
420
237
                Base::custom_profile(), profile::SPILL_WRITE_FILE_CURRENT_BYTES, TUnit::BYTES, 1);
421
237
    }
_ZN5doris24PipelineXSpillLocalStateINS_20MultiCastSharedStateEE24init_spill_read_countersEv
Line
Count
Source
413
10.0k
    void init_spill_read_counters() {
414
10.0k
        _spill_total_timer =
415
10.0k
                ADD_TIMER_WITH_LEVEL(Base::custom_profile(), profile::SPILL_TOTAL_TIME, 1);
416
417
10.0k
        _read_counters.init(Base::custom_profile());
418
419
10.0k
        _spill_file_current_size = ADD_COUNTER_WITH_LEVEL(
420
10.0k
                Base::custom_profile(), profile::SPILL_WRITE_FILE_CURRENT_BYTES, TUnit::BYTES, 1);
421
10.0k
    }
_ZN5doris24PipelineXSpillLocalStateINS_30PartitionedHashJoinSharedStateEE24init_spill_read_countersEv
Line
Count
Source
413
42
    void init_spill_read_counters() {
414
42
        _spill_total_timer =
415
42
                ADD_TIMER_WITH_LEVEL(Base::custom_profile(), profile::SPILL_TOTAL_TIME, 1);
416
417
42
        _read_counters.init(Base::custom_profile());
418
419
42
        _spill_file_current_size = ADD_COUNTER_WITH_LEVEL(
420
42
                Base::custom_profile(), profile::SPILL_WRITE_FILE_CURRENT_BYTES, TUnit::BYTES, 1);
421
42
    }
422
423
    // Total time of spill, including spill task scheduling time,
424
    // serialize block time, write disk file time,
425
    // and read disk file time, deserialize block time etc.
426
    RuntimeProfile::Counter* _spill_total_timer = nullptr;
427
428
    // Shared spill write counters
429
    SpillWriteCounters _write_counters;
430
    // Backward-compatible aliases for commonly accessed write counters
431
    RuntimeProfile::Counter*& _spill_write_file_timer = _write_counters.spill_write_file_timer;
432
    RuntimeProfile::Counter*& _spill_write_serialize_block_timer =
433
            _write_counters.spill_write_serialize_block_timer;
434
    RuntimeProfile::Counter*& _spill_write_block_count = _write_counters.spill_write_block_count;
435
    RuntimeProfile::Counter*& _spill_write_block_data_size =
436
            _write_counters.spill_write_block_data_size;
437
    RuntimeProfile::Counter*& _spill_write_rows_count = _write_counters.spill_write_rows_count;
438
439
    // Source-only write counters (not in SpillWriteCounters)
440
    // Total bytes of spill data written to disk file(after serialized)
441
    RuntimeProfile::Counter* _spill_write_file_total_size = nullptr;
442
    RuntimeProfile::Counter* _spill_file_total_count = nullptr;
443
    // Current spilled file size
444
    RuntimeProfile::Counter* _spill_file_current_size = nullptr;
445
446
    // Shared spill read counters
447
    SpillReadCounters _read_counters;
448
    // Backward-compatible aliases for commonly accessed read counters
449
    RuntimeProfile::Counter*& _spill_read_file_time = _read_counters.spill_read_file_time;
450
    RuntimeProfile::Counter*& _spill_read_deserialize_block_timer =
451
            _read_counters.spill_read_deserialize_block_timer;
452
    RuntimeProfile::Counter*& _spill_read_block_count = _read_counters.spill_read_block_count;
453
    RuntimeProfile::Counter*& _spill_read_block_data_size =
454
            _read_counters.spill_read_block_data_size;
455
    RuntimeProfile::Counter*& _spill_read_file_size = _read_counters.spill_read_file_size;
456
    RuntimeProfile::Counter*& _spill_read_rows_count = _read_counters.spill_read_rows_count;
457
    RuntimeProfile::Counter*& _spill_read_file_count = _read_counters.spill_read_file_count;
458
};
459
460
class DataSinkOperatorXBase;
461
462
class PipelineXSinkLocalStateBase {
463
public:
464
    PipelineXSinkLocalStateBase(DataSinkOperatorXBase* parent_, RuntimeState* state_);
465
2.11M
    virtual ~PipelineXSinkLocalStateBase() = default;
466
467
    // Do initialization. This step should be executed only once and in bthread, so we can do some
468
    // lightweight or non-idempotent operations (e.g. init profile, clone expr ctx from operatorX)
469
    virtual Status init(RuntimeState* state, LocalSinkStateInfo& info) = 0;
470
471
    virtual Status prepare(RuntimeState* state) = 0;
472
    // Do initialization. This step can be executed multiple times, so we should make sure it is
473
    // idempotent (e.g. wait for runtime filters).
474
    virtual Status open(RuntimeState* state) = 0;
475
    virtual Status terminate(RuntimeState* state) = 0;
476
    virtual Status close(RuntimeState* state, Status exec_status) = 0;
477
4.94M
    [[nodiscard]] virtual bool is_finished() const { return false; }
478
15.4M
    [[nodiscard]] virtual bool is_blockable() const { return false; }
479
480
    [[nodiscard]] virtual std::string debug_string(int indentation_level) const = 0;
481
482
    template <class TARGET>
483
3.80M
    TARGET& cast() {
484
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
485
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
486
18.4E
                << " and expect type is" << typeid(TARGET).name();
487
3.80M
        return reinterpret_cast<TARGET&>(*this);
488
3.80M
    }
_ZN5doris27PipelineXSinkLocalStateBase4castINS_22ExchangeSinkLocalStateEEERT_v
Line
Count
Source
483
926k
    TARGET& cast() {
484
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
485
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
486
18.4E
                << " and expect type is" << typeid(TARGET).name();
487
926k
        return reinterpret_cast<TARGET&>(*this);
488
926k
    }
_ZN5doris27PipelineXSinkLocalStateBase4castINS_19UnionSinkLocalStateEEERT_v
Line
Count
Source
483
11.9k
    TARGET& cast() {
484
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
485
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
486
18.4E
                << " and expect type is" << typeid(TARGET).name();
487
11.9k
        return reinterpret_cast<TARGET&>(*this);
488
11.9k
    }
_ZN5doris27PipelineXSinkLocalStateBase4castINS_25OlapTableSinkV2LocalStateEEERT_v
Line
Count
Source
483
11.0k
    TARGET& cast() {
484
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
485
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
486
18.4E
                << " and expect type is" << typeid(TARGET).name();
487
11.0k
        return reinterpret_cast<TARGET&>(*this);
488
11.0k
    }
_ZN5doris27PipelineXSinkLocalStateBase4castINS_23OlapTableSinkLocalStateEEERT_v
Line
Count
Source
483
63.7k
    TARGET& cast() {
484
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
485
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
486
18.4E
                << " and expect type is" << typeid(TARGET).name();
487
63.7k
        return reinterpret_cast<TARGET&>(*this);
488
63.7k
    }
_ZN5doris27PipelineXSinkLocalStateBase4castINS_23HiveTableSinkLocalStateEEERT_v
Line
Count
Source
483
7.65k
    TARGET& cast() {
484
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
485
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
486
18.4E
                << " and expect type is" << typeid(TARGET).name();
487
7.65k
        return reinterpret_cast<TARGET&>(*this);
488
7.65k
    }
_ZN5doris27PipelineXSinkLocalStateBase4castINS_26IcebergTableSinkLocalStateEEERT_v
Line
Count
Source
483
6.57k
    TARGET& cast() {
484
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
485
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
486
18.4E
                << " and expect type is" << typeid(TARGET).name();
487
6.57k
        return reinterpret_cast<TARGET&>(*this);
488
6.57k
    }
_ZN5doris27PipelineXSinkLocalStateBase4castINS_27IcebergDeleteSinkLocalStateEEERT_v
Line
Count
Source
483
790
    TARGET& cast() {
484
790
        DCHECK(dynamic_cast<TARGET*>(this))
485
0
                << " Mismatch type! Current type is " << typeid(*this).name()
486
0
                << " and expect type is" << typeid(TARGET).name();
487
790
        return reinterpret_cast<TARGET&>(*this);
488
790
    }
_ZN5doris27PipelineXSinkLocalStateBase4castINS_26IcebergMergeSinkLocalStateEEERT_v
Line
Count
Source
483
2.14k
    TARGET& cast() {
484
2.14k
        DCHECK(dynamic_cast<TARGET*>(this))
485
0
                << " Mismatch type! Current type is " << typeid(*this).name()
486
0
                << " and expect type is" << typeid(TARGET).name();
487
2.14k
        return reinterpret_cast<TARGET&>(*this);
488
2.14k
    }
Unexecuted instantiation: _ZN5doris27PipelineXSinkLocalStateBase4castINS_21MCTableSinkLocalStateEEERT_v
_ZN5doris27PipelineXSinkLocalStateBase4castINS_22TVFTableSinkLocalStateEEERT_v
Line
Count
Source
483
310
    TARGET& cast() {
484
310
        DCHECK(dynamic_cast<TARGET*>(this))
485
0
                << " Mismatch type! Current type is " << typeid(*this).name()
486
0
                << " and expect type is" << typeid(TARGET).name();
487
310
        return reinterpret_cast<TARGET&>(*this);
488
310
    }
_ZN5doris27PipelineXSinkLocalStateBase4castINS_27LocalExchangeSinkLocalStateEEERT_v
Line
Count
Source
483
456k
    TARGET& cast() {
484
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
485
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
486
18.4E
                << " and expect type is" << typeid(TARGET).name();
487
456k
        return reinterpret_cast<TARGET&>(*this);
488
456k
    }
_ZN5doris27PipelineXSinkLocalStateBase4castINS_17AggSinkLocalStateEEERT_v
Line
Count
Source
483
671k
    TARGET& cast() {
484
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
485
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
486
18.4E
                << " and expect type is" << typeid(TARGET).name();
487
671k
        return reinterpret_cast<TARGET&>(*this);
488
671k
    }
_ZN5doris27PipelineXSinkLocalStateBase4castINS_27HashJoinBuildSinkLocalStateEEERT_v
Line
Count
Source
483
576k
    TARGET& cast() {
484
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
485
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
486
18.4E
                << " and expect type is" << typeid(TARGET).name();
487
576k
        return reinterpret_cast<TARGET&>(*this);
488
576k
    }
_ZN5doris27PipelineXSinkLocalStateBase4castINS_26RecCTEAnchorSinkLocalStateEEERT_v
Line
Count
Source
483
512
    TARGET& cast() {
484
512
        DCHECK(dynamic_cast<TARGET*>(this))
485
0
                << " Mismatch type! Current type is " << typeid(*this).name()
486
0
                << " and expect type is" << typeid(TARGET).name();
487
512
        return reinterpret_cast<TARGET&>(*this);
488
512
    }
_ZN5doris27PipelineXSinkLocalStateBase4castINS_20RecCTESinkLocalStateEEERT_v
Line
Count
Source
483
7.15k
    TARGET& cast() {
484
7.15k
        DCHECK(dynamic_cast<TARGET*>(this))
485
0
                << " Mismatch type! Current type is " << typeid(*this).name()
486
0
                << " and expect type is" << typeid(TARGET).name();
487
7.15k
        return reinterpret_cast<TARGET&>(*this);
488
7.15k
    }
_ZN5doris27PipelineXSinkLocalStateBase4castINS_20ResultSinkLocalStateEEERT_v
Line
Count
Source
483
530k
    TARGET& cast() {
484
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
485
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
486
18.4E
                << " and expect type is" << typeid(TARGET).name();
487
530k
        return reinterpret_cast<TARGET&>(*this);
488
530k
    }
_ZN5doris27PipelineXSinkLocalStateBase4castINS_23JdbcTableSinkLocalStateEEERT_v
Line
Count
Source
483
110
    TARGET& cast() {
484
110
        DCHECK(dynamic_cast<TARGET*>(this))
485
0
                << " Mismatch type! Current type is " << typeid(*this).name()
486
0
                << " and expect type is" << typeid(TARGET).name();
487
110
        return reinterpret_cast<TARGET&>(*this);
488
110
    }
_ZN5doris27PipelineXSinkLocalStateBase4castINS_27MemoryScratchSinkLocalStateEEERT_v
Line
Count
Source
483
6
    TARGET& cast() {
484
6
        DCHECK(dynamic_cast<TARGET*>(this))
485
0
                << " Mismatch type! Current type is " << typeid(*this).name()
486
0
                << " and expect type is" << typeid(TARGET).name();
487
6
        return reinterpret_cast<TARGET&>(*this);
488
6
    }
_ZN5doris27PipelineXSinkLocalStateBase4castINS_24ResultFileSinkLocalStateEEERT_v
Line
Count
Source
483
2.57k
    TARGET& cast() {
484
2.57k
        DCHECK(dynamic_cast<TARGET*>(this))
485
0
                << " Mismatch type! Current type is " << typeid(*this).name()
486
0
                << " and expect type is" << typeid(TARGET).name();
487
2.57k
        return reinterpret_cast<TARGET&>(*this);
488
2.57k
    }
_ZN5doris27PipelineXSinkLocalStateBase4castINS_31SpillIcebergTableSinkLocalStateEEERT_v
Line
Count
Source
483
120
    TARGET& cast() {
484
120
        DCHECK(dynamic_cast<TARGET*>(this))
485
0
                << " Mismatch type! Current type is " << typeid(*this).name()
486
0
                << " and expect type is" << typeid(TARGET).name();
487
120
        return reinterpret_cast<TARGET&>(*this);
488
120
    }
_ZN5doris27PipelineXSinkLocalStateBase4castINS_22AnalyticSinkLocalStateEEERT_v
Line
Count
Source
483
24.6k
    TARGET& cast() {
484
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
485
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
486
18.4E
                << " and expect type is" << typeid(TARGET).name();
487
24.6k
        return reinterpret_cast<TARGET&>(*this);
488
24.6k
    }
_ZN5doris27PipelineXSinkLocalStateBase4castINS_23BlackholeSinkLocalStateEEERT_v
Line
Count
Source
483
14.9k
    TARGET& cast() {
484
14.9k
        DCHECK(dynamic_cast<TARGET*>(this))
485
0
                << " Mismatch type! Current type is " << typeid(*this).name()
486
0
                << " and expect type is" << typeid(TARGET).name();
487
14.9k
        return reinterpret_cast<TARGET&>(*this);
488
14.9k
    }
_ZN5doris27PipelineXSinkLocalStateBase4castINS_18SortSinkLocalStateEEERT_v
Line
Count
Source
483
421k
    TARGET& cast() {
484
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
485
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
486
18.4E
                << " and expect type is" << typeid(TARGET).name();
487
421k
        return reinterpret_cast<TARGET&>(*this);
488
421k
    }
_ZN5doris27PipelineXSinkLocalStateBase4castINS_23SpillSortSinkLocalStateEEERT_v
Line
Count
Source
483
1.71k
    TARGET& cast() {
484
1.71k
        DCHECK(dynamic_cast<TARGET*>(this))
485
0
                << " Mismatch type! Current type is " << typeid(*this).name()
486
0
                << " and expect type is" << typeid(TARGET).name();
487
1.71k
        return reinterpret_cast<TARGET&>(*this);
488
1.71k
    }
_ZN5doris27PipelineXSinkLocalStateBase4castINS_25BucketedAggSinkLocalStateEEERT_v
Line
Count
Source
483
2.59k
    TARGET& cast() {
484
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
485
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
486
18.4E
                << " and expect type is" << typeid(TARGET).name();
487
2.59k
        return reinterpret_cast<TARGET&>(*this);
488
2.59k
    }
_ZN5doris27PipelineXSinkLocalStateBase4castINS_28PartitionedAggSinkLocalStateEEERT_v
Line
Count
Source
483
3.91k
    TARGET& cast() {
484
3.91k
        DCHECK(dynamic_cast<TARGET*>(this))
485
0
                << " Mismatch type! Current type is " << typeid(*this).name()
486
0
                << " and expect type is" << typeid(TARGET).name();
487
3.91k
        return reinterpret_cast<TARGET&>(*this);
488
3.91k
    }
_ZN5doris27PipelineXSinkLocalStateBase4castINS_33NestedLoopJoinBuildSinkLocalStateEEERT_v
Line
Count
Source
483
23.3k
    TARGET& cast() {
484
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
485
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
486
18.4E
                << " and expect type is" << typeid(TARGET).name();
487
23.3k
        return reinterpret_cast<TARGET&>(*this);
488
23.3k
    }
_ZN5doris27PipelineXSinkLocalStateBase4castINS_33MultiCastDataStreamSinkLocalStateEEERT_v
Line
Count
Source
483
13.7k
    TARGET& cast() {
484
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
485
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
486
18.4E
                << " and expect type is" << typeid(TARGET).name();
487
13.7k
        return reinterpret_cast<TARGET&>(*this);
488
13.7k
    }
_ZN5doris27PipelineXSinkLocalStateBase4castINS_27PartitionSortSinkLocalStateEEERT_v
Line
Count
Source
483
1.40k
    TARGET& cast() {
484
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
485
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
486
18.4E
                << " and expect type is" << typeid(TARGET).name();
487
1.40k
        return reinterpret_cast<TARGET&>(*this);
488
1.40k
    }
_ZN5doris27PipelineXSinkLocalStateBase4castINS_22SetProbeSinkLocalStateILb1EEEEERT_v
Line
Count
Source
483
7.36k
    TARGET& cast() {
484
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
485
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
486
18.4E
                << " and expect type is" << typeid(TARGET).name();
487
7.36k
        return reinterpret_cast<TARGET&>(*this);
488
7.36k
    }
_ZN5doris27PipelineXSinkLocalStateBase4castINS_22SetProbeSinkLocalStateILb0EEEEERT_v
Line
Count
Source
483
3.67k
    TARGET& cast() {
484
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
485
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
486
18.4E
                << " and expect type is" << typeid(TARGET).name();
487
3.67k
        return reinterpret_cast<TARGET&>(*this);
488
3.67k
    }
_ZN5doris27PipelineXSinkLocalStateBase4castINS_17SetSinkLocalStateILb1EEEEERT_v
Line
Count
Source
483
5.46k
    TARGET& cast() {
484
5.46k
        DCHECK(dynamic_cast<TARGET*>(this))
485
0
                << " Mismatch type! Current type is " << typeid(*this).name()
486
0
                << " and expect type is" << typeid(TARGET).name();
487
5.46k
        return reinterpret_cast<TARGET&>(*this);
488
5.46k
    }
_ZN5doris27PipelineXSinkLocalStateBase4castINS_17SetSinkLocalStateILb0EEEEERT_v
Line
Count
Source
483
3.74k
    TARGET& cast() {
484
3.74k
        DCHECK(dynamic_cast<TARGET*>(this))
485
0
                << " Mismatch type! Current type is " << typeid(*this).name()
486
0
                << " and expect type is" << typeid(TARGET).name();
487
3.74k
        return reinterpret_cast<TARGET&>(*this);
488
3.74k
    }
_ZN5doris27PipelineXSinkLocalStateBase4castINS_33PartitionedHashJoinSinkLocalStateEEERT_v
Line
Count
Source
483
9
    TARGET& cast() {
484
9
        DCHECK(dynamic_cast<TARGET*>(this))
485
0
                << " Mismatch type! Current type is " << typeid(*this).name()
486
0
                << " and expect type is" << typeid(TARGET).name();
487
9
        return reinterpret_cast<TARGET&>(*this);
488
9
    }
_ZN5doris27PipelineXSinkLocalStateBase4castINS_30GroupCommitBlockSinkLocalStateEEERT_v
Line
Count
Source
483
1.46k
    TARGET& cast() {
484
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
485
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
486
18.4E
                << " and expect type is" << typeid(TARGET).name();
487
1.46k
        return reinterpret_cast<TARGET&>(*this);
488
1.46k
    }
_ZN5doris27PipelineXSinkLocalStateBase4castINS_19CacheSinkLocalStateEEERT_v
Line
Count
Source
483
25
    TARGET& cast() {
484
25
        DCHECK(dynamic_cast<TARGET*>(this))
485
0
                << " Mismatch type! Current type is " << typeid(*this).name()
486
0
                << " and expect type is" << typeid(TARGET).name();
487
25
        return reinterpret_cast<TARGET&>(*this);
488
25
    }
_ZN5doris27PipelineXSinkLocalStateBase4castINS_18DictSinkLocalStateEEERT_v
Line
Count
Source
483
266
    TARGET& cast() {
484
266
        DCHECK(dynamic_cast<TARGET*>(this))
485
0
                << " Mismatch type! Current type is " << typeid(*this).name()
486
0
                << " and expect type is" << typeid(TARGET).name();
487
266
        return reinterpret_cast<TARGET&>(*this);
488
266
    }
489
    template <class TARGET>
490
    const TARGET& cast() const {
491
        DCHECK(dynamic_cast<const TARGET*>(this))
492
                << " Mismatch type! Current type is " << typeid(*this).name()
493
                << " and expect type is" << typeid(TARGET).name();
494
        return reinterpret_cast<const TARGET&>(*this);
495
    }
496
497
112k
    DataSinkOperatorXBase* parent() { return _parent; }
498
5.67M
    RuntimeState* state() { return _state; }
499
2.10M
    RuntimeProfile* operator_profile() { return _operator_profile; }
500
4.12M
    RuntimeProfile* common_profile() { return _common_profile; }
501
18.2M
    RuntimeProfile* custom_profile() { return _custom_profile; }
502
503
12.5k
    [[nodiscard]] RuntimeProfile* faker_runtime_profile() const {
504
12.5k
        return _faker_runtime_profile.get();
505
12.5k
    }
506
507
3.08M
    RuntimeProfile::Counter* rows_input_counter() { return _rows_input_counter; }
508
8.78M
    RuntimeProfile::Counter* exec_time_counter() { return _exec_timer; }
509
2.66M
    RuntimeProfile::Counter* memory_used_counter() { return _memory_used_counter; }
510
511
0
    virtual std::vector<Dependency*> dependencies() const { return {nullptr}; }
512
513
    // override in exchange sink , AsyncWriterSink
514
1.20M
    virtual Dependency* finishdependency() { return nullptr; }
515
516
940k
    bool low_memory_mode() { return _state->low_memory_mode(); }
517
518
protected:
519
    DataSinkOperatorXBase* _parent = nullptr;
520
    RuntimeState* _state = nullptr;
521
    RuntimeProfile* _operator_profile = nullptr;
522
    RuntimeProfile* _common_profile = nullptr;
523
    RuntimeProfile* _custom_profile = nullptr;
524
    // Set to true after close() has been called. subclasses should check and set this in
525
    // close().
526
    bool _closed = false;
527
    bool _terminated = false;
528
    //NOTICE: now add a faker profile, because sometimes the profile record is useless
529
    //so we want remove some counters and timers, eg: in join node, if it's broadcast_join
530
    //and shared hash table, some counter/timer about build hash table is useless,
531
    //so we could add those counter/timer in faker profile, and those will not display in web profile.
532
    std::unique_ptr<RuntimeProfile> _faker_runtime_profile =
533
            std::make_unique<RuntimeProfile>(profile::FAKER_PROFILE);
534
535
    RuntimeProfile::Counter* _rows_input_counter = nullptr;
536
    RuntimeProfile::Counter* _init_timer = nullptr;
537
    RuntimeProfile::Counter* _open_timer = nullptr;
538
    RuntimeProfile::Counter* _close_timer = nullptr;
539
    RuntimeProfile::Counter* _wait_for_dependency_timer = nullptr;
540
    RuntimeProfile::Counter* _wait_for_finish_dependency_timer = nullptr;
541
    RuntimeProfile::Counter* _exec_timer = nullptr;
542
    RuntimeProfile::HighWaterMarkCounter* _memory_used_counter = nullptr;
543
};
544
545
template <typename SharedStateArg = FakeSharedState>
546
class PipelineXSinkLocalState : public PipelineXSinkLocalStateBase {
547
public:
548
    using SharedStateType = SharedStateArg;
549
    PipelineXSinkLocalState(DataSinkOperatorXBase* parent, RuntimeState* state)
550
2.10M
            : PipelineXSinkLocalStateBase(parent, state) {}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Line
Count
Source
550
118k
            : PipelineXSinkLocalStateBase(parent, state) {}
_ZN5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Line
Count
Source
550
8
            : PipelineXSinkLocalStateBase(parent, state) {}
_ZN5doris23PipelineXSinkLocalStateINS_15SortSharedStateEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Line
Count
Source
550
275k
            : PipelineXSinkLocalStateBase(parent, state) {}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Line
Count
Source
550
45
            : PipelineXSinkLocalStateBase(parent, state) {}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Line
Count
Source
550
9.43k
            : PipelineXSinkLocalStateBase(parent, state) {}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Line
Count
Source
550
6.78k
            : PipelineXSinkLocalStateBase(parent, state) {}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Line
Count
Source
550
169k
            : PipelineXSinkLocalStateBase(parent, state) {}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Line
Count
Source
550
428
            : PipelineXSinkLocalStateBase(parent, state) {}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Line
Count
Source
550
237
            : PipelineXSinkLocalStateBase(parent, state) {}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Line
Count
Source
550
706k
            : PipelineXSinkLocalStateBase(parent, state) {}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Line
Count
Source
550
6.00k
            : PipelineXSinkLocalStateBase(parent, state) {}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Line
Count
Source
550
407
            : PipelineXSinkLocalStateBase(parent, state) {}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Line
Count
Source
550
3.55k
            : PipelineXSinkLocalStateBase(parent, state) {}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Line
Count
Source
550
12.4k
            : PipelineXSinkLocalStateBase(parent, state) {}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Line
Count
Source
550
290k
            : PipelineXSinkLocalStateBase(parent, state) {}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Line
Count
Source
550
506k
            : PipelineXSinkLocalStateBase(parent, state) {}
_ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Line
Count
Source
550
25
            : PipelineXSinkLocalStateBase(parent, state) {}
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Line
Count
Source
550
328
            : PipelineXSinkLocalStateBase(parent, state) {}
551
    ~PipelineXSinkLocalState() override = default;
552
553
    Status init(RuntimeState* state, LocalSinkStateInfo& info) override;
554
555
12.7M
    Status prepare(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE7prepareEPNS_12RuntimeStateE
Line
Count
Source
555
4.12M
    Status prepare(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE7prepareEPNS_12RuntimeStateE
Line
Count
Source
555
32.9k
    Status prepare(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE7prepareEPNS_12RuntimeStateE
Line
Count
Source
555
3.73M
    Status prepare(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE7prepareEPNS_12RuntimeStateE
Line
Count
Source
555
1.69M
    Status prepare(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE7prepareEPNS_12RuntimeStateE
Line
Count
Source
555
32.7k
    Status prepare(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE7prepareEPNS_12RuntimeStateE
Line
Count
Source
555
50
    Status prepare(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE7prepareEPNS_12RuntimeStateE
Line
Count
Source
555
41.6k
    Status prepare(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE7prepareEPNS_12RuntimeStateE
Line
Count
Source
555
1.91k
    Status prepare(RuntimeState* state) override { return Status::OK(); }
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE7prepareEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE7prepareEPNS_12RuntimeStateE
Line
Count
Source
555
5.86k
    Status prepare(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE7prepareEPNS_12RuntimeStateE
Line
Count
Source
555
1.60M
    Status prepare(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE7prepareEPNS_12RuntimeStateE
Line
Count
Source
555
271k
    Status prepare(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE7prepareEPNS_12RuntimeStateE
Line
Count
Source
555
615
    Status prepare(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE7prepareEPNS_12RuntimeStateE
Line
Count
Source
555
53.4k
    Status prepare(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE7prepareEPNS_12RuntimeStateE
Line
Count
Source
555
1.05M
    Status prepare(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE7prepareEPNS_12RuntimeStateE
Line
Count
Source
555
4.10k
    Status prepare(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE7prepareEPNS_12RuntimeStateE
Line
Count
Source
555
3.59k
    Status prepare(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE7prepareEPNS_12RuntimeStateE
Line
Count
Source
555
69.0k
    Status prepare(RuntimeState* state) override { return Status::OK(); }
556
2.11M
    Status open(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
556
710k
    Status open(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
556
6.01k
    Status open(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
556
291k
    Status open(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
556
6.77k
    Status open(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
556
25
    Status open(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
556
510k
    Status open(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
556
3.56k
    Status open(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
556
408
    Status open(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
556
2
    Status open(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
556
328
    Status open(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
556
275k
    Status open(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
556
118k
    Status open(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
556
43
    Status open(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
556
9.44k
    Status open(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
556
169k
    Status open(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
556
427
    Status open(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
556
236
    Status open(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
556
12.6k
    Status open(RuntimeState* state) override { return Status::OK(); }
557
558
    Status terminate(RuntimeState* state) override;
559
    Status close(RuntimeState* state, Status exec_status) override;
560
561
    [[nodiscard]] std::string debug_string(int indentation_level) const override;
562
563
    virtual std::string name_suffix();
564
565
1.25M
    std::vector<Dependency*> dependencies() const override {
566
1.25M
        return _dependency ? std::vector<Dependency*> {_dependency} : std::vector<Dependency*> {};
567
1.25M
    }
_ZNK5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE12dependenciesEv
Line
Count
Source
565
89
    std::vector<Dependency*> dependencies() const override {
566
89
        return _dependency ? std::vector<Dependency*> {_dependency} : std::vector<Dependency*> {};
567
89
    }
_ZNK5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE12dependenciesEv
Line
Count
Source
565
5.99k
    std::vector<Dependency*> dependencies() const override {
566
18.4E
        return _dependency ? std::vector<Dependency*> {_dependency} : std::vector<Dependency*> {};
567
5.99k
    }
_ZNK5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE12dependenciesEv
Line
Count
Source
565
290k
    std::vector<Dependency*> dependencies() const override {
566
18.4E
        return _dependency ? std::vector<Dependency*> {_dependency} : std::vector<Dependency*> {};
567
290k
    }
_ZNK5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE12dependenciesEv
Line
Count
Source
565
6.77k
    std::vector<Dependency*> dependencies() const override {
566
6.77k
        return _dependency ? std::vector<Dependency*> {_dependency} : std::vector<Dependency*> {};
567
6.77k
    }
_ZNK5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE12dependenciesEv
Line
Count
Source
565
14
    std::vector<Dependency*> dependencies() const override {
566
14
        return _dependency ? std::vector<Dependency*> {_dependency} : std::vector<Dependency*> {};
567
14
    }
_ZNK5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE12dependenciesEv
Line
Count
Source
565
438k
    std::vector<Dependency*> dependencies() const override {
566
438k
        return _dependency ? std::vector<Dependency*> {_dependency} : std::vector<Dependency*> {};
567
438k
    }
_ZNK5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE12dependenciesEv
Line
Count
Source
565
3.56k
    std::vector<Dependency*> dependencies() const override {
566
3.56k
        return _dependency ? std::vector<Dependency*> {_dependency} : std::vector<Dependency*> {};
567
3.56k
    }
_ZNK5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE12dependenciesEv
Line
Count
Source
565
306
    std::vector<Dependency*> dependencies() const override {
566
18.4E
        return _dependency ? std::vector<Dependency*> {_dependency} : std::vector<Dependency*> {};
567
306
    }
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE12dependenciesEv
_ZNK5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE12dependenciesEv
Line
Count
Source
565
328
    std::vector<Dependency*> dependencies() const override {
566
328
        return _dependency ? std::vector<Dependency*> {_dependency} : std::vector<Dependency*> {};
567
328
    }
_ZNK5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE12dependenciesEv
Line
Count
Source
565
271k
    std::vector<Dependency*> dependencies() const override {
566
18.4E
        return _dependency ? std::vector<Dependency*> {_dependency} : std::vector<Dependency*> {};
567
271k
    }
_ZNK5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE12dependenciesEv
Line
Count
Source
565
46.3k
    std::vector<Dependency*> dependencies() const override {
566
18.4E
        return _dependency ? std::vector<Dependency*> {_dependency} : std::vector<Dependency*> {};
567
46.3k
    }
_ZNK5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE12dependenciesEv
Line
Count
Source
565
26
    std::vector<Dependency*> dependencies() const override {
566
26
        return _dependency ? std::vector<Dependency*> {_dependency} : std::vector<Dependency*> {};
567
26
    }
_ZNK5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE12dependenciesEv
Line
Count
Source
565
9.42k
    std::vector<Dependency*> dependencies() const override {
566
18.4E
        return _dependency ? std::vector<Dependency*> {_dependency} : std::vector<Dependency*> {};
567
9.42k
    }
_ZNK5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE12dependenciesEv
Line
Count
Source
565
168k
    std::vector<Dependency*> dependencies() const override {
566
18.4E
        return _dependency ? std::vector<Dependency*> {_dependency} : std::vector<Dependency*> {};
567
168k
    }
_ZNK5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE12dependenciesEv
Line
Count
Source
565
425
    std::vector<Dependency*> dependencies() const override {
566
425
        return _dependency ? std::vector<Dependency*> {_dependency} : std::vector<Dependency*> {};
567
425
    }
_ZNK5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE12dependenciesEv
Line
Count
Source
565
216
    std::vector<Dependency*> dependencies() const override {
566
216
        return _dependency ? std::vector<Dependency*> {_dependency} : std::vector<Dependency*> {};
567
216
    }
_ZNK5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE12dependenciesEv
Line
Count
Source
565
12.6k
    std::vector<Dependency*> dependencies() const override {
566
18.4E
        return _dependency ? std::vector<Dependency*> {_dependency} : std::vector<Dependency*> {};
567
12.6k
    }
568
569
2.08M
    virtual bool must_set_shared_state() const {
570
2.08M
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
571
2.08M
    }
_ZNK5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE21must_set_shared_stateEv
Line
Count
Source
569
696k
    virtual bool must_set_shared_state() const {
570
696k
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
571
696k
    }
_ZNK5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE21must_set_shared_stateEv
Line
Count
Source
569
5.93k
    virtual bool must_set_shared_state() const {
570
5.93k
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
571
5.93k
    }
_ZNK5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE21must_set_shared_stateEv
Line
Count
Source
569
502k
    virtual bool must_set_shared_state() const {
570
502k
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
571
502k
    }
_ZNK5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE21must_set_shared_stateEv
Line
Count
Source
569
288k
    virtual bool must_set_shared_state() const {
570
288k
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
571
288k
    }
_ZNK5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE21must_set_shared_stateEv
Line
Count
Source
569
6.67k
    virtual bool must_set_shared_state() const {
570
6.67k
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
571
6.67k
    }
_ZNK5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE21must_set_shared_stateEv
Line
Count
Source
569
25
    virtual bool must_set_shared_state() const {
570
25
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
571
25
    }
_ZNK5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE21must_set_shared_stateEv
Line
Count
Source
569
3.54k
    virtual bool must_set_shared_state() const {
570
3.54k
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
571
3.54k
    }
_ZNK5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE21must_set_shared_stateEv
Line
Count
Source
569
403
    virtual bool must_set_shared_state() const {
570
403
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
571
403
    }
_ZNK5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE21must_set_shared_stateEv
Line
Count
Source
569
2
    virtual bool must_set_shared_state() const {
570
2
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
571
2
    }
_ZNK5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE21must_set_shared_stateEv
Line
Count
Source
569
328
    virtual bool must_set_shared_state() const {
570
328
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
571
328
    }
_ZNK5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE21must_set_shared_stateEv
Line
Count
Source
569
271k
    virtual bool must_set_shared_state() const {
570
271k
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
571
271k
    }
_ZNK5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE21must_set_shared_stateEv
Line
Count
Source
569
117k
    virtual bool must_set_shared_state() const {
570
117k
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
571
117k
    }
_ZNK5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE21must_set_shared_stateEv
Line
Count
Source
569
43
    virtual bool must_set_shared_state() const {
570
43
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
571
43
    }
_ZNK5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE21must_set_shared_stateEv
Line
Count
Source
569
9.39k
    virtual bool must_set_shared_state() const {
570
9.39k
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
571
9.39k
    }
_ZNK5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE21must_set_shared_stateEv
Line
Count
Source
569
167k
    virtual bool must_set_shared_state() const {
570
167k
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
571
167k
    }
_ZNK5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE21must_set_shared_stateEv
Line
Count
Source
569
424
    virtual bool must_set_shared_state() const {
570
424
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
571
424
    }
_ZNK5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE21must_set_shared_stateEv
Line
Count
Source
569
233
    virtual bool must_set_shared_state() const {
570
233
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
571
233
    }
_ZNK5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE21must_set_shared_stateEv
Line
Count
Source
569
12.0k
    virtual bool must_set_shared_state() const {
570
12.0k
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
571
12.0k
    }
572
573
protected:
574
    Dependency* _dependency = nullptr;
575
    SharedStateType* _shared_state = nullptr;
576
};
577
578
class DataSinkOperatorXBase : public OperatorBase {
579
public:
580
    DataSinkOperatorXBase(const int operator_id, const int node_id, const int dest_id)
581
481k
            : _operator_id(operator_id), _node_id(node_id), _dests_id({dest_id}) {}
582
    DataSinkOperatorXBase(const int operator_id, const TPlanNode& tnode, const int dest_id)
583
320k
            : OperatorBase(tnode.__isset.is_serial_operator && tnode.is_serial_operator),
584
320k
              _operator_id(operator_id),
585
320k
              _node_id(tnode.node_id),
586
320k
              _dests_id({dest_id}) {}
587
588
    DataSinkOperatorXBase(const int operator_id, const int node_id, std::vector<int>& dests)
589
2.69k
            : _operator_id(operator_id), _node_id(node_id), _dests_id(dests) {}
590
591
#ifdef BE_TEST
592
    DataSinkOperatorXBase() : _operator_id(-1), _node_id(0), _dests_id({-1}) {};
593
#endif
594
595
878k
    ~DataSinkOperatorXBase() override = default;
596
597
    // For agg/sort/join sink.
598
    virtual Status init(const TPlanNode& tnode, RuntimeState* state);
599
600
2.03M
    virtual bool reset_to_rerun(RuntimeState* state, OperatorXBase* root) const { return false; }
601
602
    Status init(const TDataSink& tsink) override;
603
    [[nodiscard]] virtual Status init(RuntimeState* state, TLocalPartitionType::type type,
604
                                      const int num_buckets,
605
0
                                      const std::map<int, int>& shuffle_idx_to_instance_idx) {
606
0
        return Status::InternalError("init() is only implemented in local exchange!");
607
0
    }
608
609
803k
    Status prepare(RuntimeState* state) override { return Status::OK(); }
610
    Status terminate(RuntimeState* state) override;
611
7.82M
    [[nodiscard]] bool is_finished(RuntimeState* state) const {
612
7.82M
        auto result = state->get_sink_local_state_result();
613
7.82M
        if (!result) {
614
0
            return result.error();
615
0
        }
616
7.82M
        return result.value()->is_finished();
617
7.82M
    }
618
619
3.07M
    [[nodiscard]] Status sink(RuntimeState* state, Block* block, bool eos) {
620
3.07M
        RETURN_IF_ERROR(block->check_column_and_type_not_null());
621
3.07M
        RETURN_IF_ERROR(block->check_no_column_string64());
622
3.07M
        RETURN_IF_ERROR(block->check_type_and_column());
623
3.07M
        return sink_impl(state, block, eos);
624
3.07M
    }
625
626
    [[nodiscard]] virtual Status sink_impl(RuntimeState* state, Block* block, bool eos) = 0;
627
628
    [[nodiscard]] virtual Status setup_local_state(RuntimeState* state,
629
                                                   LocalSinkStateInfo& info) = 0;
630
631
    // Returns the memory this sink operator expects to allocate in the next
632
    // execution round (sink only — pipeline task sums all operators + sink).
633
2.04M
    [[nodiscard]] virtual size_t get_reserve_mem_size(RuntimeState* state, bool eos) {
634
2.04M
        return state->minimum_operator_memory_required_bytes();
635
2.04M
    }
636
7.54M
    bool is_blockable(RuntimeState* state) const override {
637
7.54M
        return state->get_sink_local_state()->is_blockable();
638
7.54M
    }
639
640
0
    [[nodiscard]] bool is_spillable() const { return _spillable; }
641
642
    template <class TARGET>
643
6.71M
    TARGET& cast() {
644
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
645
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
646
18.4E
                << " and expect type is" << typeid(TARGET).name();
647
6.71M
        return reinterpret_cast<TARGET&>(*this);
648
6.71M
    }
_ZN5doris21DataSinkOperatorXBase4castINS_23ResultFileSinkOperatorXEEERT_v
Line
Count
Source
643
3.31k
    TARGET& cast() {
644
3.31k
        DCHECK(dynamic_cast<TARGET*>(this))
645
0
                << " Mismatch type! Current type is " << typeid(*this).name()
646
0
                << " and expect type is" << typeid(TARGET).name();
647
3.31k
        return reinterpret_cast<TARGET&>(*this);
648
3.31k
    }
_ZN5doris21DataSinkOperatorXBase4castINS_22JdbcTableSinkOperatorXEEERT_v
Line
Count
Source
643
402
    TARGET& cast() {
644
402
        DCHECK(dynamic_cast<TARGET*>(this))
645
0
                << " Mismatch type! Current type is " << typeid(*this).name()
646
0
                << " and expect type is" << typeid(TARGET).name();
647
402
        return reinterpret_cast<TARGET&>(*this);
648
402
    }
_ZN5doris21DataSinkOperatorXBase4castINS_22OlapTableSinkOperatorXEEERT_v
Line
Count
Source
643
344k
    TARGET& cast() {
644
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
645
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
646
18.4E
                << " and expect type is" << typeid(TARGET).name();
647
344k
        return reinterpret_cast<TARGET&>(*this);
648
344k
    }
_ZN5doris21DataSinkOperatorXBase4castINS_24OlapTableSinkV2OperatorXEEERT_v
Line
Count
Source
643
57.9k
    TARGET& cast() {
644
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
645
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
646
18.4E
                << " and expect type is" << typeid(TARGET).name();
647
57.9k
        return reinterpret_cast<TARGET&>(*this);
648
57.9k
    }
_ZN5doris21DataSinkOperatorXBase4castINS_22HiveTableSinkOperatorXEEERT_v
Line
Count
Source
643
142k
    TARGET& cast() {
644
142k
        DCHECK(dynamic_cast<TARGET*>(this))
645
656
                << " Mismatch type! Current type is " << typeid(*this).name()
646
656
                << " and expect type is" << typeid(TARGET).name();
647
142k
        return reinterpret_cast<TARGET&>(*this);
648
142k
    }
_ZN5doris21DataSinkOperatorXBase4castINS_25IcebergTableSinkOperatorXEEERT_v
Line
Count
Source
643
48.6k
    TARGET& cast() {
644
48.6k
        DCHECK(dynamic_cast<TARGET*>(this))
645
154
                << " Mismatch type! Current type is " << typeid(*this).name()
646
154
                << " and expect type is" << typeid(TARGET).name();
647
48.6k
        return reinterpret_cast<TARGET&>(*this);
648
48.6k
    }
_ZN5doris21DataSinkOperatorXBase4castINS_30SpillIcebergTableSinkOperatorXEEERT_v
Line
Count
Source
643
252
    TARGET& cast() {
644
252
        DCHECK(dynamic_cast<TARGET*>(this))
645
0
                << " Mismatch type! Current type is " << typeid(*this).name()
646
0
                << " and expect type is" << typeid(TARGET).name();
647
252
        return reinterpret_cast<TARGET&>(*this);
648
252
    }
_ZN5doris21DataSinkOperatorXBase4castINS_26IcebergDeleteSinkOperatorXEEERT_v
Line
Count
Source
643
2.78k
    TARGET& cast() {
644
2.78k
        DCHECK(dynamic_cast<TARGET*>(this))
645
2
                << " Mismatch type! Current type is " << typeid(*this).name()
646
2
                << " and expect type is" << typeid(TARGET).name();
647
2.78k
        return reinterpret_cast<TARGET&>(*this);
648
2.78k
    }
_ZN5doris21DataSinkOperatorXBase4castINS_25IcebergMergeSinkOperatorXEEERT_v
Line
Count
Source
643
15.0k
    TARGET& cast() {
644
15.0k
        DCHECK(dynamic_cast<TARGET*>(this))
645
14
                << " Mismatch type! Current type is " << typeid(*this).name()
646
14
                << " and expect type is" << typeid(TARGET).name();
647
15.0k
        return reinterpret_cast<TARGET&>(*this);
648
15.0k
    }
Unexecuted instantiation: _ZN5doris21DataSinkOperatorXBase4castINS_20MCTableSinkOperatorXEEERT_v
_ZN5doris21DataSinkOperatorXBase4castINS_21TVFTableSinkOperatorXEEERT_v
Line
Count
Source
643
786
    TARGET& cast() {
644
786
        DCHECK(dynamic_cast<TARGET*>(this))
645
0
                << " Mismatch type! Current type is " << typeid(*this).name()
646
0
                << " and expect type is" << typeid(TARGET).name();
647
786
        return reinterpret_cast<TARGET&>(*this);
648
786
    }
_ZN5doris21DataSinkOperatorXBase4castINS_26HashJoinBuildSinkOperatorXEEERT_v
Line
Count
Source
643
1.20M
    TARGET& cast() {
644
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
645
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
646
18.4E
                << " and expect type is" << typeid(TARGET).name();
647
1.20M
        return reinterpret_cast<TARGET&>(*this);
648
1.20M
    }
_ZN5doris21DataSinkOperatorXBase4castINS_32NestedLoopJoinBuildSinkOperatorXEEERT_v
Line
Count
Source
643
18.8k
    TARGET& cast() {
644
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
645
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
646
18.4E
                << " and expect type is" << typeid(TARGET).name();
647
18.8k
        return reinterpret_cast<TARGET&>(*this);
648
18.8k
    }
_ZN5doris21DataSinkOperatorXBase4castINS_32PartitionedHashJoinSinkOperatorXEEERT_v
Line
Count
Source
643
17
    TARGET& cast() {
644
17
        DCHECK(dynamic_cast<TARGET*>(this))
645
0
                << " Mismatch type! Current type is " << typeid(*this).name()
646
0
                << " and expect type is" << typeid(TARGET).name();
647
17
        return reinterpret_cast<TARGET&>(*this);
648
17
    }
_ZN5doris21DataSinkOperatorXBase4castINS_19ResultSinkOperatorXEEERT_v
Line
Count
Source
643
1.30M
    TARGET& cast() {
644
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
645
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
646
18.4E
                << " and expect type is" << typeid(TARGET).name();
647
1.30M
        return reinterpret_cast<TARGET&>(*this);
648
1.30M
    }
_ZN5doris21DataSinkOperatorXBase4castINS_26MemoryScratchSinkOperatorXEEERT_v
Line
Count
Source
643
3
    TARGET& cast() {
644
3
        DCHECK(dynamic_cast<TARGET*>(this))
645
0
                << " Mismatch type! Current type is " << typeid(*this).name()
646
0
                << " and expect type is" << typeid(TARGET).name();
647
3
        return reinterpret_cast<TARGET&>(*this);
648
3
    }
_ZN5doris21DataSinkOperatorXBase4castINS_21AnalyticSinkOperatorXEEERT_v
Line
Count
Source
643
21.2k
    TARGET& cast() {
644
21.2k
        DCHECK(dynamic_cast<TARGET*>(this))
645
6
                << " Mismatch type! Current type is " << typeid(*this).name()
646
6
                << " and expect type is" << typeid(TARGET).name();
647
21.2k
        return reinterpret_cast<TARGET&>(*this);
648
21.2k
    }
_ZN5doris21DataSinkOperatorXBase4castINS_17SortSinkOperatorXEEERT_v
Line
Count
Source
643
274k
    TARGET& cast() {
644
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
645
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
646
18.4E
                << " and expect type is" << typeid(TARGET).name();
647
274k
        return reinterpret_cast<TARGET&>(*this);
648
274k
    }
_ZN5doris21DataSinkOperatorXBase4castINS_22SpillSortSinkOperatorXEEERT_v
Line
Count
Source
643
563
    TARGET& cast() {
644
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
645
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
646
18.4E
                << " and expect type is" << typeid(TARGET).name();
647
563
        return reinterpret_cast<TARGET&>(*this);
648
563
    }
_ZN5doris21DataSinkOperatorXBase4castINS_26LocalExchangeSinkOperatorXEEERT_v
Line
Count
Source
643
412k
    TARGET& cast() {
644
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
645
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
646
18.4E
                << " and expect type is" << typeid(TARGET).name();
647
412k
        return reinterpret_cast<TARGET&>(*this);
648
412k
    }
_ZN5doris21DataSinkOperatorXBase4castINS_16AggSinkOperatorXEEERT_v
Line
Count
Source
643
595k
    TARGET& cast() {
644
595k
        DCHECK(dynamic_cast<TARGET*>(this))
645
14
                << " Mismatch type! Current type is " << typeid(*this).name()
646
14
                << " and expect type is" << typeid(TARGET).name();
647
595k
        return reinterpret_cast<TARGET&>(*this);
648
595k
    }
_ZN5doris21DataSinkOperatorXBase4castINS_24BucketedAggSinkOperatorXEEERT_v
Line
Count
Source
643
2.25k
    TARGET& cast() {
644
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
645
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
646
18.4E
                << " and expect type is" << typeid(TARGET).name();
647
2.25k
        return reinterpret_cast<TARGET&>(*this);
648
2.25k
    }
_ZN5doris21DataSinkOperatorXBase4castINS_27PartitionedAggSinkOperatorXEEERT_v
Line
Count
Source
643
599
    TARGET& cast() {
644
599
        DCHECK(dynamic_cast<TARGET*>(this))
645
0
                << " Mismatch type! Current type is " << typeid(*this).name()
646
0
                << " and expect type is" << typeid(TARGET).name();
647
599
        return reinterpret_cast<TARGET&>(*this);
648
599
    }
_ZN5doris21DataSinkOperatorXBase4castINS_21ExchangeSinkOperatorXEEERT_v
Line
Count
Source
643
2.22M
    TARGET& cast() {
644
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
645
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
646
18.4E
                << " and expect type is" << typeid(TARGET).name();
647
2.22M
        return reinterpret_cast<TARGET&>(*this);
648
2.22M
    }
_ZN5doris21DataSinkOperatorXBase4castINS_18UnionSinkOperatorXEEERT_v
Line
Count
Source
643
11.9k
    TARGET& cast() {
644
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
645
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
646
18.4E
                << " and expect type is" << typeid(TARGET).name();
647
11.9k
        return reinterpret_cast<TARGET&>(*this);
648
11.9k
    }
_ZN5doris21DataSinkOperatorXBase4castINS_26PartitionSortSinkOperatorXEEERT_v
Line
Count
Source
643
406
    TARGET& cast() {
644
406
        DCHECK(dynamic_cast<TARGET*>(this))
645
0
                << " Mismatch type! Current type is " << typeid(*this).name()
646
0
                << " and expect type is" << typeid(TARGET).name();
647
406
        return reinterpret_cast<TARGET&>(*this);
648
406
    }
_ZN5doris21DataSinkOperatorXBase4castINS_21SetProbeSinkOperatorXILb1EEEEERT_v
Line
Count
Source
643
4.64k
    TARGET& cast() {
644
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
645
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
646
18.4E
                << " and expect type is" << typeid(TARGET).name();
647
4.64k
        return reinterpret_cast<TARGET&>(*this);
648
4.64k
    }
_ZN5doris21DataSinkOperatorXBase4castINS_21SetProbeSinkOperatorXILb0EEEEERT_v
Line
Count
Source
643
2.48k
    TARGET& cast() {
644
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
645
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
646
18.4E
                << " and expect type is" << typeid(TARGET).name();
647
2.48k
        return reinterpret_cast<TARGET&>(*this);
648
2.48k
    }
_ZN5doris21DataSinkOperatorXBase4castINS_16SetSinkOperatorXILb1EEEEERT_v
Line
Count
Source
643
5.07k
    TARGET& cast() {
644
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
645
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
646
18.4E
                << " and expect type is" << typeid(TARGET).name();
647
5.07k
        return reinterpret_cast<TARGET&>(*this);
648
5.07k
    }
_ZN5doris21DataSinkOperatorXBase4castINS_16SetSinkOperatorXILb0EEEEERT_v
Line
Count
Source
643
4.81k
    TARGET& cast() {
644
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
645
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
646
18.4E
                << " and expect type is" << typeid(TARGET).name();
647
4.81k
        return reinterpret_cast<TARGET&>(*this);
648
4.81k
    }
_ZN5doris21DataSinkOperatorXBase4castINS_29GroupCommitBlockSinkOperatorXEEERT_v
Line
Count
Source
643
2.52k
    TARGET& cast() {
644
2.52k
        DCHECK(dynamic_cast<TARGET*>(this))
645
0
                << " Mismatch type! Current type is " << typeid(*this).name()
646
0
                << " and expect type is" << typeid(TARGET).name();
647
2.52k
        return reinterpret_cast<TARGET&>(*this);
648
2.52k
    }
_ZN5doris21DataSinkOperatorXBase4castINS_17DictSinkOperatorXEEERT_v
Line
Count
Source
643
202
    TARGET& cast() {
644
202
        DCHECK(dynamic_cast<TARGET*>(this))
645
0
                << " Mismatch type! Current type is " << typeid(*this).name()
646
0
                << " and expect type is" << typeid(TARGET).name();
647
202
        return reinterpret_cast<TARGET&>(*this);
648
202
    }
_ZN5doris21DataSinkOperatorXBase4castINS_19RecCTESinkOperatorXEEERT_v
Line
Count
Source
643
164
    TARGET& cast() {
644
164
        DCHECK(dynamic_cast<TARGET*>(this))
645
0
                << " Mismatch type! Current type is " << typeid(*this).name()
646
0
                << " and expect type is" << typeid(TARGET).name();
647
164
        return reinterpret_cast<TARGET&>(*this);
648
164
    }
_ZN5doris21DataSinkOperatorXBase4castINS_25RecCTEAnchorSinkOperatorXEEERT_v
Line
Count
Source
643
164
    TARGET& cast() {
644
164
        DCHECK(dynamic_cast<TARGET*>(this))
645
0
                << " Mismatch type! Current type is " << typeid(*this).name()
646
0
                << " and expect type is" << typeid(TARGET).name();
647
164
        return reinterpret_cast<TARGET&>(*this);
648
164
    }
649
    template <class TARGET>
650
    const TARGET& cast() const {
651
        DCHECK(dynamic_cast<const TARGET*>(this))
652
                << " Mismatch type! Current type is " << typeid(*this).name()
653
                << " and expect type is" << typeid(TARGET).name();
654
        return reinterpret_cast<const TARGET&>(*this);
655
    }
656
657
    [[nodiscard]] virtual std::shared_ptr<BasicSharedState> create_shared_state() const = 0;
658
659
0
    Status close(RuntimeState* state) override {
660
0
        return Status::InternalError("Should not reach here!");
661
0
    }
662
663
    [[nodiscard]] virtual std::string debug_string(int indentation_level) const;
664
665
    [[nodiscard]] virtual std::string debug_string(RuntimeState* state,
666
                                                   int indentation_level) const;
667
668
876k
    [[nodiscard]] bool is_sink() const override { return true; }
669
670
2.10M
    static Status close(RuntimeState* state, Status exec_status) {
671
2.10M
        auto result = state->get_sink_local_state_result();
672
2.10M
        if (!result) {
673
0
            return result.error();
674
0
        }
675
2.10M
        return result.value()->close(state, exec_status);
676
2.10M
    }
677
678
5.16M
    [[nodiscard]] int operator_id() const { return _operator_id; }
679
680
9.01M
    [[nodiscard]] const std::vector<int>& dests_id() const { return _dests_id; }
681
682
2.68M
    [[nodiscard]] int nereids_id() const { return _nereids_id; }
683
684
7.28M
    [[nodiscard]] int node_id() const override { return _node_id; }
685
686
4.82M
    [[nodiscard]] std::string get_name() const override { return _name; }
687
688
1.99M
    virtual bool should_dry_run(RuntimeState* state) { return false; }
689
690
253k
    [[nodiscard]] virtual bool count_down_destination() { return true; }
691
692
protected:
693
    template <typename Writer, typename Parent>
694
        requires(std::is_base_of_v<AsyncResultWriter, Writer>)
695
    friend class AsyncWriterSink;
696
    // _operator_id : the current Operator's ID, which is not visible to the user.
697
    // _node_id : the plan node ID corresponding to the Operator, which is visible on the profile.
698
    // _dests_id : the target _operator_id of the sink, for example, in the case of a multi-sink, there are multiple targets.
699
    const int _operator_id;
700
    const int _node_id;
701
    int _nereids_id = -1;
702
    bool _spillable = false;
703
    std::vector<int> _dests_id;
704
    std::string _name;
705
};
706
707
template <typename LocalStateType>
708
class DataSinkOperatorX : public DataSinkOperatorXBase {
709
public:
710
    DataSinkOperatorX(const int id, const int node_id, const int dest_id)
711
481k
            : DataSinkOperatorXBase(id, node_id, dest_id) {}
_ZN5doris17DataSinkOperatorXINS_27LocalExchangeSinkLocalStateEEC2Eiii
Line
Count
Source
711
1.09k
            : DataSinkOperatorXBase(id, node_id, dest_id) {}
_ZN5doris17DataSinkOperatorXINS_25OlapTableSinkV2LocalStateEEC2Eiii
Line
Count
Source
711
3.05k
            : DataSinkOperatorXBase(id, node_id, dest_id) {}
_ZN5doris17DataSinkOperatorXINS_23OlapTableSinkLocalStateEEC2Eiii
Line
Count
Source
711
32.5k
            : DataSinkOperatorXBase(id, node_id, dest_id) {}
_ZN5doris17DataSinkOperatorXINS_30GroupCommitBlockSinkLocalStateEEC2Eiii
Line
Count
Source
711
565
            : DataSinkOperatorXBase(id, node_id, dest_id) {}
_ZN5doris17DataSinkOperatorXINS_23HiveTableSinkLocalStateEEC2Eiii
Line
Count
Source
711
1.55k
            : DataSinkOperatorXBase(id, node_id, dest_id) {}
_ZN5doris17DataSinkOperatorXINS_26IcebergTableSinkLocalStateEEC2Eiii
Line
Count
Source
711
2.13k
            : DataSinkOperatorXBase(id, node_id, dest_id) {}
_ZN5doris17DataSinkOperatorXINS_27IcebergDeleteSinkLocalStateEEC2Eiii
Line
Count
Source
711
88
            : DataSinkOperatorXBase(id, node_id, dest_id) {}
_ZN5doris17DataSinkOperatorXINS_26IcebergMergeSinkLocalStateEEC2Eiii
Line
Count
Source
711
214
            : DataSinkOperatorXBase(id, node_id, dest_id) {}
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_21MCTableSinkLocalStateEEC2Eiii
_ZN5doris17DataSinkOperatorXINS_22TVFTableSinkLocalStateEEC2Eiii
Line
Count
Source
711
156
            : DataSinkOperatorXBase(id, node_id, dest_id) {}
_ZN5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb1EEEEC2Eiii
Line
Count
Source
711
181
            : DataSinkOperatorXBase(id, node_id, dest_id) {}
_ZN5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb1EEEEC2Eiii
Line
Count
Source
711
262
            : DataSinkOperatorXBase(id, node_id, dest_id) {}
_ZN5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb0EEEEC2Eiii
Line
Count
Source
711
161
            : DataSinkOperatorXBase(id, node_id, dest_id) {}
_ZN5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb0EEEEC2Eiii
Line
Count
Source
711
176
            : DataSinkOperatorXBase(id, node_id, dest_id) {}
_ZN5doris17DataSinkOperatorXINS_26RecCTEAnchorSinkLocalStateEEC2Eiii
Line
Count
Source
711
164
            : DataSinkOperatorXBase(id, node_id, dest_id) {}
_ZN5doris17DataSinkOperatorXINS_20RecCTESinkLocalStateEEC2Eiii
Line
Count
Source
711
164
            : DataSinkOperatorXBase(id, node_id, dest_id) {}
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_27HashJoinBuildSinkLocalStateEEC2Eiii
_ZN5doris17DataSinkOperatorXINS_20ResultSinkLocalStateEEC2Eiii
Line
Count
Source
711
273k
            : DataSinkOperatorXBase(id, node_id, dest_id) {}
_ZN5doris17DataSinkOperatorXINS_23JdbcTableSinkLocalStateEEC2Eiii
Line
Count
Source
711
86
            : DataSinkOperatorXBase(id, node_id, dest_id) {}
_ZN5doris17DataSinkOperatorXINS_27MemoryScratchSinkLocalStateEEC2Eiii
Line
Count
Source
711
3
            : DataSinkOperatorXBase(id, node_id, dest_id) {}
_ZN5doris17DataSinkOperatorXINS_24ResultFileSinkLocalStateEEC2Eiii
Line
Count
Source
711
501
            : DataSinkOperatorXBase(id, node_id, dest_id) {}
_ZN5doris17DataSinkOperatorXINS_31SpillIcebergTableSinkLocalStateEEC2Eiii
Line
Count
Source
711
6
            : DataSinkOperatorXBase(id, node_id, dest_id) {}
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_22AnalyticSinkLocalStateEEC2Eiii
_ZN5doris17DataSinkOperatorXINS_23BlackholeSinkLocalStateEEC2Eiii
Line
Count
Source
711
13
            : DataSinkOperatorXBase(id, node_id, dest_id) {}
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_18SortSinkLocalStateEEC2Eiii
_ZN5doris17DataSinkOperatorXINS_23SpillSortSinkLocalStateEEC2Eiii
Line
Count
Source
711
31
            : DataSinkOperatorXBase(id, node_id, dest_id) {}
_ZN5doris17DataSinkOperatorXINS_17AggSinkLocalStateEEC2Eiii
Line
Count
Source
711
31
            : DataSinkOperatorXBase(id, node_id, dest_id) {}
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_25BucketedAggSinkLocalStateEEC2Eiii
_ZN5doris17DataSinkOperatorXINS_28PartitionedAggSinkLocalStateEEC2Eiii
Line
Count
Source
711
220
            : DataSinkOperatorXBase(id, node_id, dest_id) {}
_ZN5doris17DataSinkOperatorXINS_22ExchangeSinkLocalStateEEC2Eiii
Line
Count
Source
711
163k
            : DataSinkOperatorXBase(id, node_id, dest_id) {}
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_33NestedLoopJoinBuildSinkLocalStateEEC2Eiii
_ZN5doris17DataSinkOperatorXINS_19UnionSinkLocalStateEEC2Eiii
Line
Count
Source
711
1.61k
            : DataSinkOperatorXBase(id, node_id, dest_id) {}
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_33MultiCastDataStreamSinkLocalStateEEC2Eiii
_ZN5doris17DataSinkOperatorXINS_27PartitionSortSinkLocalStateEEC2Eiii
Line
Count
Source
711
70
            : DataSinkOperatorXBase(id, node_id, dest_id) {}
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_33PartitionedHashJoinSinkLocalStateEEC2Eiii
_ZN5doris17DataSinkOperatorXINS_19CacheSinkLocalStateEEC2Eiii
Line
Count
Source
711
10
            : DataSinkOperatorXBase(id, node_id, dest_id) {}
_ZN5doris17DataSinkOperatorXINS_18DictSinkLocalStateEEC2Eiii
Line
Count
Source
711
101
            : DataSinkOperatorXBase(id, node_id, dest_id) {}
712
    DataSinkOperatorX(const int id, const TPlanNode& tnode, const int dest_id)
713
320k
            : DataSinkOperatorXBase(id, tnode, dest_id) {}
_ZN5doris17DataSinkOperatorXINS_27LocalExchangeSinkLocalStateEEC2EiRKNS_9TPlanNodeEi
Line
Count
Source
713
121k
            : DataSinkOperatorXBase(id, tnode, dest_id) {}
_ZN5doris17DataSinkOperatorXINS_27HashJoinBuildSinkLocalStateEEC2EiRKNS_9TPlanNodeEi
Line
Count
Source
713
83.0k
            : DataSinkOperatorXBase(id, tnode, dest_id) {}
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_20ResultSinkLocalStateEEC2EiRKNS_9TPlanNodeEi
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_23JdbcTableSinkLocalStateEEC2EiRKNS_9TPlanNodeEi
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_27MemoryScratchSinkLocalStateEEC2EiRKNS_9TPlanNodeEi
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_24ResultFileSinkLocalStateEEC2EiRKNS_9TPlanNodeEi
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_23OlapTableSinkLocalStateEEC2EiRKNS_9TPlanNodeEi
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_25OlapTableSinkV2LocalStateEEC2EiRKNS_9TPlanNodeEi
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_23HiveTableSinkLocalStateEEC2EiRKNS_9TPlanNodeEi
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_22TVFTableSinkLocalStateEEC2EiRKNS_9TPlanNodeEi
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_26IcebergTableSinkLocalStateEEC2EiRKNS_9TPlanNodeEi
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_31SpillIcebergTableSinkLocalStateEEC2EiRKNS_9TPlanNodeEi
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_27IcebergDeleteSinkLocalStateEEC2EiRKNS_9TPlanNodeEi
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_26IcebergMergeSinkLocalStateEEC2EiRKNS_9TPlanNodeEi
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_21MCTableSinkLocalStateEEC2EiRKNS_9TPlanNodeEi
_ZN5doris17DataSinkOperatorXINS_22AnalyticSinkLocalStateEEC2EiRKNS_9TPlanNodeEi
Line
Count
Source
713
1.83k
            : DataSinkOperatorXBase(id, tnode, dest_id) {}
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_23BlackholeSinkLocalStateEEC2EiRKNS_9TPlanNodeEi
_ZN5doris17DataSinkOperatorXINS_18SortSinkLocalStateEEC2EiRKNS_9TPlanNodeEi
Line
Count
Source
713
48.0k
            : DataSinkOperatorXBase(id, tnode, dest_id) {}
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_23SpillSortSinkLocalStateEEC2EiRKNS_9TPlanNodeEi
_ZN5doris17DataSinkOperatorXINS_17AggSinkLocalStateEEC2EiRKNS_9TPlanNodeEi
Line
Count
Source
713
59.0k
            : DataSinkOperatorXBase(id, tnode, dest_id) {}
_ZN5doris17DataSinkOperatorXINS_25BucketedAggSinkLocalStateEEC2EiRKNS_9TPlanNodeEi
Line
Count
Source
713
63
            : DataSinkOperatorXBase(id, tnode, dest_id) {}
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_28PartitionedAggSinkLocalStateEEC2EiRKNS_9TPlanNodeEi
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_22ExchangeSinkLocalStateEEC2EiRKNS_9TPlanNodeEi
_ZN5doris17DataSinkOperatorXINS_33NestedLoopJoinBuildSinkLocalStateEEC2EiRKNS_9TPlanNodeEi
Line
Count
Source
713
6.42k
            : DataSinkOperatorXBase(id, tnode, dest_id) {}
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
_ZN5doris17DataSinkOperatorXINS_33PartitionedHashJoinSinkLocalStateEEC2EiRKNS_9TPlanNodeEi
Line
Count
Source
713
54
            : DataSinkOperatorXBase(id, tnode, dest_id) {}
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
714
715
    DataSinkOperatorX(const int id, const int node_id, std::vector<int> dest_ids)
716
2.69k
            : DataSinkOperatorXBase(id, node_id, dest_ids) {}
_ZN5doris17DataSinkOperatorXINS_33MultiCastDataStreamSinkLocalStateEEC2EiiSt6vectorIiSaIiEE
Line
Count
Source
716
2.69k
            : DataSinkOperatorXBase(id, node_id, dest_ids) {}
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_27HashJoinBuildSinkLocalStateEEC2EiiSt6vectorIiSaIiEE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_20ResultSinkLocalStateEEC2EiiSt6vectorIiSaIiEE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_23JdbcTableSinkLocalStateEEC2EiiSt6vectorIiSaIiEE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_27MemoryScratchSinkLocalStateEEC2EiiSt6vectorIiSaIiEE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_24ResultFileSinkLocalStateEEC2EiiSt6vectorIiSaIiEE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_23OlapTableSinkLocalStateEEC2EiiSt6vectorIiSaIiEE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_25OlapTableSinkV2LocalStateEEC2EiiSt6vectorIiSaIiEE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_23HiveTableSinkLocalStateEEC2EiiSt6vectorIiSaIiEE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_22TVFTableSinkLocalStateEEC2EiiSt6vectorIiSaIiEE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_26IcebergTableSinkLocalStateEEC2EiiSt6vectorIiSaIiEE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_31SpillIcebergTableSinkLocalStateEEC2EiiSt6vectorIiSaIiEE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_27IcebergDeleteSinkLocalStateEEC2EiiSt6vectorIiSaIiEE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_26IcebergMergeSinkLocalStateEEC2EiiSt6vectorIiSaIiEE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_21MCTableSinkLocalStateEEC2EiiSt6vectorIiSaIiEE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_22AnalyticSinkLocalStateEEC2EiiSt6vectorIiSaIiEE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_23BlackholeSinkLocalStateEEC2EiiSt6vectorIiSaIiEE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_18SortSinkLocalStateEEC2EiiSt6vectorIiSaIiEE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_23SpillSortSinkLocalStateEEC2EiiSt6vectorIiSaIiEE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_27LocalExchangeSinkLocalStateEEC2EiiSt6vectorIiSaIiEE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_17AggSinkLocalStateEEC2EiiSt6vectorIiSaIiEE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_25BucketedAggSinkLocalStateEEC2EiiSt6vectorIiSaIiEE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_28PartitionedAggSinkLocalStateEEC2EiiSt6vectorIiSaIiEE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_22ExchangeSinkLocalStateEEC2EiiSt6vectorIiSaIiEE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_33NestedLoopJoinBuildSinkLocalStateEEC2EiiSt6vectorIiSaIiEE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_19UnionSinkLocalStateEEC2EiiSt6vectorIiSaIiEE
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
717
#ifdef BE_TEST
718
    DataSinkOperatorX() = default;
719
#endif
720
    ~DataSinkOperatorX() override = default;
721
722
    Status setup_local_state(RuntimeState* state, LocalSinkStateInfo& info) override;
723
    std::shared_ptr<BasicSharedState> create_shared_state() const override;
724
725
    using LocalState = LocalStateType;
726
3.77M
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
727
3.77M
        return state->get_sink_local_state()->template cast<LocalState>();
728
3.77M
    }
_ZNK5doris17DataSinkOperatorXINS_22ExchangeSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
726
928k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
727
928k
        return state->get_sink_local_state()->template cast<LocalState>();
728
928k
    }
_ZNK5doris17DataSinkOperatorXINS_19UnionSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
726
11.9k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
727
11.9k
        return state->get_sink_local_state()->template cast<LocalState>();
728
11.9k
    }
_ZNK5doris17DataSinkOperatorXINS_25OlapTableSinkV2LocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
726
11.0k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
727
11.0k
        return state->get_sink_local_state()->template cast<LocalState>();
728
11.0k
    }
_ZNK5doris17DataSinkOperatorXINS_23OlapTableSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
726
63.8k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
727
63.8k
        return state->get_sink_local_state()->template cast<LocalState>();
728
63.8k
    }
_ZNK5doris17DataSinkOperatorXINS_23HiveTableSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
726
7.65k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
727
7.65k
        return state->get_sink_local_state()->template cast<LocalState>();
728
7.65k
    }
_ZNK5doris17DataSinkOperatorXINS_26IcebergTableSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
726
6.58k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
727
6.58k
        return state->get_sink_local_state()->template cast<LocalState>();
728
6.58k
    }
_ZNK5doris17DataSinkOperatorXINS_27IcebergDeleteSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
726
790
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
727
790
        return state->get_sink_local_state()->template cast<LocalState>();
728
790
    }
_ZNK5doris17DataSinkOperatorXINS_26IcebergMergeSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
726
2.14k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
727
2.14k
        return state->get_sink_local_state()->template cast<LocalState>();
728
2.14k
    }
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_21MCTableSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
_ZNK5doris17DataSinkOperatorXINS_22TVFTableSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
726
310
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
727
310
        return state->get_sink_local_state()->template cast<LocalState>();
728
310
    }
_ZNK5doris17DataSinkOperatorXINS_27LocalExchangeSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
726
456k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
727
456k
        return state->get_sink_local_state()->template cast<LocalState>();
728
456k
    }
_ZNK5doris17DataSinkOperatorXINS_17AggSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
726
671k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
727
671k
        return state->get_sink_local_state()->template cast<LocalState>();
728
671k
    }
_ZNK5doris17DataSinkOperatorXINS_26RecCTEAnchorSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
726
512
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
727
512
        return state->get_sink_local_state()->template cast<LocalState>();
728
512
    }
_ZNK5doris17DataSinkOperatorXINS_20RecCTESinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
726
7.15k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
727
7.15k
        return state->get_sink_local_state()->template cast<LocalState>();
728
7.15k
    }
_ZNK5doris17DataSinkOperatorXINS_27HashJoinBuildSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
726
544k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
727
544k
        return state->get_sink_local_state()->template cast<LocalState>();
728
544k
    }
_ZNK5doris17DataSinkOperatorXINS_20ResultSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
726
530k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
727
530k
        return state->get_sink_local_state()->template cast<LocalState>();
728
530k
    }
_ZNK5doris17DataSinkOperatorXINS_23JdbcTableSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
726
110
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
727
110
        return state->get_sink_local_state()->template cast<LocalState>();
728
110
    }
_ZNK5doris17DataSinkOperatorXINS_27MemoryScratchSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
726
6
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
727
6
        return state->get_sink_local_state()->template cast<LocalState>();
728
6
    }
_ZNK5doris17DataSinkOperatorXINS_24ResultFileSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
726
2.57k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
727
2.57k
        return state->get_sink_local_state()->template cast<LocalState>();
728
2.57k
    }
_ZNK5doris17DataSinkOperatorXINS_31SpillIcebergTableSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
726
120
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
727
120
        return state->get_sink_local_state()->template cast<LocalState>();
728
120
    }
_ZNK5doris17DataSinkOperatorXINS_22AnalyticSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
726
24.7k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
727
24.7k
        return state->get_sink_local_state()->template cast<LocalState>();
728
24.7k
    }
_ZNK5doris17DataSinkOperatorXINS_23BlackholeSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
726
14.9k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
727
14.9k
        return state->get_sink_local_state()->template cast<LocalState>();
728
14.9k
    }
_ZNK5doris17DataSinkOperatorXINS_18SortSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
726
422k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
727
422k
        return state->get_sink_local_state()->template cast<LocalState>();
728
422k
    }
_ZNK5doris17DataSinkOperatorXINS_23SpillSortSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
726
1.71k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
727
1.71k
        return state->get_sink_local_state()->template cast<LocalState>();
728
1.71k
    }
_ZNK5doris17DataSinkOperatorXINS_25BucketedAggSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
726
2.60k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
727
2.60k
        return state->get_sink_local_state()->template cast<LocalState>();
728
2.60k
    }
_ZNK5doris17DataSinkOperatorXINS_28PartitionedAggSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
726
3.91k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
727
3.91k
        return state->get_sink_local_state()->template cast<LocalState>();
728
3.91k
    }
_ZNK5doris17DataSinkOperatorXINS_33NestedLoopJoinBuildSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
726
23.3k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
727
23.3k
        return state->get_sink_local_state()->template cast<LocalState>();
728
23.3k
    }
_ZNK5doris17DataSinkOperatorXINS_33MultiCastDataStreamSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
726
13.7k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
727
13.7k
        return state->get_sink_local_state()->template cast<LocalState>();
728
13.7k
    }
_ZNK5doris17DataSinkOperatorXINS_27PartitionSortSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
726
1.40k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
727
1.40k
        return state->get_sink_local_state()->template cast<LocalState>();
728
1.40k
    }
_ZNK5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb1EEEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
726
7.36k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
727
7.36k
        return state->get_sink_local_state()->template cast<LocalState>();
728
7.36k
    }
_ZNK5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb0EEEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
726
3.67k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
727
3.67k
        return state->get_sink_local_state()->template cast<LocalState>();
728
3.67k
    }
_ZNK5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb1EEEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
726
5.46k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
727
5.46k
        return state->get_sink_local_state()->template cast<LocalState>();
728
5.46k
    }
_ZNK5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb0EEEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
726
3.74k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
727
3.74k
        return state->get_sink_local_state()->template cast<LocalState>();
728
3.74k
    }
_ZNK5doris17DataSinkOperatorXINS_33PartitionedHashJoinSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
726
9
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
727
9
        return state->get_sink_local_state()->template cast<LocalState>();
728
9
    }
_ZNK5doris17DataSinkOperatorXINS_30GroupCommitBlockSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
726
1.46k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
727
1.46k
        return state->get_sink_local_state()->template cast<LocalState>();
728
1.46k
    }
_ZNK5doris17DataSinkOperatorXINS_19CacheSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
726
25
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
727
25
        return state->get_sink_local_state()->template cast<LocalState>();
728
25
    }
_ZNK5doris17DataSinkOperatorXINS_18DictSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
726
266
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
727
266
        return state->get_sink_local_state()->template cast<LocalState>();
728
266
    }
729
};
730
731
template <typename SharedStateArg>
732
class PipelineXSpillSinkLocalState : public PipelineXSinkLocalState<SharedStateArg> {
733
public:
734
    using Base = PipelineXSinkLocalState<SharedStateArg>;
735
    PipelineXSpillSinkLocalState(DataSinkOperatorXBase* parent, RuntimeState* state)
736
3.85k
            : Base(parent, state) {}
_ZN5doris28PipelineXSpillSinkLocalStateINS_20MultiCastSharedStateEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Line
Count
Source
736
3.56k
            : Base(parent, state) {}
_ZN5doris28PipelineXSpillSinkLocalStateINS_30PartitionedHashJoinSharedStateEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Line
Count
Source
736
8
            : Base(parent, state) {}
_ZN5doris28PipelineXSpillSinkLocalStateINS_20SpillSortSharedStateEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Line
Count
Source
736
45
            : Base(parent, state) {}
_ZN5doris28PipelineXSpillSinkLocalStateINS_25PartitionedAggSharedStateEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Line
Count
Source
736
237
            : Base(parent, state) {}
737
3.86k
    ~PipelineXSpillSinkLocalState() override = default;
_ZN5doris28PipelineXSpillSinkLocalStateINS_20MultiCastSharedStateEED2Ev
Line
Count
Source
737
3.57k
    ~PipelineXSpillSinkLocalState() override = default;
_ZN5doris28PipelineXSpillSinkLocalStateINS_30PartitionedHashJoinSharedStateEED2Ev
Line
Count
Source
737
8
    ~PipelineXSpillSinkLocalState() override = default;
_ZN5doris28PipelineXSpillSinkLocalStateINS_20SpillSortSharedStateEED2Ev
Line
Count
Source
737
45
    ~PipelineXSpillSinkLocalState() override = default;
_ZN5doris28PipelineXSpillSinkLocalStateINS_25PartitionedAggSharedStateEED2Ev
Line
Count
Source
737
237
    ~PipelineXSpillSinkLocalState() override = default;
738
739
3.83k
    Status init(RuntimeState* state, LocalSinkStateInfo& info) override {
740
3.83k
        RETURN_IF_ERROR(Base::init(state, info));
741
3.83k
        init_spill_counters();
742
3.83k
        return Status::OK();
743
3.83k
    }
_ZN5doris28PipelineXSpillSinkLocalStateINS_20MultiCastSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
739
3.55k
    Status init(RuntimeState* state, LocalSinkStateInfo& info) override {
740
3.55k
        RETURN_IF_ERROR(Base::init(state, info));
741
3.55k
        init_spill_counters();
742
3.55k
        return Status::OK();
743
3.55k
    }
_ZN5doris28PipelineXSpillSinkLocalStateINS_30PartitionedHashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
739
2
    Status init(RuntimeState* state, LocalSinkStateInfo& info) override {
740
2
        RETURN_IF_ERROR(Base::init(state, info));
741
2
        init_spill_counters();
742
2
        return Status::OK();
743
2
    }
_ZN5doris28PipelineXSpillSinkLocalStateINS_20SpillSortSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
739
43
    Status init(RuntimeState* state, LocalSinkStateInfo& info) override {
740
43
        RETURN_IF_ERROR(Base::init(state, info));
741
43
        init_spill_counters();
742
43
        return Status::OK();
743
43
    }
_ZN5doris28PipelineXSpillSinkLocalStateINS_25PartitionedAggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
739
234
    Status init(RuntimeState* state, LocalSinkStateInfo& info) override {
740
234
        RETURN_IF_ERROR(Base::init(state, info));
741
234
        init_spill_counters();
742
234
        return Status::OK();
743
234
    }
744
745
3.83k
    void init_spill_counters() {
746
3.83k
        _spill_total_timer =
747
3.83k
                ADD_TIMER_WITH_LEVEL(Base::custom_profile(), profile::SPILL_TOTAL_TIME, 1);
748
749
3.83k
        _write_counters.init(Base::custom_profile());
750
751
        // SpillFileWriter looks up these counters via get_counter() in its
752
        // constructor. They must be registered on the CustomCounters profile
753
        // before any SpillFileWriter is created, otherwise the lookups return
754
        // nullptr and COUNTER_UPDATE will SEGV.
755
3.83k
        _spill_write_file_total_size = ADD_COUNTER_WITH_LEVEL(
756
3.83k
                Base::custom_profile(), profile::SPILL_WRITE_FILE_BYTES, TUnit::BYTES, 1);
757
3.83k
        _spill_file_total_count = ADD_COUNTER_WITH_LEVEL(
758
3.83k
                Base::custom_profile(), profile::SPILL_WRITE_FILE_TOTAL_COUNT, TUnit::UNIT, 1);
759
760
3.83k
        _spill_max_rows_of_partition = ADD_COUNTER_WITH_LEVEL(
761
3.83k
                Base::custom_profile(), profile::SPILL_MAX_ROWS_OF_PARTITION, TUnit::UNIT, 1);
762
3.83k
        _spill_min_rows_of_partition = ADD_COUNTER_WITH_LEVEL(
763
3.83k
                Base::custom_profile(), profile::SPILL_MIN_ROWS_OF_PARTITION, TUnit::UNIT, 1);
764
3.83k
    }
_ZN5doris28PipelineXSpillSinkLocalStateINS_20MultiCastSharedStateEE19init_spill_countersEv
Line
Count
Source
745
3.55k
    void init_spill_counters() {
746
3.55k
        _spill_total_timer =
747
3.55k
                ADD_TIMER_WITH_LEVEL(Base::custom_profile(), profile::SPILL_TOTAL_TIME, 1);
748
749
3.55k
        _write_counters.init(Base::custom_profile());
750
751
        // SpillFileWriter looks up these counters via get_counter() in its
752
        // constructor. They must be registered on the CustomCounters profile
753
        // before any SpillFileWriter is created, otherwise the lookups return
754
        // nullptr and COUNTER_UPDATE will SEGV.
755
3.55k
        _spill_write_file_total_size = ADD_COUNTER_WITH_LEVEL(
756
3.55k
                Base::custom_profile(), profile::SPILL_WRITE_FILE_BYTES, TUnit::BYTES, 1);
757
3.55k
        _spill_file_total_count = ADD_COUNTER_WITH_LEVEL(
758
3.55k
                Base::custom_profile(), profile::SPILL_WRITE_FILE_TOTAL_COUNT, TUnit::UNIT, 1);
759
760
3.55k
        _spill_max_rows_of_partition = ADD_COUNTER_WITH_LEVEL(
761
3.55k
                Base::custom_profile(), profile::SPILL_MAX_ROWS_OF_PARTITION, TUnit::UNIT, 1);
762
3.55k
        _spill_min_rows_of_partition = ADD_COUNTER_WITH_LEVEL(
763
3.55k
                Base::custom_profile(), profile::SPILL_MIN_ROWS_OF_PARTITION, TUnit::UNIT, 1);
764
3.55k
    }
_ZN5doris28PipelineXSpillSinkLocalStateINS_30PartitionedHashJoinSharedStateEE19init_spill_countersEv
Line
Count
Source
745
8
    void init_spill_counters() {
746
8
        _spill_total_timer =
747
8
                ADD_TIMER_WITH_LEVEL(Base::custom_profile(), profile::SPILL_TOTAL_TIME, 1);
748
749
8
        _write_counters.init(Base::custom_profile());
750
751
        // SpillFileWriter looks up these counters via get_counter() in its
752
        // constructor. They must be registered on the CustomCounters profile
753
        // before any SpillFileWriter is created, otherwise the lookups return
754
        // nullptr and COUNTER_UPDATE will SEGV.
755
8
        _spill_write_file_total_size = ADD_COUNTER_WITH_LEVEL(
756
8
                Base::custom_profile(), profile::SPILL_WRITE_FILE_BYTES, TUnit::BYTES, 1);
757
8
        _spill_file_total_count = ADD_COUNTER_WITH_LEVEL(
758
8
                Base::custom_profile(), profile::SPILL_WRITE_FILE_TOTAL_COUNT, TUnit::UNIT, 1);
759
760
8
        _spill_max_rows_of_partition = ADD_COUNTER_WITH_LEVEL(
761
8
                Base::custom_profile(), profile::SPILL_MAX_ROWS_OF_PARTITION, TUnit::UNIT, 1);
762
8
        _spill_min_rows_of_partition = ADD_COUNTER_WITH_LEVEL(
763
8
                Base::custom_profile(), profile::SPILL_MIN_ROWS_OF_PARTITION, TUnit::UNIT, 1);
764
8
    }
_ZN5doris28PipelineXSpillSinkLocalStateINS_20SpillSortSharedStateEE19init_spill_countersEv
Line
Count
Source
745
42
    void init_spill_counters() {
746
42
        _spill_total_timer =
747
42
                ADD_TIMER_WITH_LEVEL(Base::custom_profile(), profile::SPILL_TOTAL_TIME, 1);
748
749
42
        _write_counters.init(Base::custom_profile());
750
751
        // SpillFileWriter looks up these counters via get_counter() in its
752
        // constructor. They must be registered on the CustomCounters profile
753
        // before any SpillFileWriter is created, otherwise the lookups return
754
        // nullptr and COUNTER_UPDATE will SEGV.
755
42
        _spill_write_file_total_size = ADD_COUNTER_WITH_LEVEL(
756
42
                Base::custom_profile(), profile::SPILL_WRITE_FILE_BYTES, TUnit::BYTES, 1);
757
42
        _spill_file_total_count = ADD_COUNTER_WITH_LEVEL(
758
42
                Base::custom_profile(), profile::SPILL_WRITE_FILE_TOTAL_COUNT, TUnit::UNIT, 1);
759
760
42
        _spill_max_rows_of_partition = ADD_COUNTER_WITH_LEVEL(
761
42
                Base::custom_profile(), profile::SPILL_MAX_ROWS_OF_PARTITION, TUnit::UNIT, 1);
762
42
        _spill_min_rows_of_partition = ADD_COUNTER_WITH_LEVEL(
763
42
                Base::custom_profile(), profile::SPILL_MIN_ROWS_OF_PARTITION, TUnit::UNIT, 1);
764
42
    }
_ZN5doris28PipelineXSpillSinkLocalStateINS_25PartitionedAggSharedStateEE19init_spill_countersEv
Line
Count
Source
745
231
    void init_spill_counters() {
746
231
        _spill_total_timer =
747
231
                ADD_TIMER_WITH_LEVEL(Base::custom_profile(), profile::SPILL_TOTAL_TIME, 1);
748
749
231
        _write_counters.init(Base::custom_profile());
750
751
        // SpillFileWriter looks up these counters via get_counter() in its
752
        // constructor. They must be registered on the CustomCounters profile
753
        // before any SpillFileWriter is created, otherwise the lookups return
754
        // nullptr and COUNTER_UPDATE will SEGV.
755
231
        _spill_write_file_total_size = ADD_COUNTER_WITH_LEVEL(
756
231
                Base::custom_profile(), profile::SPILL_WRITE_FILE_BYTES, TUnit::BYTES, 1);
757
231
        _spill_file_total_count = ADD_COUNTER_WITH_LEVEL(
758
231
                Base::custom_profile(), profile::SPILL_WRITE_FILE_TOTAL_COUNT, TUnit::UNIT, 1);
759
760
231
        _spill_max_rows_of_partition = ADD_COUNTER_WITH_LEVEL(
761
231
                Base::custom_profile(), profile::SPILL_MAX_ROWS_OF_PARTITION, TUnit::UNIT, 1);
762
231
        _spill_min_rows_of_partition = ADD_COUNTER_WITH_LEVEL(
763
231
                Base::custom_profile(), profile::SPILL_MIN_ROWS_OF_PARTITION, TUnit::UNIT, 1);
764
231
    }
765
766
3.81k
    std::vector<Dependency*> dependencies() const override {
767
3.81k
        auto dependencies = Base::dependencies();
768
3.81k
        return dependencies;
769
3.81k
    }
_ZNK5doris28PipelineXSpillSinkLocalStateINS_20MultiCastSharedStateEE12dependenciesEv
Line
Count
Source
766
3.56k
    std::vector<Dependency*> dependencies() const override {
767
3.56k
        auto dependencies = Base::dependencies();
768
3.56k
        return dependencies;
769
3.56k
    }
Unexecuted instantiation: _ZNK5doris28PipelineXSpillSinkLocalStateINS_30PartitionedHashJoinSharedStateEE12dependenciesEv
_ZNK5doris28PipelineXSpillSinkLocalStateINS_20SpillSortSharedStateEE12dependenciesEv
Line
Count
Source
766
26
    std::vector<Dependency*> dependencies() const override {
767
26
        auto dependencies = Base::dependencies();
768
26
        return dependencies;
769
26
    }
_ZNK5doris28PipelineXSpillSinkLocalStateINS_25PartitionedAggSharedStateEE12dependenciesEv
Line
Count
Source
766
216
    std::vector<Dependency*> dependencies() const override {
767
216
        auto dependencies = Base::dependencies();
768
216
        return dependencies;
769
216
    }
770
771
1.72k
    void update_max_min_rows_counter() {
772
1.72k
        int64_t max_rows = 0;
773
1.72k
        int64_t min_rows = std::numeric_limits<int64_t>::max();
774
775
7.09k
        for (auto rows : _rows_in_partitions) {
776
7.09k
            if (rows > max_rows) {
777
11
                max_rows = rows;
778
11
            }
779
7.09k
            if (rows < min_rows) {
780
1.72k
                min_rows = rows;
781
1.72k
            }
782
7.09k
        }
783
784
1.72k
        COUNTER_SET(_spill_max_rows_of_partition, max_rows);
785
1.72k
        COUNTER_SET(_spill_min_rows_of_partition, min_rows);
786
1.72k
    }
_ZN5doris28PipelineXSpillSinkLocalStateINS_30PartitionedHashJoinSharedStateEE27update_max_min_rows_counterEv
Line
Count
Source
771
4
    void update_max_min_rows_counter() {
772
4
        int64_t max_rows = 0;
773
4
        int64_t min_rows = std::numeric_limits<int64_t>::max();
774
775
32
        for (auto rows : _rows_in_partitions) {
776
32
            if (rows > max_rows) {
777
4
                max_rows = rows;
778
4
            }
779
32
            if (rows < min_rows) {
780
6
                min_rows = rows;
781
6
            }
782
32
        }
783
784
4
        COUNTER_SET(_spill_max_rows_of_partition, max_rows);
785
4
        COUNTER_SET(_spill_min_rows_of_partition, min_rows);
786
4
    }
_ZN5doris28PipelineXSpillSinkLocalStateINS_25PartitionedAggSharedStateEE27update_max_min_rows_counterEv
Line
Count
Source
771
1.72k
    void update_max_min_rows_counter() {
772
1.72k
        int64_t max_rows = 0;
773
1.72k
        int64_t min_rows = std::numeric_limits<int64_t>::max();
774
775
7.06k
        for (auto rows : _rows_in_partitions) {
776
7.06k
            if (rows > max_rows) {
777
7
                max_rows = rows;
778
7
            }
779
7.06k
            if (rows < min_rows) {
780
1.72k
                min_rows = rows;
781
1.72k
            }
782
7.06k
        }
783
784
1.72k
        COUNTER_SET(_spill_max_rows_of_partition, max_rows);
785
1.72k
        COUNTER_SET(_spill_min_rows_of_partition, min_rows);
786
1.72k
    }
787
788
    std::vector<int64_t> _rows_in_partitions;
789
790
    // Total time of spill, including spill task scheduling time,
791
    // serialize block time, write disk file time,
792
    // and read disk file time, deserialize block time etc.
793
    RuntimeProfile::Counter* _spill_total_timer = nullptr;
794
795
    // Shared spill write counters
796
    SpillWriteCounters _write_counters;
797
    // Backward-compatible aliases for commonly accessed write counters
798
    RuntimeProfile::Counter*& _spill_write_file_timer = _write_counters.spill_write_file_timer;
799
    RuntimeProfile::Counter*& _spill_write_serialize_block_timer =
800
            _write_counters.spill_write_serialize_block_timer;
801
    RuntimeProfile::Counter*& _spill_write_block_count = _write_counters.spill_write_block_count;
802
    RuntimeProfile::Counter*& _spill_write_block_data_size =
803
            _write_counters.spill_write_block_data_size;
804
    RuntimeProfile::Counter*& _spill_write_rows_count = _write_counters.spill_write_rows_count;
805
806
    // Sink-only counters
807
    // Total bytes written to spill files (required by SpillFileWriter)
808
    RuntimeProfile::Counter* _spill_write_file_total_size = nullptr;
809
    // Total number of spill files created (required by SpillFileWriter)
810
    RuntimeProfile::Counter* _spill_file_total_count = nullptr;
811
    RuntimeProfile::Counter* _spill_max_rows_of_partition = nullptr;
812
    RuntimeProfile::Counter* _spill_min_rows_of_partition = nullptr;
813
};
814
815
class OperatorXBase : public OperatorBase {
816
public:
817
    OperatorXBase(ObjectPool* pool, const TPlanNode& tnode, const int operator_id,
818
                  const DescriptorTbl& descs)
819
905k
            : OperatorBase(tnode.__isset.is_serial_operator && tnode.is_serial_operator),
820
905k
              _operator_id(operator_id),
821
905k
              _node_id(tnode.node_id),
822
905k
              _type(tnode.node_type),
823
905k
              _pool(pool),
824
905k
              _tuple_ids(tnode.row_tuples),
825
905k
              _row_descriptor(descs, tnode.row_tuples),
826
905k
              _resource_profile(tnode.resource_profile),
827
905k
              _limit(tnode.limit) {
828
905k
        if (tnode.__isset.output_tuple_id) {
829
382k
            _output_row_descriptor =
830
382k
                    std::make_unique<RowDescriptor>(descs, std::vector {tnode.output_tuple_id});
831
382k
        }
832
905k
        if (!tnode.intermediate_output_tuple_id_list.empty()) {
833
            // common subexpression elimination
834
4.14k
            _intermediate_output_row_descriptor.reserve(
835
4.14k
                    tnode.intermediate_output_tuple_id_list.size());
836
8.45k
            for (auto output_tuple_id : tnode.intermediate_output_tuple_id_list) {
837
8.45k
                _intermediate_output_row_descriptor.push_back(
838
8.45k
                        RowDescriptor(descs, std::vector {output_tuple_id}));
839
8.45k
            }
840
4.14k
        }
841
905k
    }
842
843
    OperatorXBase(ObjectPool* pool, int node_id, int operator_id)
844
8.96k
            : OperatorBase(),
845
8.96k
              _operator_id(operator_id),
846
8.96k
              _node_id(node_id),
847
8.96k
              _pool(pool),
848
8.96k
              _limit(-1) {}
849
850
#ifdef BE_TEST
851
    OperatorXBase() : _operator_id(-1), _node_id(0), _limit(-1) {};
852
#endif
853
    virtual Status init(const TPlanNode& tnode, RuntimeState* state);
854
0
    Status init(const TDataSink& tsink) override {
855
0
        throw Exception(Status::FatalError("should not reach here!"));
856
0
    }
857
0
    virtual Status init(TLocalPartitionType::type type) {
858
0
        throw Exception(Status::FatalError("should not reach here!"));
859
0
    }
860
0
    [[noreturn]] virtual const std::vector<TRuntimeFilterDesc>& runtime_filter_descs() {
861
0
        throw doris::Exception(ErrorCode::NOT_IMPLEMENTED_ERROR, _op_name);
862
0
    }
863
864
    // Per-fragment shared partition-boundary parse result, used for
865
    // runtime-filter partition pruning. Returns nullptr for operators that
866
    // don't support this feature (default). Scan operators override to expose
867
    // their parsed boundaries; the per-instance pruning state lives on the
868
    // ScanLocalState. This sits on the generic OperatorXBase so non-templated
869
    // ScanLocalStateBase methods can fetch it without down-casting `_parent`
870
    // to a specific scan type.
871
0
    virtual const ParsedPartitionBoundaries* parsed_partition_boundaries() const { return nullptr; }
872
4.68M
    [[nodiscard]] std::string get_name() const override { return _op_name; }
873
7.32M
    [[nodiscard]] virtual bool need_more_input_data(RuntimeState* state) const { return true; }
874
9.25M
    bool is_blockable(RuntimeState* state) const override {
875
9.25M
        return state->get_sink_local_state()->is_blockable() || _blockable;
876
9.25M
    }
877
878
    Status prepare(RuntimeState* state) override;
879
880
    Status terminate(RuntimeState* state) override;
881
7.95M
    [[nodiscard]] Status get_block(RuntimeState* state, Block* block, bool* eos) {
882
7.95M
        RETURN_IF_ERROR(get_block_impl(state, block, eos));
883
7.94M
        RETURN_IF_ERROR(block->check_column_and_type_not_null());
884
7.94M
        RETURN_IF_ERROR(block->check_no_column_string64());
885
7.94M
        RETURN_IF_ERROR(block->check_type_and_column());
886
7.94M
        return Status::OK();
887
7.94M
    }
888
889
    [[nodiscard]] virtual Status get_block_impl(RuntimeState* state, Block* block, bool* eos) = 0;
890
891
    Status close(RuntimeState* state) override;
892
893
2.06M
    [[nodiscard]] virtual const RowDescriptor& intermediate_row_desc() const {
894
2.06M
        return _row_descriptor;
895
2.06M
    }
896
897
8.45k
    [[nodiscard]] const RowDescriptor& intermediate_row_desc(int idx) {
898
8.45k
        if (idx == 0) {
899
4.14k
            return intermediate_row_desc();
900
4.14k
        }
901
8.45k
        DCHECK((idx - 1) < _intermediate_output_row_descriptor.size());
902
4.30k
        return _intermediate_output_row_descriptor[idx - 1];
903
8.45k
    }
904
905
897k
    [[nodiscard]] const RowDescriptor& projections_row_desc() const {
906
897k
        if (_intermediate_output_row_descriptor.empty()) {
907
893k
            return intermediate_row_desc();
908
893k
        } else {
909
3.69k
            return _intermediate_output_row_descriptor.back();
910
3.69k
        }
911
897k
    }
912
913
    // Returns the memory this single operator expects to allocate in the next
914
    // execution round.  Each operator reports only its OWN requirement — the
915
    // pipeline task is responsible for summing all operators + sink.
916
    // After the value is consumed the caller should invoke
917
    // reset_reserve_mem_size() so the next round starts from zero.
918
    // If this method is not overridden by a subclass, its default value is the
919
    // minimum operator memory (typically 1 MB).
920
0
    [[nodiscard]] virtual size_t get_reserve_mem_size(RuntimeState* state) {
921
0
        return state->minimum_operator_memory_required_bytes();
922
0
    }
923
924
    virtual std::string debug_string(int indentation_level = 0) const;
925
926
    virtual std::string debug_string(RuntimeState* state, int indentation_level = 0) const;
927
928
    virtual Status setup_local_state(RuntimeState* state, LocalStateInfo& info) = 0;
929
930
    template <class TARGET>
931
43.7M
    TARGET& cast() {
932
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
933
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
934
18.4E
                << " and expect type is" << typeid(TARGET).name();
935
43.7M
        return reinterpret_cast<TARGET&>(*this);
936
43.7M
    }
_ZN5doris13OperatorXBase4castINS_17FileScanOperatorXEEERT_v
Line
Count
Source
931
1.05M
    TARGET& cast() {
932
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
933
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
934
18.4E
                << " and expect type is" << typeid(TARGET).name();
935
1.05M
        return reinterpret_cast<TARGET&>(*this);
936
1.05M
    }
_ZN5doris13OperatorXBase4castINS_20GroupCommitOperatorXEEERT_v
Line
Count
Source
931
966
    TARGET& cast() {
932
966
        DCHECK(dynamic_cast<TARGET*>(this))
933
0
                << " Mismatch type! Current type is " << typeid(*this).name()
934
0
                << " and expect type is" << typeid(TARGET).name();
935
966
        return reinterpret_cast<TARGET&>(*this);
936
966
    }
Unexecuted instantiation: _ZN5doris13OperatorXBase4castINS_17JDBCScanOperatorXEEERT_v
_ZN5doris13OperatorXBase4castINS_17MetaScanOperatorXEEERT_v
Line
Count
Source
931
53.0k
    TARGET& cast() {
932
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
933
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
934
18.4E
                << " and expect type is" << typeid(TARGET).name();
935
53.0k
        return reinterpret_cast<TARGET&>(*this);
936
53.0k
    }
_ZN5doris13OperatorXBase4castINS_17OlapScanOperatorXEEERT_v
Line
Count
Source
931
36.9M
    TARGET& cast() {
932
36.9M
        DCHECK(dynamic_cast<TARGET*>(this))
933
1.76k
                << " Mismatch type! Current type is " << typeid(*this).name()
934
1.76k
                << " and expect type is" << typeid(TARGET).name();
935
36.9M
        return reinterpret_cast<TARGET&>(*this);
936
36.9M
    }
_ZN5doris13OperatorXBase4castINS_22HashJoinProbeOperatorXEEERT_v
Line
Count
Source
931
353k
    TARGET& cast() {
932
353k
        DCHECK(dynamic_cast<TARGET*>(this))
933
63
                << " Mismatch type! Current type is " << typeid(*this).name()
934
63
                << " and expect type is" << typeid(TARGET).name();
935
353k
        return reinterpret_cast<TARGET&>(*this);
936
353k
    }
_ZN5doris13OperatorXBase4castINS_28NestedLoopJoinProbeOperatorXEEERT_v
Line
Count
Source
931
2.34M
    TARGET& cast() {
932
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
933
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
934
18.4E
                << " and expect type is" << typeid(TARGET).name();
935
2.34M
        return reinterpret_cast<TARGET&>(*this);
936
2.34M
    }
_ZN5doris13OperatorXBase4castINS_33PartitionedHashJoinProbeOperatorXEEERT_v
Line
Count
Source
931
21
    TARGET& cast() {
932
21
        DCHECK(dynamic_cast<TARGET*>(this))
933
0
                << " Mismatch type! Current type is " << typeid(*this).name()
934
0
                << " and expect type is" << typeid(TARGET).name();
935
21
        return reinterpret_cast<TARGET&>(*this);
936
21
    }
_ZN5doris13OperatorXBase4castINS_24SpillSortSourceOperatorXEEERT_v
Line
Count
Source
931
48
    TARGET& cast() {
932
48
        DCHECK(dynamic_cast<TARGET*>(this))
933
0
                << " Mismatch type! Current type is " << typeid(*this).name()
934
0
                << " and expect type is" << typeid(TARGET).name();
935
48
        return reinterpret_cast<TARGET&>(*this);
936
48
    }
_ZN5doris13OperatorXBase4castINS_29LocalMergeSortSourceOperatorXEEERT_v
Line
Count
Source
931
90.9k
    TARGET& cast() {
932
90.9k
        DCHECK(dynamic_cast<TARGET*>(this))
933
0
                << " Mismatch type! Current type is " << typeid(*this).name()
934
0
                << " and expect type is" << typeid(TARGET).name();
935
90.9k
        return reinterpret_cast<TARGET&>(*this);
936
90.9k
    }
_ZN5doris13OperatorXBase4castINS_18AggSourceOperatorXEEERT_v
Line
Count
Source
931
241k
    TARGET& cast() {
932
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
933
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
934
18.4E
                << " and expect type is" << typeid(TARGET).name();
935
241k
        return reinterpret_cast<TARGET&>(*this);
936
241k
    }
_ZN5doris13OperatorXBase4castINS_26BucketedAggSourceOperatorXEEERT_v
Line
Count
Source
931
1.64k
    TARGET& cast() {
932
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
933
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
934
18.4E
                << " and expect type is" << typeid(TARGET).name();
935
1.64k
        return reinterpret_cast<TARGET&>(*this);
936
1.64k
    }
_ZN5doris13OperatorXBase4castINS_29PartitionedAggSourceOperatorXEEERT_v
Line
Count
Source
931
231
    TARGET& cast() {
932
231
        DCHECK(dynamic_cast<TARGET*>(this))
933
0
                << " Mismatch type! Current type is " << typeid(*this).name()
934
0
                << " and expect type is" << typeid(TARGET).name();
935
231
        return reinterpret_cast<TARGET&>(*this);
936
231
    }
_ZN5doris13OperatorXBase4castINS_22TableFunctionOperatorXEEERT_v
Line
Count
Source
931
29.5k
    TARGET& cast() {
932
29.5k
        DCHECK(dynamic_cast<TARGET*>(this))
933
2
                << " Mismatch type! Current type is " << typeid(*this).name()
934
2
                << " and expect type is" << typeid(TARGET).name();
935
29.5k
        return reinterpret_cast<TARGET&>(*this);
936
29.5k
    }
_ZN5doris13OperatorXBase4castINS_23ExchangeSourceOperatorXEEERT_v
Line
Count
Source
931
767k
    TARGET& cast() {
932
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
933
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
934
18.4E
                << " and expect type is" << typeid(TARGET).name();
935
767k
        return reinterpret_cast<TARGET&>(*this);
936
767k
    }
_ZN5doris13OperatorXBase4castINS_15RepeatOperatorXEEERT_v
Line
Count
Source
931
6.69k
    TARGET& cast() {
932
6.69k
        DCHECK(dynamic_cast<TARGET*>(this))
933
0
                << " Mismatch type! Current type is " << typeid(*this).name()
934
0
                << " and expect type is" << typeid(TARGET).name();
935
6.69k
        return reinterpret_cast<TARGET&>(*this);
936
6.69k
    }
_ZN5doris13OperatorXBase4castINS_20UnionSourceOperatorXEEERT_v
Line
Count
Source
931
168k
    TARGET& cast() {
932
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
933
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
934
18.4E
                << " and expect type is" << typeid(TARGET).name();
935
168k
        return reinterpret_cast<TARGET&>(*this);
936
168k
    }
_ZN5doris13OperatorXBase4castINS_36MultiCastDataStreamerSourceOperatorXEEERT_v
Line
Count
Source
931
20.0k
    TARGET& cast() {
932
20.0k
        DCHECK(dynamic_cast<TARGET*>(this))
933
4
                << " Mismatch type! Current type is " << typeid(*this).name()
934
4
                << " and expect type is" << typeid(TARGET).name();
935
20.0k
        return reinterpret_cast<TARGET&>(*this);
936
20.0k
    }
_ZN5doris13OperatorXBase4castINS_18SetSourceOperatorXILb1EEEEERT_v
Line
Count
Source
931
4.92k
    TARGET& cast() {
932
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
933
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
934
18.4E
                << " and expect type is" << typeid(TARGET).name();
935
4.92k
        return reinterpret_cast<TARGET&>(*this);
936
4.92k
    }
_ZN5doris13OperatorXBase4castINS_18SetSourceOperatorXILb0EEEEERT_v
Line
Count
Source
931
4.56k
    TARGET& cast() {
932
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
933
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
934
18.4E
                << " and expect type is" << typeid(TARGET).name();
935
4.56k
        return reinterpret_cast<TARGET&>(*this);
936
4.56k
    }
_ZN5doris13OperatorXBase4castINS_22DataGenSourceOperatorXEEERT_v
Line
Count
Source
931
522
    TARGET& cast() {
932
522
        DCHECK(dynamic_cast<TARGET*>(this))
933
0
                << " Mismatch type! Current type is " << typeid(*this).name()
934
0
                << " and expect type is" << typeid(TARGET).name();
935
522
        return reinterpret_cast<TARGET&>(*this);
936
522
    }
_ZN5doris13OperatorXBase4castINS_19SchemaScanOperatorXEEERT_v
Line
Count
Source
931
2.24k
    TARGET& cast() {
932
2.24k
        DCHECK(dynamic_cast<TARGET*>(this))
933
0
                << " Mismatch type! Current type is " << typeid(*this).name()
934
0
                << " and expect type is" << typeid(TARGET).name();
935
2.24k
        return reinterpret_cast<TARGET&>(*this);
936
2.24k
    }
_ZN5doris13OperatorXBase4castINS_20CacheSourceOperatorXEEERT_v
Line
Count
Source
931
40
    TARGET& cast() {
932
40
        DCHECK(dynamic_cast<TARGET*>(this))
933
0
                << " Mismatch type! Current type is " << typeid(*this).name()
934
0
                << " and expect type is" << typeid(TARGET).name();
935
40
        return reinterpret_cast<TARGET&>(*this);
936
40
    }
_ZN5doris13OperatorXBase4castINS_21RecCTESourceOperatorXEEERT_v
Line
Count
Source
931
655
    TARGET& cast() {
932
655
        DCHECK(dynamic_cast<TARGET*>(this))
933
0
                << " Mismatch type! Current type is " << typeid(*this).name()
934
0
                << " and expect type is" << typeid(TARGET).name();
935
655
        return reinterpret_cast<TARGET&>(*this);
936
655
    }
_ZN5doris13OperatorXBase4castINS_21StreamingAggOperatorXEEERT_v
Line
Count
Source
931
700k
    TARGET& cast() {
932
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
933
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
934
18.4E
                << " and expect type is" << typeid(TARGET).name();
935
700k
        return reinterpret_cast<TARGET&>(*this);
936
700k
    }
_ZN5doris13OperatorXBase4castINS_29DistinctStreamingAggOperatorXEEERT_v
Line
Count
Source
931
950k
    TARGET& cast() {
932
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
933
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
934
18.4E
                << " and expect type is" << typeid(TARGET).name();
935
950k
        return reinterpret_cast<TARGET&>(*this);
936
950k
    }
937
    template <class TARGET>
938
    const TARGET& cast() const {
939
        DCHECK(dynamic_cast<const TARGET*>(this))
940
                << " Mismatch type! Current type is " << typeid(*this).name()
941
                << " and expect type is" << typeid(TARGET).name();
942
        return reinterpret_cast<const TARGET&>(*this);
943
    }
944
945
87.8k
    [[nodiscard]] OperatorPtr get_child() { return _child; }
946
947
10.6k
    [[nodiscard]] VExprContextSPtrs& conjuncts() { return _conjuncts; }
948
6.40k
    [[nodiscard]] VExprContextSPtrs& projections() { return _projections; }
949
2.56M
    [[nodiscard]] virtual RowDescriptor& row_descriptor() { return _row_descriptor; }
950
951
79.5M
    [[nodiscard]] int operator_id() const { return _operator_id; }
952
11.8M
    [[nodiscard]] int node_id() const override { return _node_id; }
953
3.89M
    [[nodiscard]] int nereids_id() const { return _nereids_id; }
954
955
616k
    [[nodiscard]] int64_t limit() const { return _limit; }
956
957
12.8M
    [[nodiscard]] const RowDescriptor& row_desc() const override {
958
12.8M
        return _output_row_descriptor ? *_output_row_descriptor : _row_descriptor;
959
12.8M
    }
960
961
1.74M
    [[nodiscard]] const RowDescriptor* output_row_descriptor() {
962
1.74M
        return _output_row_descriptor.get();
963
1.74M
    }
964
965
889k
    bool has_output_row_desc() const { return _output_row_descriptor != nullptr; }
966
967
    [[nodiscard]] virtual Status get_block_after_projects(RuntimeState* state, Block* block,
968
                                                          bool* eos);
969
970
    /// Only use in vectorized exec engine try to do projections to trans _row_desc -> _output_row_desc
971
    Status do_projections(RuntimeState* state, Block* origin_block, Block* output_block) const;
972
1.39M
    void set_parallel_tasks(int parallel_tasks) { _parallel_tasks = parallel_tasks; }
973
98
    int parallel_tasks() const { return _parallel_tasks; }
974
975
    // To keep compatibility with older FE
976
1
    void set_serial_operator() { _is_serial_operator = true; }
977
978
    // Resets this operator's estimated memory usage to zero so that the next
979
    // call to get_reserve_mem_size() starts fresh.  The pipeline task calls
980
    // this after consuming the reserve size for all operators in a round.
981
0
    virtual void reset_reserve_mem_size(RuntimeState* state) {}
982
983
protected:
984
    template <typename Dependency>
985
    friend class PipelineXLocalState;
986
    friend class PipelineXLocalStateBase;
987
    friend class Scanner;
988
    const int _operator_id;
989
    const int _node_id; // unique w/in single plan tree
990
    int _nereids_id = -1;
991
    TPlanNodeType::type _type;
992
    ObjectPool* _pool = nullptr;
993
    std::vector<TupleId> _tuple_ids;
994
995
private:
996
    // The expr of operator set to private permissions, as cannot be executed concurrently,
997
    // should use local state's expr.
998
    VExprContextSPtrs _conjuncts;
999
    VExprContextSPtrs _projections;
1000
    // Used in common subexpression elimination to compute intermediate results.
1001
    std::vector<VExprContextSPtrs> _intermediate_projections;
1002
1003
protected:
1004
    RowDescriptor _row_descriptor;
1005
    std::unique_ptr<RowDescriptor> _output_row_descriptor = nullptr;
1006
    std::vector<RowDescriptor> _intermediate_output_row_descriptor;
1007
1008
    /// Resource information sent from the frontend.
1009
    const TBackendResourceProfile _resource_profile;
1010
1011
    int64_t _limit; // -1: no limit
1012
1013
    uint32_t _debug_point_count = 0;
1014
    std::atomic_uint32_t _bytes_per_row = 0;
1015
1016
    std::string _op_name;
1017
    int _parallel_tasks = 0;
1018
1019
    // _blockable is true if the operator contains expressions that may block execution
1020
    bool _blockable = false;
1021
};
1022
1023
template <typename LocalStateType>
1024
class OperatorX : public OperatorXBase {
1025
public:
1026
    OperatorX(ObjectPool* pool, const TPlanNode& tnode, const int operator_id,
1027
              const DescriptorTbl& descs)
1028
906k
            : OperatorXBase(pool, tnode, operator_id, descs) {}
_ZN5doris9OperatorXINS_21UnionSourceLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1028
55.3k
            : OperatorXBase(pool, tnode, operator_id, descs) {}
_ZN5doris9OperatorXINS_29PartitionSortSourceLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1028
70
            : OperatorXBase(pool, tnode, operator_id, descs) {}
_ZN5doris9OperatorXINS_25MaterializationLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1028
1.74k
            : OperatorXBase(pool, tnode, operator_id, descs) {}
_ZN5doris9OperatorXINS_19SetSourceLocalStateILb1EEEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1028
181
            : OperatorXBase(pool, tnode, operator_id, descs) {}
_ZN5doris9OperatorXINS_19SetSourceLocalStateILb0EEEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1028
161
            : OperatorXBase(pool, tnode, operator_id, descs) {}
_ZN5doris9OperatorXINS_18EmptySetLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1028
1.99k
            : OperatorXBase(pool, tnode, operator_id, descs) {}
_ZN5doris9OperatorXINS_16SelectLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1028
2.63k
            : OperatorXBase(pool, tnode, operator_id, descs) {}
_ZN5doris9OperatorXINS_22RecCTESourceLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1028
164
            : OperatorXBase(pool, tnode, operator_id, descs) {}
_ZN5doris9OperatorXINS_20RecCTEScanLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1028
2.18k
            : OperatorXBase(pool, tnode, operator_id, descs) {}
_ZN5doris9OperatorXINS_29LocalExchangeSourceLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1028
121k
            : OperatorXBase(pool, tnode, operator_id, descs) {}
_ZN5doris9OperatorXINS_23HashJoinProbeLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1028
82.9k
            : OperatorXBase(pool, tnode, operator_id, descs) {}
_ZN5doris9OperatorXINS_18OlapScanLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1028
233k
            : OperatorXBase(pool, tnode, operator_id, descs) {}
_ZN5doris9OperatorXINS_21GroupCommitLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1028
138
            : OperatorXBase(pool, tnode, operator_id, descs) {}
Unexecuted instantiation: _ZN5doris9OperatorXINS_18JDBCScanLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
_ZN5doris9OperatorXINS_18FileScanLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1028
29.0k
            : OperatorXBase(pool, tnode, operator_id, descs) {}
_ZN5doris9OperatorXINS_18AnalyticLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1028
1.83k
            : OperatorXBase(pool, tnode, operator_id, descs) {}
_ZN5doris9OperatorXINS_14SortLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1028
2.49k
            : OperatorXBase(pool, tnode, operator_id, descs) {}
_ZN5doris9OperatorXINS_19SpillSortLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1028
31
            : OperatorXBase(pool, tnode, operator_id, descs) {}
_ZN5doris9OperatorXINS_24LocalMergeSortLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1028
45.5k
            : OperatorXBase(pool, tnode, operator_id, descs) {}
_ZN5doris9OperatorXINS_13AggLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1028
59.1k
            : OperatorXBase(pool, tnode, operator_id, descs) {}
_ZN5doris9OperatorXINS_21BucketedAggLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1028
63
            : OperatorXBase(pool, tnode, operator_id, descs) {}
_ZN5doris9OperatorXINS_24PartitionedAggLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1028
220
            : OperatorXBase(pool, tnode, operator_id, descs) {}
_ZN5doris9OperatorXINS_23TableFunctionLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1028
924
            : OperatorXBase(pool, tnode, operator_id, descs) {}
_ZN5doris9OperatorXINS_18ExchangeLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1028
160k
            : OperatorXBase(pool, tnode, operator_id, descs) {}
_ZN5doris9OperatorXINS_16RepeatLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1028
346
            : OperatorXBase(pool, tnode, operator_id, descs) {}
_ZN5doris9OperatorXINS_29NestedLoopJoinProbeLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1028
6.42k
            : OperatorXBase(pool, tnode, operator_id, descs) {}
_ZN5doris9OperatorXINS_23AssertNumRowsLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1028
218
            : OperatorXBase(pool, tnode, operator_id, descs) {}
Unexecuted instantiation: _ZN5doris9OperatorXINS_35MultiCastDataStreamSourceLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
_ZN5doris9OperatorXINS_17DataGenLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1028
519
            : OperatorXBase(pool, tnode, operator_id, descs) {}
_ZN5doris9OperatorXINS_20SchemaScanLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1028
2.24k
            : OperatorXBase(pool, tnode, operator_id, descs) {}
_ZN5doris9OperatorXINS_18MetaScanLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1028
6.62k
            : OperatorXBase(pool, tnode, operator_id, descs) {}
_ZN5doris9OperatorXINS_34PartitionedHashJoinProbeLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1028
52
            : OperatorXBase(pool, tnode, operator_id, descs) {}
Unexecuted instantiation: _ZN5doris9OperatorXINS_21CacheSourceLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
_ZN5doris9OperatorXINS_22StreamingAggLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1028
1.68k
            : OperatorXBase(pool, tnode, operator_id, descs) {}
_ZN5doris9OperatorXINS_30DistinctStreamingAggLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1028
85.7k
            : OperatorXBase(pool, tnode, operator_id, descs) {}
1029
    OperatorX(ObjectPool* pool, int node_id, int operator_id)
1030
8.94k
            : OperatorXBase(pool, node_id, operator_id) {};
_ZN5doris9OperatorXINS_21CacheSourceLocalStateEEC2EPNS_10ObjectPoolEii
Line
Count
Source
1030
11
            : OperatorXBase(pool, node_id, operator_id) {};
_ZN5doris9OperatorXINS_29LocalExchangeSourceLocalStateEEC2EPNS_10ObjectPoolEii
Line
Count
Source
1030
1.09k
            : OperatorXBase(pool, node_id, operator_id) {};
_ZN5doris9OperatorXINS_35MultiCastDataStreamSourceLocalStateEEC2EPNS_10ObjectPoolEii
Line
Count
Source
1030
7.83k
            : 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_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_21BucketedAggLocalStateEEC2EPNS_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_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_34PartitionedHashJoinProbeLocalStateEEC2EPNS_10ObjectPoolEii
Unexecuted instantiation: _ZN5doris9OperatorXINS_22RecCTESourceLocalStateEEC2EPNS_10ObjectPoolEii
Unexecuted instantiation: _ZN5doris9OperatorXINS_20RecCTEScanLocalStateEEC2EPNS_10ObjectPoolEii
1031
1032
#ifdef BE_TEST
1033
    OperatorX() = default;
1034
#endif
1035
1036
    ~OperatorX() override = default;
1037
1038
    Status setup_local_state(RuntimeState* state, LocalStateInfo& info) override;
1039
    using LocalState = LocalStateType;
1040
23.1M
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
1041
23.1M
        return state->get_local_state(operator_id())->template cast<LocalState>();
1042
23.1M
    }
_ZNK5doris9OperatorXINS_22RecCTESourceLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
1040
12.7k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
1041
12.7k
        return state->get_local_state(operator_id())->template cast<LocalState>();
1042
12.7k
    }
_ZNK5doris9OperatorXINS_21CacheSourceLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
1040
89
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
1041
89
        return state->get_local_state(operator_id())->template cast<LocalState>();
1042
89
    }
_ZNK5doris9OperatorXINS_29LocalExchangeSourceLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
1040
3.51M
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
1041
3.51M
        return state->get_local_state(operator_id())->template cast<LocalState>();
1042
3.51M
    }
_ZNK5doris9OperatorXINS_35MultiCastDataStreamSourceLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
1040
118k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
1041
118k
        return state->get_local_state(operator_id())->template cast<LocalState>();
1042
118k
    }
_ZNK5doris9OperatorXINS_18OlapScanLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
1040
4.24M
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
1041
4.24M
        return state->get_local_state(operator_id())->template cast<LocalState>();
1042
4.24M
    }
_ZNK5doris9OperatorXINS_21GroupCommitLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
1040
4.77M
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
1041
4.77M
        return state->get_local_state(operator_id())->template cast<LocalState>();
1042
4.77M
    }
Unexecuted instantiation: _ZNK5doris9OperatorXINS_18JDBCScanLocalStateEE15get_local_stateEPNS_12RuntimeStateE
_ZNK5doris9OperatorXINS_18FileScanLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
1040
494k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
1041
494k
        return state->get_local_state(operator_id())->template cast<LocalState>();
1042
494k
    }
_ZNK5doris9OperatorXINS_23HashJoinProbeLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
1040
637k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
1041
637k
        return state->get_local_state(operator_id())->template cast<LocalState>();
1042
637k
    }
_ZNK5doris9OperatorXINS_34PartitionedHashJoinProbeLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
1040
59
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
1041
59
        return state->get_local_state(operator_id())->template cast<LocalState>();
1042
59
    }
_ZNK5doris9OperatorXINS_29NestedLoopJoinProbeLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
1040
129k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
1041
129k
        return state->get_local_state(operator_id())->template cast<LocalState>();
1042
129k
    }
_ZNK5doris9OperatorXINS_21UnionSourceLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
1040
309k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
1041
309k
        return state->get_local_state(operator_id())->template cast<LocalState>();
1042
309k
    }
_ZNK5doris9OperatorXINS_29PartitionSortSourceLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
1040
3.27k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
1041
3.27k
        return state->get_local_state(operator_id())->template cast<LocalState>();
1042
3.27k
    }
_ZNK5doris9OperatorXINS_25MaterializationLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
1040
38.3k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
1041
38.3k
        return state->get_local_state(operator_id())->template cast<LocalState>();
1042
38.3k
    }
_ZNK5doris9OperatorXINS_19SetSourceLocalStateILb1EEEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
1040
8.01k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
1041
8.01k
        return state->get_local_state(operator_id())->template cast<LocalState>();
1042
8.01k
    }
_ZNK5doris9OperatorXINS_19SetSourceLocalStateILb0EEEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
1040
8.44k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
1041
8.44k
        return state->get_local_state(operator_id())->template cast<LocalState>();
1042
8.44k
    }
_ZNK5doris9OperatorXINS_18EmptySetLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
1040
3.99k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
1041
3.99k
        return state->get_local_state(operator_id())->template cast<LocalState>();
1042
3.99k
    }
_ZNK5doris9OperatorXINS_18MetaScanLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
1040
20.3k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
1041
20.3k
        return state->get_local_state(operator_id())->template cast<LocalState>();
1042
20.3k
    }
_ZNK5doris9OperatorXINS_16SelectLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
1040
47.9k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
1041
47.9k
        return state->get_local_state(operator_id())->template cast<LocalState>();
1042
47.9k
    }
_ZNK5doris9OperatorXINS_20RecCTEScanLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
1040
14.9k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
1041
14.9k
        return state->get_local_state(operator_id())->template cast<LocalState>();
1042
14.9k
    }
_ZNK5doris9OperatorXINS_23TableFunctionLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
1040
31.4k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
1041
31.4k
        return state->get_local_state(operator_id())->template cast<LocalState>();
1042
31.4k
    }
_ZNK5doris9OperatorXINS_18ExchangeLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
1040
2.21M
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
1041
2.21M
        return state->get_local_state(operator_id())->template cast<LocalState>();
1042
2.21M
    }
_ZNK5doris9OperatorXINS_30DistinctStreamingAggLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
1040
4.05M
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
1041
4.05M
        return state->get_local_state(operator_id())->template cast<LocalState>();
1042
4.05M
    }
_ZNK5doris9OperatorXINS_22StreamingAggLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
1040
292k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
1041
292k
        return state->get_local_state(operator_id())->template cast<LocalState>();
1042
292k
    }
_ZNK5doris9OperatorXINS_13AggLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
1040
506k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
1041
506k
        return state->get_local_state(operator_id())->template cast<LocalState>();
1042
506k
    }
_ZNK5doris9OperatorXINS_24PartitionedAggLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
1040
940
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
1041
940
        return state->get_local_state(operator_id())->template cast<LocalState>();
1042
940
    }
_ZNK5doris9OperatorXINS_21BucketedAggLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
1040
15.8k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
1041
15.8k
        return state->get_local_state(operator_id())->template cast<LocalState>();
1042
15.8k
    }
_ZNK5doris9OperatorXINS_14SortLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
1040
32.7k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
1041
32.7k
        return state->get_local_state(operator_id())->template cast<LocalState>();
1042
32.7k
    }
_ZNK5doris9OperatorXINS_19SpillSortLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
1040
892
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
1041
892
        return state->get_local_state(operator_id())->template cast<LocalState>();
1042
892
    }
_ZNK5doris9OperatorXINS_24LocalMergeSortLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
1040
1.43M
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
1041
1.43M
        return state->get_local_state(operator_id())->template cast<LocalState>();
1042
1.43M
    }
_ZNK5doris9OperatorXINS_18AnalyticLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
1040
31.8k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
1041
31.8k
        return state->get_local_state(operator_id())->template cast<LocalState>();
1042
31.8k
    }
_ZNK5doris9OperatorXINS_16RepeatLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
1040
18.7k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
1041
18.7k
        return state->get_local_state(operator_id())->template cast<LocalState>();
1042
18.7k
    }
_ZNK5doris9OperatorXINS_23AssertNumRowsLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
1040
1.28k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
1041
1.28k
        return state->get_local_state(operator_id())->template cast<LocalState>();
1042
1.28k
    }
_ZNK5doris9OperatorXINS_17DataGenLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
1040
75.4k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
1041
75.4k
        return state->get_local_state(operator_id())->template cast<LocalState>();
1042
75.4k
    }
_ZNK5doris9OperatorXINS_20SchemaScanLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
1040
11.8k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
1041
11.8k
        return state->get_local_state(operator_id())->template cast<LocalState>();
1042
11.8k
    }
1043
1044
    // Returns memory this single operator expects to allocate in the next round.
1045
    // Does NOT include child operators — the pipeline task iterates all
1046
    // operators itself.
1047
3.34M
    size_t get_reserve_mem_size(RuntimeState* state) override {
1048
3.34M
        auto& local_state = get_local_state(state);
1049
3.34M
        auto estimated_size = local_state.estimate_memory_usage();
1050
3.34M
        if (estimated_size < state->minimum_operator_memory_required_bytes()) {
1051
3.34M
            estimated_size = state->minimum_operator_memory_required_bytes();
1052
3.34M
        }
1053
3.34M
        return estimated_size;
1054
3.34M
    }
_ZN5doris9OperatorXINS_22RecCTESourceLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1047
3.54k
    size_t get_reserve_mem_size(RuntimeState* state) override {
1048
3.54k
        auto& local_state = get_local_state(state);
1049
3.54k
        auto estimated_size = local_state.estimate_memory_usage();
1050
3.54k
        if (estimated_size < state->minimum_operator_memory_required_bytes()) {
1051
3.54k
            estimated_size = state->minimum_operator_memory_required_bytes();
1052
3.54k
        }
1053
3.54k
        return estimated_size;
1054
3.54k
    }
_ZN5doris9OperatorXINS_21CacheSourceLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1047
23
    size_t get_reserve_mem_size(RuntimeState* state) override {
1048
23
        auto& local_state = get_local_state(state);
1049
23
        auto estimated_size = local_state.estimate_memory_usage();
1050
23
        if (estimated_size < state->minimum_operator_memory_required_bytes()) {
1051
23
            estimated_size = state->minimum_operator_memory_required_bytes();
1052
23
        }
1053
23
        return estimated_size;
1054
23
    }
_ZN5doris9OperatorXINS_29LocalExchangeSourceLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1047
1.17M
    size_t get_reserve_mem_size(RuntimeState* state) override {
1048
1.17M
        auto& local_state = get_local_state(state);
1049
1.17M
        auto estimated_size = local_state.estimate_memory_usage();
1050
1.17M
        if (estimated_size < state->minimum_operator_memory_required_bytes()) {
1051
1.17M
            estimated_size = state->minimum_operator_memory_required_bytes();
1052
1.17M
        }
1053
1.17M
        return estimated_size;
1054
1.17M
    }
_ZN5doris9OperatorXINS_35MultiCastDataStreamSourceLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1047
39.8k
    size_t get_reserve_mem_size(RuntimeState* state) override {
1048
39.8k
        auto& local_state = get_local_state(state);
1049
39.8k
        auto estimated_size = local_state.estimate_memory_usage();
1050
39.9k
        if (estimated_size < state->minimum_operator_memory_required_bytes()) {
1051
39.9k
            estimated_size = state->minimum_operator_memory_required_bytes();
1052
39.9k
        }
1053
39.8k
        return estimated_size;
1054
39.8k
    }
_ZN5doris9OperatorXINS_23HashJoinProbeLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1047
149k
    size_t get_reserve_mem_size(RuntimeState* state) override {
1048
149k
        auto& local_state = get_local_state(state);
1049
149k
        auto estimated_size = local_state.estimate_memory_usage();
1050
149k
        if (estimated_size < state->minimum_operator_memory_required_bytes()) {
1051
149k
            estimated_size = state->minimum_operator_memory_required_bytes();
1052
149k
        }
1053
149k
        return estimated_size;
1054
149k
    }
_ZN5doris9OperatorXINS_34PartitionedHashJoinProbeLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1047
1
    size_t get_reserve_mem_size(RuntimeState* state) override {
1048
1
        auto& local_state = get_local_state(state);
1049
1
        auto estimated_size = local_state.estimate_memory_usage();
1050
1
        if (estimated_size < state->minimum_operator_memory_required_bytes()) {
1051
1
            estimated_size = state->minimum_operator_memory_required_bytes();
1052
1
        }
1053
1
        return estimated_size;
1054
1
    }
_ZN5doris9OperatorXINS_29NestedLoopJoinProbeLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1047
30.4k
    size_t get_reserve_mem_size(RuntimeState* state) override {
1048
30.4k
        auto& local_state = get_local_state(state);
1049
30.4k
        auto estimated_size = local_state.estimate_memory_usage();
1050
30.4k
        if (estimated_size < state->minimum_operator_memory_required_bytes()) {
1051
30.4k
            estimated_size = state->minimum_operator_memory_required_bytes();
1052
30.4k
        }
1053
30.4k
        return estimated_size;
1054
30.4k
    }
_ZN5doris9OperatorXINS_21UnionSourceLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1047
65.6k
    size_t get_reserve_mem_size(RuntimeState* state) override {
1048
65.6k
        auto& local_state = get_local_state(state);
1049
65.6k
        auto estimated_size = local_state.estimate_memory_usage();
1050
65.6k
        if (estimated_size < state->minimum_operator_memory_required_bytes()) {
1051
65.6k
            estimated_size = state->minimum_operator_memory_required_bytes();
1052
65.6k
        }
1053
65.6k
        return estimated_size;
1054
65.6k
    }
_ZN5doris9OperatorXINS_29PartitionSortSourceLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1047
960
    size_t get_reserve_mem_size(RuntimeState* state) override {
1048
960
        auto& local_state = get_local_state(state);
1049
960
        auto estimated_size = local_state.estimate_memory_usage();
1050
960
        if (estimated_size < state->minimum_operator_memory_required_bytes()) {
1051
959
            estimated_size = state->minimum_operator_memory_required_bytes();
1052
959
        }
1053
960
        return estimated_size;
1054
960
    }
_ZN5doris9OperatorXINS_25MaterializationLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1047
4.95k
    size_t get_reserve_mem_size(RuntimeState* state) override {
1048
4.95k
        auto& local_state = get_local_state(state);
1049
4.95k
        auto estimated_size = local_state.estimate_memory_usage();
1050
4.95k
        if (estimated_size < state->minimum_operator_memory_required_bytes()) {
1051
4.95k
            estimated_size = state->minimum_operator_memory_required_bytes();
1052
4.95k
        }
1053
4.95k
        return estimated_size;
1054
4.95k
    }
_ZN5doris9OperatorXINS_19SetSourceLocalStateILb1EEEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1047
2.68k
    size_t get_reserve_mem_size(RuntimeState* state) override {
1048
2.68k
        auto& local_state = get_local_state(state);
1049
2.68k
        auto estimated_size = local_state.estimate_memory_usage();
1050
2.68k
        if (estimated_size < state->minimum_operator_memory_required_bytes()) {
1051
2.68k
            estimated_size = state->minimum_operator_memory_required_bytes();
1052
2.68k
        }
1053
2.68k
        return estimated_size;
1054
2.68k
    }
_ZN5doris9OperatorXINS_19SetSourceLocalStateILb0EEEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1047
2.55k
    size_t get_reserve_mem_size(RuntimeState* state) override {
1048
2.55k
        auto& local_state = get_local_state(state);
1049
2.55k
        auto estimated_size = local_state.estimate_memory_usage();
1050
2.55k
        if (estimated_size < state->minimum_operator_memory_required_bytes()) {
1051
2.55k
            estimated_size = state->minimum_operator_memory_required_bytes();
1052
2.55k
        }
1053
2.55k
        return estimated_size;
1054
2.55k
    }
_ZN5doris9OperatorXINS_18EmptySetLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1047
1.99k
    size_t get_reserve_mem_size(RuntimeState* state) override {
1048
1.99k
        auto& local_state = get_local_state(state);
1049
1.99k
        auto estimated_size = local_state.estimate_memory_usage();
1050
1.99k
        if (estimated_size < state->minimum_operator_memory_required_bytes()) {
1051
1.99k
            estimated_size = state->minimum_operator_memory_required_bytes();
1052
1.99k
        }
1053
1.99k
        return estimated_size;
1054
1.99k
    }
_ZN5doris9OperatorXINS_16SelectLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1047
15.9k
    size_t get_reserve_mem_size(RuntimeState* state) override {
1048
15.9k
        auto& local_state = get_local_state(state);
1049
15.9k
        auto estimated_size = local_state.estimate_memory_usage();
1050
15.9k
        if (estimated_size < state->minimum_operator_memory_required_bytes()) {
1051
15.9k
            estimated_size = state->minimum_operator_memory_required_bytes();
1052
15.9k
        }
1053
15.9k
        return estimated_size;
1054
15.9k
    }
_ZN5doris9OperatorXINS_20RecCTEScanLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1047
4.97k
    size_t get_reserve_mem_size(RuntimeState* state) override {
1048
4.97k
        auto& local_state = get_local_state(state);
1049
4.97k
        auto estimated_size = local_state.estimate_memory_usage();
1050
4.97k
        if (estimated_size < state->minimum_operator_memory_required_bytes()) {
1051
4.97k
            estimated_size = state->minimum_operator_memory_required_bytes();
1052
4.97k
        }
1053
4.97k
        return estimated_size;
1054
4.97k
    }
Unexecuted instantiation: _ZN5doris9OperatorXINS_18OlapScanLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris9OperatorXINS_21GroupCommitLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris9OperatorXINS_18JDBCScanLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
_ZN5doris9OperatorXINS_18ExchangeLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1047
740k
    size_t get_reserve_mem_size(RuntimeState* state) override {
1048
740k
        auto& local_state = get_local_state(state);
1049
740k
        auto estimated_size = local_state.estimate_memory_usage();
1050
740k
        if (estimated_size < state->minimum_operator_memory_required_bytes()) {
1051
740k
            estimated_size = state->minimum_operator_memory_required_bytes();
1052
740k
        }
1053
740k
        return estimated_size;
1054
740k
    }
_ZN5doris9OperatorXINS_30DistinctStreamingAggLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1047
471k
    size_t get_reserve_mem_size(RuntimeState* state) override {
1048
471k
        auto& local_state = get_local_state(state);
1049
471k
        auto estimated_size = local_state.estimate_memory_usage();
1050
472k
        if (estimated_size < state->minimum_operator_memory_required_bytes()) {
1051
472k
            estimated_size = state->minimum_operator_memory_required_bytes();
1052
472k
        }
1053
471k
        return estimated_size;
1054
471k
    }
_ZN5doris9OperatorXINS_22StreamingAggLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1047
37.0k
    size_t get_reserve_mem_size(RuntimeState* state) override {
1048
37.0k
        auto& local_state = get_local_state(state);
1049
37.0k
        auto estimated_size = local_state.estimate_memory_usage();
1050
37.0k
        if (estimated_size < state->minimum_operator_memory_required_bytes()) {
1051
37.0k
            estimated_size = state->minimum_operator_memory_required_bytes();
1052
37.0k
        }
1053
37.0k
        return estimated_size;
1054
37.0k
    }
_ZN5doris9OperatorXINS_13AggLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1047
169k
    size_t get_reserve_mem_size(RuntimeState* state) override {
1048
169k
        auto& local_state = get_local_state(state);
1049
169k
        auto estimated_size = local_state.estimate_memory_usage();
1050
169k
        if (estimated_size < state->minimum_operator_memory_required_bytes()) {
1051
169k
            estimated_size = state->minimum_operator_memory_required_bytes();
1052
169k
        }
1053
169k
        return estimated_size;
1054
169k
    }
_ZN5doris9OperatorXINS_24PartitionedAggLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1047
216
    size_t get_reserve_mem_size(RuntimeState* state) override {
1048
216
        auto& local_state = get_local_state(state);
1049
216
        auto estimated_size = local_state.estimate_memory_usage();
1050
216
        if (estimated_size < state->minimum_operator_memory_required_bytes()) {
1051
216
            estimated_size = state->minimum_operator_memory_required_bytes();
1052
216
        }
1053
216
        return estimated_size;
1054
216
    }
_ZN5doris9OperatorXINS_21BucketedAggLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1047
5.32k
    size_t get_reserve_mem_size(RuntimeState* state) override {
1048
5.32k
        auto& local_state = get_local_state(state);
1049
5.32k
        auto estimated_size = local_state.estimate_memory_usage();
1050
5.34k
        if (estimated_size < state->minimum_operator_memory_required_bytes()) {
1051
5.34k
            estimated_size = state->minimum_operator_memory_required_bytes();
1052
5.34k
        }
1053
5.32k
        return estimated_size;
1054
5.32k
    }
_ZN5doris9OperatorXINS_14SortLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1047
10.8k
    size_t get_reserve_mem_size(RuntimeState* state) override {
1048
10.8k
        auto& local_state = get_local_state(state);
1049
10.8k
        auto estimated_size = local_state.estimate_memory_usage();
1050
10.8k
        if (estimated_size < state->minimum_operator_memory_required_bytes()) {
1051
10.8k
            estimated_size = state->minimum_operator_memory_required_bytes();
1052
10.8k
        }
1053
10.8k
        return estimated_size;
1054
10.8k
    }
_ZN5doris9OperatorXINS_19SpillSortLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1047
264
    size_t get_reserve_mem_size(RuntimeState* state) override {
1048
264
        auto& local_state = get_local_state(state);
1049
264
        auto estimated_size = local_state.estimate_memory_usage();
1050
264
        if (estimated_size < state->minimum_operator_memory_required_bytes()) {
1051
264
            estimated_size = state->minimum_operator_memory_required_bytes();
1052
264
        }
1053
264
        return estimated_size;
1054
264
    }
_ZN5doris9OperatorXINS_24LocalMergeSortLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1047
360k
    size_t get_reserve_mem_size(RuntimeState* state) override {
1048
360k
        auto& local_state = get_local_state(state);
1049
360k
        auto estimated_size = local_state.estimate_memory_usage();
1050
361k
        if (estimated_size < state->minimum_operator_memory_required_bytes()) {
1051
361k
            estimated_size = state->minimum_operator_memory_required_bytes();
1052
361k
        }
1053
360k
        return estimated_size;
1054
360k
    }
_ZN5doris9OperatorXINS_18AnalyticLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1047
10.6k
    size_t get_reserve_mem_size(RuntimeState* state) override {
1048
10.6k
        auto& local_state = get_local_state(state);
1049
10.6k
        auto estimated_size = local_state.estimate_memory_usage();
1050
10.6k
        if (estimated_size < state->minimum_operator_memory_required_bytes()) {
1051
10.6k
            estimated_size = state->minimum_operator_memory_required_bytes();
1052
10.6k
        }
1053
10.6k
        return estimated_size;
1054
10.6k
    }
_ZN5doris9OperatorXINS_16RepeatLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1047
4.44k
    size_t get_reserve_mem_size(RuntimeState* state) override {
1048
4.44k
        auto& local_state = get_local_state(state);
1049
4.44k
        auto estimated_size = local_state.estimate_memory_usage();
1050
4.44k
        if (estimated_size < state->minimum_operator_memory_required_bytes()) {
1051
4.44k
            estimated_size = state->minimum_operator_memory_required_bytes();
1052
4.44k
        }
1053
4.44k
        return estimated_size;
1054
4.44k
    }
_ZN5doris9OperatorXINS_23TableFunctionLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1047
6.48k
    size_t get_reserve_mem_size(RuntimeState* state) override {
1048
6.48k
        auto& local_state = get_local_state(state);
1049
6.48k
        auto estimated_size = local_state.estimate_memory_usage();
1050
6.48k
        if (estimated_size < state->minimum_operator_memory_required_bytes()) {
1051
6.48k
            estimated_size = state->minimum_operator_memory_required_bytes();
1052
6.48k
        }
1053
6.48k
        return estimated_size;
1054
6.48k
    }
_ZN5doris9OperatorXINS_23AssertNumRowsLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1047
427
    size_t get_reserve_mem_size(RuntimeState* state) override {
1048
427
        auto& local_state = get_local_state(state);
1049
427
        auto estimated_size = local_state.estimate_memory_usage();
1050
427
        if (estimated_size < state->minimum_operator_memory_required_bytes()) {
1051
427
            estimated_size = state->minimum_operator_memory_required_bytes();
1052
427
        }
1053
427
        return estimated_size;
1054
427
    }
_ZN5doris9OperatorXINS_17DataGenLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1047
25.1k
    size_t get_reserve_mem_size(RuntimeState* state) override {
1048
25.1k
        auto& local_state = get_local_state(state);
1049
25.1k
        auto estimated_size = local_state.estimate_memory_usage();
1050
25.1k
        if (estimated_size < state->minimum_operator_memory_required_bytes()) {
1051
25.1k
            estimated_size = state->minimum_operator_memory_required_bytes();
1052
25.1k
        }
1053
25.1k
        return estimated_size;
1054
25.1k
    }
_ZN5doris9OperatorXINS_20SchemaScanLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1047
3.96k
    size_t get_reserve_mem_size(RuntimeState* state) override {
1048
3.96k
        auto& local_state = get_local_state(state);
1049
3.96k
        auto estimated_size = local_state.estimate_memory_usage();
1050
3.96k
        if (estimated_size < state->minimum_operator_memory_required_bytes()) {
1051
3.96k
            estimated_size = state->minimum_operator_memory_required_bytes();
1052
3.96k
        }
1053
3.96k
        return estimated_size;
1054
3.96k
    }
Unexecuted instantiation: _ZN5doris9OperatorXINS_18MetaScanLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris9OperatorXINS_18FileScanLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
1055
1056
6.53M
    void reset_reserve_mem_size(RuntimeState* state) override {
1057
6.53M
        auto& local_state = get_local_state(state);
1058
6.53M
        local_state.reset_estimate_memory_usage();
1059
6.53M
    }
_ZN5doris9OperatorXINS_22RecCTESourceLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1056
3.54k
    void reset_reserve_mem_size(RuntimeState* state) override {
1057
3.54k
        auto& local_state = get_local_state(state);
1058
3.54k
        local_state.reset_estimate_memory_usage();
1059
3.54k
    }
_ZN5doris9OperatorXINS_21CacheSourceLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1056
23
    void reset_reserve_mem_size(RuntimeState* state) override {
1057
23
        auto& local_state = get_local_state(state);
1058
23
        local_state.reset_estimate_memory_usage();
1059
23
    }
_ZN5doris9OperatorXINS_29LocalExchangeSourceLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1056
1.17M
    void reset_reserve_mem_size(RuntimeState* state) override {
1057
1.17M
        auto& local_state = get_local_state(state);
1058
1.17M
        local_state.reset_estimate_memory_usage();
1059
1.17M
    }
_ZN5doris9OperatorXINS_35MultiCastDataStreamSourceLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1056
39.8k
    void reset_reserve_mem_size(RuntimeState* state) override {
1057
39.8k
        auto& local_state = get_local_state(state);
1058
39.8k
        local_state.reset_estimate_memory_usage();
1059
39.8k
    }
_ZN5doris9OperatorXINS_18OlapScanLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1056
1.42M
    void reset_reserve_mem_size(RuntimeState* state) override {
1057
1.42M
        auto& local_state = get_local_state(state);
1058
1.42M
        local_state.reset_estimate_memory_usage();
1059
1.42M
    }
_ZN5doris9OperatorXINS_21GroupCommitLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1056
1.59M
    void reset_reserve_mem_size(RuntimeState* state) override {
1057
1.59M
        auto& local_state = get_local_state(state);
1058
1.59M
        local_state.reset_estimate_memory_usage();
1059
1.59M
    }
Unexecuted instantiation: _ZN5doris9OperatorXINS_18JDBCScanLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
_ZN5doris9OperatorXINS_18FileScanLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1056
164k
    void reset_reserve_mem_size(RuntimeState* state) override {
1057
164k
        auto& local_state = get_local_state(state);
1058
164k
        local_state.reset_estimate_memory_usage();
1059
164k
    }
_ZN5doris9OperatorXINS_23HashJoinProbeLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1056
149k
    void reset_reserve_mem_size(RuntimeState* state) override {
1057
149k
        auto& local_state = get_local_state(state);
1058
149k
        local_state.reset_estimate_memory_usage();
1059
149k
    }
Unexecuted instantiation: _ZN5doris9OperatorXINS_34PartitionedHashJoinProbeLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
_ZN5doris9OperatorXINS_29NestedLoopJoinProbeLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1056
30.4k
    void reset_reserve_mem_size(RuntimeState* state) override {
1057
30.4k
        auto& local_state = get_local_state(state);
1058
30.4k
        local_state.reset_estimate_memory_usage();
1059
30.4k
    }
_ZN5doris9OperatorXINS_21UnionSourceLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1056
65.6k
    void reset_reserve_mem_size(RuntimeState* state) override {
1057
65.6k
        auto& local_state = get_local_state(state);
1058
65.6k
        local_state.reset_estimate_memory_usage();
1059
65.6k
    }
_ZN5doris9OperatorXINS_29PartitionSortSourceLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1056
959
    void reset_reserve_mem_size(RuntimeState* state) override {
1057
959
        auto& local_state = get_local_state(state);
1058
959
        local_state.reset_estimate_memory_usage();
1059
959
    }
_ZN5doris9OperatorXINS_25MaterializationLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1056
4.95k
    void reset_reserve_mem_size(RuntimeState* state) override {
1057
4.95k
        auto& local_state = get_local_state(state);
1058
4.95k
        local_state.reset_estimate_memory_usage();
1059
4.95k
    }
_ZN5doris9OperatorXINS_19SetSourceLocalStateILb1EEEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1056
2.68k
    void reset_reserve_mem_size(RuntimeState* state) override {
1057
2.68k
        auto& local_state = get_local_state(state);
1058
2.68k
        local_state.reset_estimate_memory_usage();
1059
2.68k
    }
_ZN5doris9OperatorXINS_19SetSourceLocalStateILb0EEEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1056
2.55k
    void reset_reserve_mem_size(RuntimeState* state) override {
1057
2.55k
        auto& local_state = get_local_state(state);
1058
2.55k
        local_state.reset_estimate_memory_usage();
1059
2.55k
    }
_ZN5doris9OperatorXINS_18EmptySetLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1056
1.99k
    void reset_reserve_mem_size(RuntimeState* state) override {
1057
1.99k
        auto& local_state = get_local_state(state);
1058
1.99k
        local_state.reset_estimate_memory_usage();
1059
1.99k
    }
_ZN5doris9OperatorXINS_18MetaScanLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1056
6.78k
    void reset_reserve_mem_size(RuntimeState* state) override {
1057
6.78k
        auto& local_state = get_local_state(state);
1058
6.78k
        local_state.reset_estimate_memory_usage();
1059
6.78k
    }
_ZN5doris9OperatorXINS_16SelectLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1056
15.9k
    void reset_reserve_mem_size(RuntimeState* state) override {
1057
15.9k
        auto& local_state = get_local_state(state);
1058
15.9k
        local_state.reset_estimate_memory_usage();
1059
15.9k
    }
_ZN5doris9OperatorXINS_20RecCTEScanLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1056
4.97k
    void reset_reserve_mem_size(RuntimeState* state) override {
1057
4.97k
        auto& local_state = get_local_state(state);
1058
4.97k
        local_state.reset_estimate_memory_usage();
1059
4.97k
    }
_ZN5doris9OperatorXINS_18ExchangeLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1056
740k
    void reset_reserve_mem_size(RuntimeState* state) override {
1057
740k
        auto& local_state = get_local_state(state);
1058
740k
        local_state.reset_estimate_memory_usage();
1059
740k
    }
_ZN5doris9OperatorXINS_30DistinctStreamingAggLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1056
472k
    void reset_reserve_mem_size(RuntimeState* state) override {
1057
472k
        auto& local_state = get_local_state(state);
1058
472k
        local_state.reset_estimate_memory_usage();
1059
472k
    }
_ZN5doris9OperatorXINS_22StreamingAggLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1056
37.0k
    void reset_reserve_mem_size(RuntimeState* state) override {
1057
37.0k
        auto& local_state = get_local_state(state);
1058
37.0k
        local_state.reset_estimate_memory_usage();
1059
37.0k
    }
_ZN5doris9OperatorXINS_13AggLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1056
169k
    void reset_reserve_mem_size(RuntimeState* state) override {
1057
169k
        auto& local_state = get_local_state(state);
1058
169k
        local_state.reset_estimate_memory_usage();
1059
169k
    }
_ZN5doris9OperatorXINS_24PartitionedAggLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1056
216
    void reset_reserve_mem_size(RuntimeState* state) override {
1057
216
        auto& local_state = get_local_state(state);
1058
216
        local_state.reset_estimate_memory_usage();
1059
216
    }
_ZN5doris9OperatorXINS_21BucketedAggLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1056
5.33k
    void reset_reserve_mem_size(RuntimeState* state) override {
1057
5.33k
        auto& local_state = get_local_state(state);
1058
5.33k
        local_state.reset_estimate_memory_usage();
1059
5.33k
    }
_ZN5doris9OperatorXINS_14SortLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1056
10.8k
    void reset_reserve_mem_size(RuntimeState* state) override {
1057
10.8k
        auto& local_state = get_local_state(state);
1058
10.8k
        local_state.reset_estimate_memory_usage();
1059
10.8k
    }
_ZN5doris9OperatorXINS_19SpillSortLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1056
264
    void reset_reserve_mem_size(RuntimeState* state) override {
1057
264
        auto& local_state = get_local_state(state);
1058
264
        local_state.reset_estimate_memory_usage();
1059
264
    }
_ZN5doris9OperatorXINS_24LocalMergeSortLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1056
360k
    void reset_reserve_mem_size(RuntimeState* state) override {
1057
360k
        auto& local_state = get_local_state(state);
1058
360k
        local_state.reset_estimate_memory_usage();
1059
360k
    }
_ZN5doris9OperatorXINS_18AnalyticLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1056
10.6k
    void reset_reserve_mem_size(RuntimeState* state) override {
1057
10.6k
        auto& local_state = get_local_state(state);
1058
10.6k
        local_state.reset_estimate_memory_usage();
1059
10.6k
    }
_ZN5doris9OperatorXINS_16RepeatLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1056
4.44k
    void reset_reserve_mem_size(RuntimeState* state) override {
1057
4.44k
        auto& local_state = get_local_state(state);
1058
4.44k
        local_state.reset_estimate_memory_usage();
1059
4.44k
    }
_ZN5doris9OperatorXINS_23TableFunctionLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1056
6.48k
    void reset_reserve_mem_size(RuntimeState* state) override {
1057
6.48k
        auto& local_state = get_local_state(state);
1058
6.48k
        local_state.reset_estimate_memory_usage();
1059
6.48k
    }
_ZN5doris9OperatorXINS_23AssertNumRowsLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1056
427
    void reset_reserve_mem_size(RuntimeState* state) override {
1057
427
        auto& local_state = get_local_state(state);
1058
427
        local_state.reset_estimate_memory_usage();
1059
427
    }
_ZN5doris9OperatorXINS_17DataGenLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1056
25.1k
    void reset_reserve_mem_size(RuntimeState* state) override {
1057
25.1k
        auto& local_state = get_local_state(state);
1058
25.1k
        local_state.reset_estimate_memory_usage();
1059
25.1k
    }
_ZN5doris9OperatorXINS_20SchemaScanLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1056
3.96k
    void reset_reserve_mem_size(RuntimeState* state) override {
1057
3.96k
        auto& local_state = get_local_state(state);
1058
3.96k
        local_state.reset_estimate_memory_usage();
1059
3.96k
    }
1060
};
1061
1062
/**
1063
 * StreamingOperatorX indicates operators which always processes block in streaming way (one-in-one-out).
1064
 */
1065
template <typename LocalStateType>
1066
class StreamingOperatorX : public OperatorX<LocalStateType> {
1067
public:
1068
    StreamingOperatorX(ObjectPool* pool, const TPlanNode& tnode, int operator_id,
1069
                       const DescriptorTbl& descs)
1070
2.85k
            : OperatorX<LocalStateType>(pool, tnode, operator_id, descs) {}
_ZN5doris18StreamingOperatorXINS_16SelectLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1070
2.63k
            : OperatorX<LocalStateType>(pool, tnode, operator_id, descs) {}
_ZN5doris18StreamingOperatorXINS_23AssertNumRowsLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1070
218
            : OperatorX<LocalStateType>(pool, tnode, operator_id, descs) {}
1071
1072
#ifdef BE_TEST
1073
    StreamingOperatorX() = default;
1074
#endif
1075
1076
    virtual ~StreamingOperatorX() = default;
1077
1078
    Status get_block_impl(RuntimeState* state, Block* block, bool* eos) override;
1079
1080
    virtual Status pull(RuntimeState* state, Block* block, bool* eos) = 0;
1081
};
1082
1083
/**
1084
 * StatefulOperatorX indicates the operators with some states inside.
1085
 *
1086
 * Specifically, we called an operator stateful if an operator can determine its output by itself.
1087
 * 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).
1088
 * If there are still remain rows in probe block, we can get output block by calling `get_block` without any data from its child.
1089
 * In a nutshell, it is a one-to-many relation between input blocks and output blocks for StatefulOperator.
1090
 */
1091
template <typename LocalStateType>
1092
class StatefulOperatorX : public OperatorX<LocalStateType> {
1093
public:
1094
    StatefulOperatorX(ObjectPool* pool, const TPlanNode& tnode, const int operator_id,
1095
                      const DescriptorTbl& descs)
1096
179k
            : OperatorX<LocalStateType>(pool, tnode, operator_id, descs) {}
_ZN5doris17StatefulOperatorXINS_25MaterializationLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1096
1.74k
            : OperatorX<LocalStateType>(pool, tnode, operator_id, descs) {}
_ZN5doris17StatefulOperatorXINS_23HashJoinProbeLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1096
82.9k
            : OperatorX<LocalStateType>(pool, tnode, operator_id, descs) {}
_ZN5doris17StatefulOperatorXINS_34PartitionedHashJoinProbeLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1096
52
            : OperatorX<LocalStateType>(pool, tnode, operator_id, descs) {}
_ZN5doris17StatefulOperatorXINS_16RepeatLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1096
346
            : OperatorX<LocalStateType>(pool, tnode, operator_id, descs) {}
_ZN5doris17StatefulOperatorXINS_22StreamingAggLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1096
1.68k
            : OperatorX<LocalStateType>(pool, tnode, operator_id, descs) {}
_ZN5doris17StatefulOperatorXINS_30DistinctStreamingAggLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1096
85.7k
            : OperatorX<LocalStateType>(pool, tnode, operator_id, descs) {}
_ZN5doris17StatefulOperatorXINS_29NestedLoopJoinProbeLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1096
6.42k
            : OperatorX<LocalStateType>(pool, tnode, operator_id, descs) {}
_ZN5doris17StatefulOperatorXINS_23TableFunctionLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1096
925
            : OperatorX<LocalStateType>(pool, tnode, operator_id, descs) {}
1097
#ifdef BE_TEST
1098
    StatefulOperatorX() = default;
1099
#endif
1100
    virtual ~StatefulOperatorX() = default;
1101
1102
    using OperatorX<LocalStateType>::get_local_state;
1103
1104
    [[nodiscard]] Status get_block_impl(RuntimeState* state, Block* block, bool* eos) override;
1105
1106
    [[nodiscard]] virtual Status pull(RuntimeState* state, Block* block, bool* eos) const = 0;
1107
    [[nodiscard]] virtual Status push(RuntimeState* state, Block* input_block, bool eos) const = 0;
1108
0
    bool need_more_input_data(RuntimeState* state) const override { return true; }
Unexecuted instantiation: _ZNK5doris17StatefulOperatorXINS_23HashJoinProbeLocalStateEE20need_more_input_dataEPNS_12RuntimeStateE
Unexecuted instantiation: _ZNK5doris17StatefulOperatorXINS_34PartitionedHashJoinProbeLocalStateEE20need_more_input_dataEPNS_12RuntimeStateE
Unexecuted instantiation: _ZNK5doris17StatefulOperatorXINS_29NestedLoopJoinProbeLocalStateEE20need_more_input_dataEPNS_12RuntimeStateE
Unexecuted instantiation: _ZNK5doris17StatefulOperatorXINS_25MaterializationLocalStateEE20need_more_input_dataEPNS_12RuntimeStateE
Unexecuted instantiation: _ZNK5doris17StatefulOperatorXINS_30DistinctStreamingAggLocalStateEE20need_more_input_dataEPNS_12RuntimeStateE
Unexecuted instantiation: _ZNK5doris17StatefulOperatorXINS_22StreamingAggLocalStateEE20need_more_input_dataEPNS_12RuntimeStateE
Unexecuted instantiation: _ZNK5doris17StatefulOperatorXINS_16RepeatLocalStateEE20need_more_input_dataEPNS_12RuntimeStateE
Unexecuted instantiation: _ZNK5doris17StatefulOperatorXINS_23TableFunctionLocalStateEE20need_more_input_dataEPNS_12RuntimeStateE
1109
};
1110
1111
template <typename Writer, typename Parent>
1112
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
1113
class AsyncWriterSink : public PipelineXSinkLocalState<BasicSharedState> {
1114
public:
1115
    using Base = PipelineXSinkLocalState<BasicSharedState>;
1116
    AsyncWriterSink(DataSinkOperatorXBase* parent, RuntimeState* state)
1117
69.0k
            : Base(parent, state), _async_writer_dependency(nullptr) {
1118
69.0k
        _finish_dependency =
1119
69.0k
                std::make_shared<Dependency>(parent->operator_id(), parent->node_id(),
1120
69.0k
                                             parent->get_name() + "_FINISH_DEPENDENCY", true);
1121
69.0k
    }
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Line
Count
Source
1117
516
            : Base(parent, state), _async_writer_dependency(nullptr) {
1118
516
        _finish_dependency =
1119
516
                std::make_shared<Dependency>(parent->operator_id(), parent->node_id(),
1120
516
                                             parent->get_name() + "_FINISH_DEPENDENCY", true);
1121
516
    }
_ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Line
Count
Source
1117
86
            : Base(parent, state), _async_writer_dependency(nullptr) {
1118
86
        _finish_dependency =
1119
86
                std::make_shared<Dependency>(parent->operator_id(), parent->node_id(),
1120
86
                                             parent->get_name() + "_FINISH_DEPENDENCY", true);
1121
86
    }
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Line
Count
Source
1117
46.8k
            : Base(parent, state), _async_writer_dependency(nullptr) {
1118
46.8k
        _finish_dependency =
1119
46.8k
                std::make_shared<Dependency>(parent->operator_id(), parent->node_id(),
1120
46.8k
                                             parent->get_name() + "_FINISH_DEPENDENCY", true);
1121
46.8k
    }
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Line
Count
Source
1117
9.67k
            : Base(parent, state), _async_writer_dependency(nullptr) {
1118
9.67k
        _finish_dependency =
1119
9.67k
                std::make_shared<Dependency>(parent->operator_id(), parent->node_id(),
1120
9.67k
                                             parent->get_name() + "_FINISH_DEPENDENCY", true);
1121
9.67k
    }
_ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Line
Count
Source
1117
5.23k
            : Base(parent, state), _async_writer_dependency(nullptr) {
1118
5.23k
        _finish_dependency =
1119
5.23k
                std::make_shared<Dependency>(parent->operator_id(), parent->node_id(),
1120
5.23k
                                             parent->get_name() + "_FINISH_DEPENDENCY", true);
1121
5.23k
    }
_ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Line
Count
Source
1117
4.02k
            : Base(parent, state), _async_writer_dependency(nullptr) {
1118
4.02k
        _finish_dependency =
1119
4.02k
                std::make_shared<Dependency>(parent->operator_id(), parent->node_id(),
1120
4.02k
                                             parent->get_name() + "_FINISH_DEPENDENCY", true);
1121
4.02k
    }
_ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Line
Count
Source
1117
48
            : Base(parent, state), _async_writer_dependency(nullptr) {
1118
48
        _finish_dependency =
1119
48
                std::make_shared<Dependency>(parent->operator_id(), parent->node_id(),
1120
48
                                             parent->get_name() + "_FINISH_DEPENDENCY", true);
1121
48
    }
_ZN5doris15AsyncWriterSinkINS_18VIcebergDeleteSinkENS_26IcebergDeleteSinkOperatorXEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Line
Count
Source
1117
704
            : Base(parent, state), _async_writer_dependency(nullptr) {
1118
704
        _finish_dependency =
1119
704
                std::make_shared<Dependency>(parent->operator_id(), parent->node_id(),
1120
704
                                             parent->get_name() + "_FINISH_DEPENDENCY", true);
1121
704
    }
_ZN5doris15AsyncWriterSinkINS_17VIcebergMergeSinkENS_25IcebergMergeSinkOperatorXEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Line
Count
Source
1117
1.71k
            : Base(parent, state), _async_writer_dependency(nullptr) {
1118
1.71k
        _finish_dependency =
1119
1.71k
                std::make_shared<Dependency>(parent->operator_id(), parent->node_id(),
1120
1.71k
                                             parent->get_name() + "_FINISH_DEPENDENCY", true);
1121
1.71k
    }
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
_ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Line
Count
Source
1117
156
            : Base(parent, state), _async_writer_dependency(nullptr) {
1118
156
        _finish_dependency =
1119
156
                std::make_shared<Dependency>(parent->operator_id(), parent->node_id(),
1120
156
                                             parent->get_name() + "_FINISH_DEPENDENCY", true);
1121
156
    }
1122
1123
    Status init(RuntimeState* state, LocalSinkStateInfo& info) override;
1124
1125
    Status open(RuntimeState* state) override;
1126
1127
    Status sink(RuntimeState* state, Block* block, bool eos);
1128
1129
69.3k
    std::vector<Dependency*> dependencies() const override {
1130
69.3k
        return {_async_writer_dependency.get()};
1131
69.3k
    }
_ZNK5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE12dependenciesEv
Line
Count
Source
1129
9.67k
    std::vector<Dependency*> dependencies() const override {
1130
9.67k
        return {_async_writer_dependency.get()};
1131
9.67k
    }
_ZNK5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE12dependenciesEv
Line
Count
Source
1129
47.2k
    std::vector<Dependency*> dependencies() const override {
1130
47.2k
        return {_async_writer_dependency.get()};
1131
47.2k
    }
_ZNK5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE12dependenciesEv
Line
Count
Source
1129
5.23k
    std::vector<Dependency*> dependencies() const override {
1130
5.23k
        return {_async_writer_dependency.get()};
1131
5.23k
    }
_ZNK5doris15AsyncWriterSinkINS_18VIcebergDeleteSinkENS_26IcebergDeleteSinkOperatorXEE12dependenciesEv
Line
Count
Source
1129
704
    std::vector<Dependency*> dependencies() const override {
1130
704
        return {_async_writer_dependency.get()};
1131
704
    }
_ZNK5doris15AsyncWriterSinkINS_17VIcebergMergeSinkENS_25IcebergMergeSinkOperatorXEE12dependenciesEv
Line
Count
Source
1129
1.71k
    std::vector<Dependency*> dependencies() const override {
1130
1.71k
        return {_async_writer_dependency.get()};
1131
1.71k
    }
_ZNK5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE12dependenciesEv
Line
Count
Source
1129
4.02k
    std::vector<Dependency*> dependencies() const override {
1130
4.02k
        return {_async_writer_dependency.get()};
1131
4.02k
    }
_ZNK5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE12dependenciesEv
Line
Count
Source
1129
86
    std::vector<Dependency*> dependencies() const override {
1130
86
        return {_async_writer_dependency.get()};
1131
86
    }
Unexecuted instantiation: _ZNK5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE12dependenciesEv
_ZNK5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE12dependenciesEv
Line
Count
Source
1129
156
    std::vector<Dependency*> dependencies() const override {
1130
156
        return {_async_writer_dependency.get()};
1131
156
    }
_ZNK5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE12dependenciesEv
Line
Count
Source
1129
517
    std::vector<Dependency*> dependencies() const override {
1130
517
        return {_async_writer_dependency.get()};
1131
517
    }
_ZNK5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE12dependenciesEv
Line
Count
Source
1129
48
    std::vector<Dependency*> dependencies() const override {
1130
48
        return {_async_writer_dependency.get()};
1131
48
    }
1132
    Status close(RuntimeState* state, Status exec_status) override;
1133
1134
69.3k
    Dependency* finishdependency() override { return _finish_dependency.get(); }
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE16finishdependencyEv
Line
Count
Source
1134
9.67k
    Dependency* finishdependency() override { return _finish_dependency.get(); }
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE16finishdependencyEv
Line
Count
Source
1134
47.2k
    Dependency* finishdependency() override { return _finish_dependency.get(); }
_ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE16finishdependencyEv
Line
Count
Source
1134
5.23k
    Dependency* finishdependency() override { return _finish_dependency.get(); }
_ZN5doris15AsyncWriterSinkINS_18VIcebergDeleteSinkENS_26IcebergDeleteSinkOperatorXEE16finishdependencyEv
Line
Count
Source
1134
704
    Dependency* finishdependency() override { return _finish_dependency.get(); }
_ZN5doris15AsyncWriterSinkINS_17VIcebergMergeSinkENS_25IcebergMergeSinkOperatorXEE16finishdependencyEv
Line
Count
Source
1134
1.71k
    Dependency* finishdependency() override { return _finish_dependency.get(); }
_ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE16finishdependencyEv
Line
Count
Source
1134
4.02k
    Dependency* finishdependency() override { return _finish_dependency.get(); }
_ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE16finishdependencyEv
Line
Count
Source
1134
86
    Dependency* finishdependency() override { return _finish_dependency.get(); }
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE16finishdependencyEv
_ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE16finishdependencyEv
Line
Count
Source
1134
156
    Dependency* finishdependency() override { return _finish_dependency.get(); }
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE16finishdependencyEv
Line
Count
Source
1134
517
    Dependency* finishdependency() override { return _finish_dependency.get(); }
_ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE16finishdependencyEv
Line
Count
Source
1134
48
    Dependency* finishdependency() override { return _finish_dependency.get(); }
1135
1136
protected:
1137
    VExprContextSPtrs _output_vexpr_ctxs;
1138
    std::unique_ptr<Writer> _writer;
1139
1140
    std::shared_ptr<Dependency> _async_writer_dependency;
1141
    std::shared_ptr<Dependency> _finish_dependency;
1142
};
1143
1144
#ifdef BE_TEST
1145
class DummyOperatorLocalState final : public PipelineXLocalState<FakeSharedState> {
1146
public:
1147
    ENABLE_FACTORY_CREATOR(DummyOperatorLocalState);
1148
1149
    DummyOperatorLocalState(RuntimeState* state, OperatorXBase* parent)
1150
            : PipelineXLocalState<FakeSharedState>(state, parent) {
1151
        _tmp_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
1152
                                                    "DummyOperatorDependency", true);
1153
        _finish_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
1154
                                                       "DummyOperatorDependency", true);
1155
        _filter_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
1156
                                                       "DummyOperatorDependency", true);
1157
    }
1158
    Dependency* finishdependency() override { return _finish_dependency.get(); }
1159
    ~DummyOperatorLocalState() = default;
1160
1161
    std::vector<Dependency*> dependencies() const override { return {_tmp_dependency.get()}; }
1162
    std::vector<Dependency*> execution_dependencies() override {
1163
        return {_filter_dependency.get()};
1164
    }
1165
1166
private:
1167
    std::shared_ptr<Dependency> _tmp_dependency;
1168
    std::shared_ptr<Dependency> _finish_dependency;
1169
    std::shared_ptr<Dependency> _filter_dependency;
1170
};
1171
1172
class DummyOperator final : public OperatorX<DummyOperatorLocalState> {
1173
public:
1174
    DummyOperator() : OperatorX<DummyOperatorLocalState>(nullptr, 0, 0) {}
1175
1176
    [[nodiscard]] bool is_source() const override { return true; }
1177
1178
    Status get_block_impl(RuntimeState* state, Block* block, bool* eos) override {
1179
        *eos = _eos;
1180
        return Status::OK();
1181
    }
1182
    void set_low_memory_mode(RuntimeState* state) override { _low_memory_mode = true; }
1183
    Status terminate(RuntimeState* state) override {
1184
        _terminated = true;
1185
        return Status::OK();
1186
    }
1187
    size_t revocable_mem_size(RuntimeState* state) const override { return _revocable_mem_size; }
1188
    size_t get_reserve_mem_size(RuntimeState* state) override {
1189
        return _disable_reserve_mem
1190
                       ? 0
1191
                       : OperatorX<DummyOperatorLocalState>::get_reserve_mem_size(state);
1192
    }
1193
    Status revoke_memory(RuntimeState* state) override {
1194
        _revoke_called = true;
1195
        return Status::OK();
1196
    }
1197
1198
private:
1199
    friend class AssertNumRowsLocalState;
1200
    bool _eos = false;
1201
    bool _low_memory_mode = false;
1202
    bool _terminated = false;
1203
    size_t _revocable_mem_size = 0;
1204
    bool _disable_reserve_mem = false;
1205
    bool _revoke_called = false;
1206
};
1207
1208
class DummySinkLocalState final : public PipelineXSinkLocalState<BasicSharedState> {
1209
public:
1210
    using Base = PipelineXSinkLocalState<BasicSharedState>;
1211
    ENABLE_FACTORY_CREATOR(DummySinkLocalState);
1212
    DummySinkLocalState(DataSinkOperatorXBase* parent, RuntimeState* state) : Base(parent, state) {
1213
        _tmp_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
1214
                                                    "DummyOperatorDependency", true);
1215
        _finish_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
1216
                                                       "DummyOperatorDependency", true);
1217
    }
1218
1219
    std::vector<Dependency*> dependencies() const override { return {_tmp_dependency.get()}; }
1220
    Dependency* finishdependency() override { return _finish_dependency.get(); }
1221
    bool is_finished() const override { return _is_finished; }
1222
1223
private:
1224
    std::shared_ptr<Dependency> _tmp_dependency;
1225
    std::shared_ptr<Dependency> _finish_dependency;
1226
    std::atomic_bool _is_finished = false;
1227
};
1228
1229
class DummySinkOperatorX final : public DataSinkOperatorX<DummySinkLocalState> {
1230
public:
1231
    DummySinkOperatorX(int op_id, int node_id, int dest_id)
1232
            : DataSinkOperatorX<DummySinkLocalState>(op_id, node_id, dest_id) {}
1233
    Status sink_impl(RuntimeState* state, Block* in_block, bool eos) override {
1234
        return _return_eof ? Status::Error<ErrorCode::END_OF_FILE>("source have closed")
1235
                           : Status::OK();
1236
    }
1237
    void set_low_memory_mode(RuntimeState* state) override { _low_memory_mode = true; }
1238
    Status terminate(RuntimeState* state) override {
1239
        _terminated = true;
1240
        return Status::OK();
1241
    }
1242
    size_t revocable_mem_size(RuntimeState* state) const override { return _revocable_mem_size; }
1243
    size_t get_reserve_mem_size(RuntimeState* state, bool eos) override {
1244
        return _disable_reserve_mem
1245
                       ? 0
1246
                       : DataSinkOperatorX<DummySinkLocalState>::get_reserve_mem_size(state, eos);
1247
    }
1248
    Status revoke_memory(RuntimeState* state) override {
1249
        _revoke_called = true;
1250
        return Status::OK();
1251
    }
1252
1253
private:
1254
    bool _low_memory_mode = false;
1255
    bool _terminated = false;
1256
    std::atomic_bool _return_eof = false;
1257
    size_t _revocable_mem_size = 0;
1258
    bool _disable_reserve_mem = false;
1259
    bool _revoke_called = false;
1260
};
1261
#endif
1262
1263
} // namespace doris