Coverage Report

Created: 2026-03-15 16:57

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
be/src/exec/operator/operator.h
Line
Count
Source
1
// Licensed to the Apache Software Foundation (ASF) under one
2
// or more contributor license agreements.  See the NOTICE file
3
// distributed with this work for additional information
4
// regarding copyright ownership.  The ASF licenses this file
5
// to you under the Apache License, Version 2.0 (the
6
// "License"); you may not use this file except in compliance
7
// with the License.  You may obtain a copy of the License at
8
//
9
//   http://www.apache.org/licenses/LICENSE-2.0
10
//
11
// Unless required by applicable law or agreed to in writing,
12
// software distributed under the License is distributed on an
13
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
// KIND, either express or implied.  See the License for the
15
// specific language governing permissions and limitations
16
// under the License.
17
18
#pragma once
19
20
#include <fmt/format.h>
21
#include <glog/logging.h>
22
23
#include <atomic>
24
#include <cstdint>
25
#include <functional>
26
#include <memory>
27
#include <string>
28
#include <utility>
29
#include <vector>
30
31
#include "common/be_mock_util.h"
32
#include "common/exception.h"
33
#include "common/logging.h"
34
#include "common/status.h"
35
#include "core/block/block.h"
36
#include "exec/exchange/local_exchanger.h"
37
#include "exec/exchange/vdata_stream_recvr.h"
38
#include "exec/operator/operator.h"
39
#include "exec/operator/spill_utils.h"
40
#include "exec/pipeline/dependency.h"
41
#include "runtime/memory/mem_tracker.h"
42
#include "runtime/query_context.h"
43
#include "runtime/runtime_profile.h"
44
#include "runtime/runtime_state.h"
45
#include "runtime/thread_context.h"
46
47
namespace doris {
48
#include "common/compile_check_begin.h"
49
class RowDescriptor;
50
class RuntimeState;
51
class TDataSink;
52
class AsyncResultWriter;
53
class ScoreRuntime;
54
class AnnTopNRuntime;
55
} // namespace doris
56
57
namespace doris {
58
59
class OperatorBase;
60
class OperatorXBase;
61
class DataSinkOperatorXBase;
62
63
using OperatorPtr = std::shared_ptr<OperatorXBase>;
64
using Operators = std::vector<OperatorPtr>;
65
66
using DataSinkOperatorPtr = std::shared_ptr<DataSinkOperatorXBase>;
67
68
// This suffix will be added back to the name of sink operator
69
// when we creating runtime profile.
70
const std::string exchange_sink_name_suffix = "(dest_id={})";
71
72
const std::string operator_name_suffix = "(id={})";
73
74
// This struct is used only for initializing local state.
75
struct LocalStateInfo {
76
    RuntimeProfile* parent_profile = nullptr;
77
    const std::vector<TScanRangeParams>& scan_ranges;
78
    BasicSharedState* shared_state;
79
    const std::map<int, std::pair<std::shared_ptr<BasicSharedState>,
80
                                  std::vector<std::shared_ptr<Dependency>>>>& shared_state_map;
81
    const int task_idx;
82
};
83
84
// This struct is used only for initializing local sink state.
85
struct LocalSinkStateInfo {
86
    const int task_idx;
87
    RuntimeProfile* parent_profile = nullptr;
88
    const int sender_id;
89
    BasicSharedState* shared_state;
90
    const std::map<int, std::pair<std::shared_ptr<BasicSharedState>,
91
                                  std::vector<std::shared_ptr<Dependency>>>>& shared_state_map;
92
    const TDataSink& tsink;
93
};
94
95
class OperatorBase {
96
public:
97
779k
    explicit OperatorBase() : _child(nullptr), _is_closed(false) {}
98
    explicit OperatorBase(bool is_serial_operator)
99
784k
            : _child(nullptr), _is_closed(false), _is_serial_operator(is_serial_operator) {}
100
1.56M
    virtual ~OperatorBase() = default;
101
102
0
    virtual bool is_sink() const { return false; }
103
104
2.62M
    virtual bool is_source() const { return false; }
105
106
    [[nodiscard]] virtual const RowDescriptor& row_desc() const;
107
108
0
    [[nodiscard]] virtual Status init(const TDataSink& tsink) { return Status::OK(); }
109
110
    [[nodiscard]] virtual std::string get_name() const = 0;
111
    [[nodiscard]] virtual Status prepare(RuntimeState* state) = 0;
112
    [[nodiscard]] virtual Status terminate(RuntimeState* state) = 0;
113
    [[nodiscard]] virtual Status close(RuntimeState* state);
114
    [[nodiscard]] virtual int node_id() const = 0;
115
458k
    [[nodiscard]] virtual int parallelism(RuntimeState* state) const {
116
458k
        return _is_serial_operator ? 1 : state->query_parallel_instance_num();
117
458k
    }
118
119
1.31M
    [[nodiscard]] virtual Status set_child(OperatorPtr child) {
120
1.31M
        if (_child && child != nullptr) {
121
0
            return Status::InternalError("Child is already set in node name={}", get_name());
122
0
        }
123
1.31M
        _child = child;
124
1.31M
        return Status::OK();
125
1.31M
    }
126
127
    // Operators need to be executed serially. (e.g. finalized agg without key)
128
2.73M
    [[nodiscard]] virtual bool is_serial_operator() const { return _is_serial_operator; }
129
130
60.2k
    [[nodiscard]] bool is_closed() const { return _is_closed; }
131
132
7.19M
    virtual size_t revocable_mem_size(RuntimeState* state) const { return 0; }
133
134
    virtual Status revoke_memory(RuntimeState* state,
135
0
                                 const std::shared_ptr<SpillContext>& spill_context) {
136
0
        return Status::OK();
137
0
    }
138
139
2.13k
    virtual bool is_hash_join_probe() const { return false; }
140
141
    /**
142
     * Pipeline task is blockable means it will be blocked in the next run. So we should put the
143
     * pipeline task into the blocking task scheduler.
144
     */
145
    virtual bool is_blockable(RuntimeState* state) const = 0;
146
14.3k
    virtual void set_low_memory_mode(RuntimeState* state) {}
147
148
    OperatorPtr child() { return _child; }
149
0
    virtual Status reset(RuntimeState* state) {
150
0
        return Status::InternalError("Reset is not implemented in operator: {}", get_name());
151
0
    }
152
153
    /* -------------- Interfaces to determine the input data properties -------------- */
154
    /**
155
     * Return True if this operator relies on the bucket distribution (e.g. COLOCATE join, 1-phase AGG).
156
     * Data input to this kind of operators must have the same distribution with the table buckets.
157
     * It is also means `required_data_distribution` should be `BUCKET_HASH_SHUFFLE`.
158
     * @return
159
     */
160
3.57M
    [[nodiscard]] virtual bool is_colocated_operator() const { return false; }
161
    /**
162
     * Return True if this operator relies on the bucket distribution or specific hash data distribution (e.g. SHUFFLED HASH join).
163
     * Data input to this kind of operators must be HASH distributed according to some rules.
164
     * All colocated operators are also shuffled operators.
165
     * It is also means `required_data_distribution` should be `BUCKET_HASH_SHUFFLE` or `HASH_SHUFFLE`.
166
     * @return
167
     */
168
3.57M
    [[nodiscard]] virtual bool is_shuffled_operator() const { return false; }
169
    /**
170
     * 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).
171
     *
172
     * For single child's operators, return true if this operator is followed by a shuffled operator.
173
     * For example, in the plan fragment:
174
     *   `UNION` -> `SHUFFLED HASH JOIN`
175
     * The `SHUFFLED HASH JOIN` is a shuffled operator so the UNION operator is followed by a shuffled operator.
176
     */
177
4.22M
    [[nodiscard]] virtual bool followed_by_shuffled_operator() const {
178
4.22M
        return _followed_by_shuffled_operator;
179
4.22M
    }
180
    /**
181
     * Update the operator properties according to the plan node.
182
     * This is called before `prepare`.
183
     */
184
    virtual void update_operator(const TPlanNode& tnode, bool followed_by_shuffled_operator,
185
490k
                                 bool require_bucket_distribution) {
186
490k
        _followed_by_shuffled_operator = followed_by_shuffled_operator;
187
490k
        _require_bucket_distribution = require_bucket_distribution;
188
490k
    }
189
    /**
190
     * Return the required data distribution of this operator.
191
     */
192
    [[nodiscard]] virtual DataDistribution required_data_distribution(
193
            RuntimeState* /*state*/) const;
194
195
protected:
196
    OperatorPtr _child = nullptr;
197
198
    bool _is_closed;
199
    bool _followed_by_shuffled_operator = false;
200
    bool _require_bucket_distribution = false;
201
    bool _is_serial_operator = false;
202
};
203
204
class PipelineXLocalStateBase {
205
public:
206
    PipelineXLocalStateBase(RuntimeState* state, OperatorXBase* parent);
207
2.59M
    virtual ~PipelineXLocalStateBase() = default;
208
209
    template <class TARGET>
210
22.9M
    TARGET& cast() {
211
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
212
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
213
18.4E
                << " and expect type is" << typeid(TARGET).name();
214
22.9M
        return reinterpret_cast<TARGET&>(*this);
215
22.9M
    }
_ZN5doris23PipelineXLocalStateBase4castINS_18FileScanLocalStateEEERT_v
Line
Count
Source
210
17.8k
    TARGET& cast() {
211
17.8k
        DCHECK(dynamic_cast<TARGET*>(this))
212
0
                << " Mismatch type! Current type is " << typeid(*this).name()
213
0
                << " and expect type is" << typeid(TARGET).name();
214
17.8k
        return reinterpret_cast<TARGET&>(*this);
215
17.8k
    }
_ZN5doris23PipelineXLocalStateBase4castINS_22RecCTESourceLocalStateEEERT_v
Line
Count
Source
210
10.4k
    TARGET& cast() {
211
10.4k
        DCHECK(dynamic_cast<TARGET*>(this))
212
0
                << " Mismatch type! Current type is " << typeid(*this).name()
213
0
                << " and expect type is" << typeid(TARGET).name();
214
10.4k
        return reinterpret_cast<TARGET&>(*this);
215
10.4k
    }
_ZN5doris23PipelineXLocalStateBase4castINS_21CacheSourceLocalStateEEERT_v
Line
Count
Source
210
1.47k
    TARGET& cast() {
211
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
212
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
213
18.4E
                << " and expect type is" << typeid(TARGET).name();
214
1.47k
        return reinterpret_cast<TARGET&>(*this);
215
1.47k
    }
_ZN5doris23PipelineXLocalStateBase4castINS_29LocalExchangeSourceLocalStateEEERT_v
Line
Count
Source
210
3.02M
    TARGET& cast() {
211
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
212
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
213
18.4E
                << " and expect type is" << typeid(TARGET).name();
214
3.02M
        return reinterpret_cast<TARGET&>(*this);
215
3.02M
    }
_ZN5doris23PipelineXLocalStateBase4castINS_35MultiCastDataStreamSourceLocalStateEEERT_v
Line
Count
Source
210
66.0k
    TARGET& cast() {
211
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
212
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
213
18.4E
                << " and expect type is" << typeid(TARGET).name();
214
66.0k
        return reinterpret_cast<TARGET&>(*this);
215
66.0k
    }
_ZN5doris23PipelineXLocalStateBase4castINS_18OlapScanLocalStateEEERT_v
Line
Count
Source
210
4.32M
    TARGET& cast() {
211
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
212
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
213
18.4E
                << " and expect type is" << typeid(TARGET).name();
214
4.32M
        return reinterpret_cast<TARGET&>(*this);
215
4.32M
    }
_ZN5doris23PipelineXLocalStateBase4castINS_21GroupCommitLocalStateEEERT_v
Line
Count
Source
210
4.59M
    TARGET& cast() {
211
4.59M
        DCHECK(dynamic_cast<TARGET*>(this))
212
13
                << " Mismatch type! Current type is " << typeid(*this).name()
213
13
                << " and expect type is" << typeid(TARGET).name();
214
4.59M
        return reinterpret_cast<TARGET&>(*this);
215
4.59M
    }
_ZN5doris23PipelineXLocalStateBase4castINS_18JDBCScanLocalStateEEERT_v
Line
Count
Source
210
12
    TARGET& cast() {
211
12
        DCHECK(dynamic_cast<TARGET*>(this))
212
0
                << " Mismatch type! Current type is " << typeid(*this).name()
213
0
                << " and expect type is" << typeid(TARGET).name();
214
12
        return reinterpret_cast<TARGET&>(*this);
215
12
    }
Unexecuted instantiation: _ZN5doris23PipelineXLocalStateBase4castINS_16EsScanLocalStateEEERT_v
_ZN5doris23PipelineXLocalStateBase4castINS_23HashJoinProbeLocalStateEEERT_v
Line
Count
Source
210
1.44M
    TARGET& cast() {
211
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
212
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
213
18.4E
                << " and expect type is" << typeid(TARGET).name();
214
1.44M
        return reinterpret_cast<TARGET&>(*this);
215
1.44M
    }
_ZN5doris23PipelineXLocalStateBase4castINS_34PartitionedHashJoinProbeLocalStateEEERT_v
Line
Count
Source
210
46
    TARGET& cast() {
211
46
        DCHECK(dynamic_cast<TARGET*>(this))
212
0
                << " Mismatch type! Current type is " << typeid(*this).name()
213
0
                << " and expect type is" << typeid(TARGET).name();
214
46
        return reinterpret_cast<TARGET&>(*this);
215
46
    }
_ZN5doris23PipelineXLocalStateBase4castINS_29NestedLoopJoinProbeLocalStateEEERT_v
Line
Count
Source
210
207k
    TARGET& cast() {
211
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
212
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
213
18.4E
                << " and expect type is" << typeid(TARGET).name();
214
207k
        return reinterpret_cast<TARGET&>(*this);
215
207k
    }
_ZN5doris23PipelineXLocalStateBase4castINS_21UnionSourceLocalStateEEERT_v
Line
Count
Source
210
327k
    TARGET& cast() {
211
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
212
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
213
18.4E
                << " and expect type is" << typeid(TARGET).name();
214
327k
        return reinterpret_cast<TARGET&>(*this);
215
327k
    }
_ZN5doris23PipelineXLocalStateBase4castINS_29PartitionSortSourceLocalStateEEERT_v
Line
Count
Source
210
2.44k
    TARGET& cast() {
211
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
212
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
213
18.4E
                << " and expect type is" << typeid(TARGET).name();
214
2.44k
        return reinterpret_cast<TARGET&>(*this);
215
2.44k
    }
_ZN5doris23PipelineXLocalStateBase4castINS_25MaterializationLocalStateEEERT_v
Line
Count
Source
210
12.0k
    TARGET& cast() {
211
12.0k
        DCHECK(dynamic_cast<TARGET*>(this))
212
0
                << " Mismatch type! Current type is " << typeid(*this).name()
213
0
                << " and expect type is" << typeid(TARGET).name();
214
12.0k
        return reinterpret_cast<TARGET&>(*this);
215
12.0k
    }
_ZN5doris23PipelineXLocalStateBase4castINS_19SetSourceLocalStateILb1EEEEERT_v
Line
Count
Source
210
7.24k
    TARGET& cast() {
211
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
212
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
213
18.4E
                << " and expect type is" << typeid(TARGET).name();
214
7.24k
        return reinterpret_cast<TARGET&>(*this);
215
7.24k
    }
_ZN5doris23PipelineXLocalStateBase4castINS_19SetSourceLocalStateILb0EEEEERT_v
Line
Count
Source
210
7.30k
    TARGET& cast() {
211
7.30k
        DCHECK(dynamic_cast<TARGET*>(this))
212
0
                << " Mismatch type! Current type is " << typeid(*this).name()
213
0
                << " and expect type is" << typeid(TARGET).name();
214
7.30k
        return reinterpret_cast<TARGET&>(*this);
215
7.30k
    }
_ZN5doris23PipelineXLocalStateBase4castINS_18EmptySetLocalStateEEERT_v
Line
Count
Source
210
3.04k
    TARGET& cast() {
211
3.04k
        DCHECK(dynamic_cast<TARGET*>(this))
212
0
                << " Mismatch type! Current type is " << typeid(*this).name()
213
0
                << " and expect type is" << typeid(TARGET).name();
214
3.04k
        return reinterpret_cast<TARGET&>(*this);
215
3.04k
    }
_ZN5doris23PipelineXLocalStateBase4castINS_18MetaScanLocalStateEEERT_v
Line
Count
Source
210
15.4k
    TARGET& cast() {
211
15.4k
        DCHECK(dynamic_cast<TARGET*>(this))
212
0
                << " Mismatch type! Current type is " << typeid(*this).name()
213
0
                << " and expect type is" << typeid(TARGET).name();
214
15.4k
        return reinterpret_cast<TARGET&>(*this);
215
15.4k
    }
_ZN5doris23PipelineXLocalStateBase4castINS_16SelectLocalStateEEERT_v
Line
Count
Source
210
20.0k
    TARGET& cast() {
211
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
212
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
213
18.4E
                << " and expect type is" << typeid(TARGET).name();
214
20.0k
        return reinterpret_cast<TARGET&>(*this);
215
20.0k
    }
_ZN5doris23PipelineXLocalStateBase4castINS_20RecCTEScanLocalStateEEERT_v
Line
Count
Source
210
11.7k
    TARGET& cast() {
211
11.7k
        DCHECK(dynamic_cast<TARGET*>(this))
212
0
                << " Mismatch type! Current type is " << typeid(*this).name()
213
0
                << " and expect type is" << typeid(TARGET).name();
214
11.7k
        return reinterpret_cast<TARGET&>(*this);
215
11.7k
    }
_ZN5doris23PipelineXLocalStateBase4castINS_23TableFunctionLocalStateEEERT_v
Line
Count
Source
210
62.9k
    TARGET& cast() {
211
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
212
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
213
18.4E
                << " and expect type is" << typeid(TARGET).name();
214
62.9k
        return reinterpret_cast<TARGET&>(*this);
215
62.9k
    }
_ZN5doris23PipelineXLocalStateBase4castINS_18ExchangeLocalStateEEERT_v
Line
Count
Source
210
1.99M
    TARGET& cast() {
211
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
212
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
213
18.4E
                << " and expect type is" << typeid(TARGET).name();
214
1.99M
        return reinterpret_cast<TARGET&>(*this);
215
1.99M
    }
_ZN5doris23PipelineXLocalStateBase4castINS_30DistinctStreamingAggLocalStateEEERT_v
Line
Count
Source
210
5.12M
    TARGET& cast() {
211
5.12M
        DCHECK(dynamic_cast<TARGET*>(this))
212
1.91k
                << " Mismatch type! Current type is " << typeid(*this).name()
213
1.91k
                << " and expect type is" << typeid(TARGET).name();
214
5.12M
        return reinterpret_cast<TARGET&>(*this);
215
5.12M
    }
_ZN5doris23PipelineXLocalStateBase4castINS_22StreamingAggLocalStateEEERT_v
Line
Count
Source
210
152k
    TARGET& cast() {
211
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
212
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
213
18.4E
                << " and expect type is" << typeid(TARGET).name();
214
152k
        return reinterpret_cast<TARGET&>(*this);
215
152k
    }
_ZN5doris23PipelineXLocalStateBase4castINS_13AggLocalStateEEERT_v
Line
Count
Source
210
366k
    TARGET& cast() {
211
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
212
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
213
18.4E
                << " and expect type is" << typeid(TARGET).name();
214
366k
        return reinterpret_cast<TARGET&>(*this);
215
366k
    }
_ZN5doris23PipelineXLocalStateBase4castINS_24PartitionedAggLocalStateEEERT_v
Line
Count
Source
210
12.6k
    TARGET& cast() {
211
12.6k
        DCHECK(dynamic_cast<TARGET*>(this))
212
0
                << " Mismatch type! Current type is " << typeid(*this).name()
213
0
                << " and expect type is" << typeid(TARGET).name();
214
12.6k
        return reinterpret_cast<TARGET&>(*this);
215
12.6k
    }
_ZN5doris23PipelineXLocalStateBase4castINS_14SortLocalStateEEERT_v
Line
Count
Source
210
56.1k
    TARGET& cast() {
211
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
212
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
213
18.4E
                << " and expect type is" << typeid(TARGET).name();
214
56.1k
        return reinterpret_cast<TARGET&>(*this);
215
56.1k
    }
_ZN5doris23PipelineXLocalStateBase4castINS_19SpillSortLocalStateEEERT_v
Line
Count
Source
210
510
    TARGET& cast() {
211
510
        DCHECK(dynamic_cast<TARGET*>(this))
212
1
                << " Mismatch type! Current type is " << typeid(*this).name()
213
1
                << " and expect type is" << typeid(TARGET).name();
214
510
        return reinterpret_cast<TARGET&>(*this);
215
510
    }
_ZN5doris23PipelineXLocalStateBase4castINS_24LocalMergeSortLocalStateEEERT_v
Line
Count
Source
210
990k
    TARGET& cast() {
211
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
212
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
213
18.4E
                << " and expect type is" << typeid(TARGET).name();
214
990k
        return reinterpret_cast<TARGET&>(*this);
215
990k
    }
_ZN5doris23PipelineXLocalStateBase4castINS_18AnalyticLocalStateEEERT_v
Line
Count
Source
210
42.7k
    TARGET& cast() {
211
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
212
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
213
18.4E
                << " and expect type is" << typeid(TARGET).name();
214
42.7k
        return reinterpret_cast<TARGET&>(*this);
215
42.7k
    }
_ZN5doris23PipelineXLocalStateBase4castINS_16RepeatLocalStateEEERT_v
Line
Count
Source
210
25.2k
    TARGET& cast() {
211
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
212
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
213
18.4E
                << " and expect type is" << typeid(TARGET).name();
214
25.2k
        return reinterpret_cast<TARGET&>(*this);
215
25.2k
    }
_ZN5doris23PipelineXLocalStateBase4castINS_23AssertNumRowsLocalStateEEERT_v
Line
Count
Source
210
85
    TARGET& cast() {
211
85
        DCHECK(dynamic_cast<TARGET*>(this))
212
0
                << " Mismatch type! Current type is " << typeid(*this).name()
213
0
                << " and expect type is" << typeid(TARGET).name();
214
85
        return reinterpret_cast<TARGET&>(*this);
215
85
    }
_ZN5doris23PipelineXLocalStateBase4castINS_17DataGenLocalStateEEERT_v
Line
Count
Source
210
40.3k
    TARGET& cast() {
211
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
212
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
213
18.4E
                << " and expect type is" << typeid(TARGET).name();
214
40.3k
        return reinterpret_cast<TARGET&>(*this);
215
40.3k
    }
_ZN5doris23PipelineXLocalStateBase4castINS_20SchemaScanLocalStateEEERT_v
Line
Count
Source
210
8.97k
    TARGET& cast() {
211
8.97k
        DCHECK(dynamic_cast<TARGET*>(this))
212
0
                << " Mismatch type! Current type is " << typeid(*this).name()
213
0
                << " and expect type is" << typeid(TARGET).name();
214
8.97k
        return reinterpret_cast<TARGET&>(*this);
215
8.97k
    }
216
    template <class TARGET>
217
    const TARGET& cast() const {
218
        DCHECK(dynamic_cast<TARGET*>(this))
219
                << " Mismatch type! Current type is " << typeid(*this).name()
220
                << " and expect type is" << typeid(TARGET).name();
221
        return reinterpret_cast<const TARGET&>(*this);
222
    }
223
224
    // Do initialization. This step should be executed only once and in bthread, so we can do some
225
    // lightweight or non-idempotent operations (e.g. init profile, clone expr ctx from operatorX)
226
    virtual Status init(RuntimeState* state, LocalStateInfo& info) = 0;
227
    // Make sure all resources are ready before execution. For example, remote tablets should be
228
    // loaded to local storage.
229
    // This is called by execution pthread and different from `Operator::prepare` which is called
230
    // by bthread.
231
    virtual Status prepare(RuntimeState* state) = 0;
232
    // Do initialization. This step can be executed multiple times, so we should make sure it is
233
    // idempotent (e.g. wait for runtime filters).
234
    virtual Status open(RuntimeState* state) = 0;
235
    virtual Status close(RuntimeState* state) = 0;
236
    virtual Status terminate(RuntimeState* state) = 0;
237
238
    // If use projection, we should clear `_origin_block`.
239
    void clear_origin_block();
240
241
    void reached_limit(Block* block, bool* eos);
242
2.55M
    RuntimeProfile* operator_profile() { return _operator_profile.get(); }
243
684k
    RuntimeProfile* common_profile() { return _common_profile.get(); }
244
16.3M
    RuntimeProfile* custom_profile() { return _custom_profile.get(); }
245
246
14.0M
    RuntimeProfile::Counter* exec_time_counter() { return _exec_timer; }
247
0
    RuntimeProfile::Counter* memory_used_counter() { return _memory_used_counter; }
248
6.82k
    OperatorXBase* parent() { return _parent; }
249
3.56M
    RuntimeState* state() { return _state; }
250
633k
    VExprContextSPtrs& conjuncts() { return _conjuncts; }
251
0
    VExprContextSPtrs& projections() { return _projections; }
252
5.52k
    [[nodiscard]] int64_t num_rows_returned() const { return _num_rows_returned; }
253
725k
    void add_num_rows_returned(int64_t delta) { _num_rows_returned += delta; }
254
1.70k
    void set_num_rows_returned(int64_t value) { _num_rows_returned = value; }
255
256
    [[nodiscard]] virtual std::string debug_string(int indentation_level = 0) const = 0;
257
    [[nodiscard]] virtual bool is_blockable() const;
258
259
0
    virtual std::vector<Dependency*> dependencies() const { return {nullptr}; }
260
261
    // override in Scan
262
2.55M
    virtual Dependency* finishdependency() { return nullptr; }
263
    //  override in Scan  MultiCastSink
264
1.54M
    virtual std::vector<Dependency*> execution_dependencies() { return {}; }
265
266
    Status filter_block(const VExprContextSPtrs& expr_contexts, Block* block);
267
268
3.98M
    int64_t& estimate_memory_usage() { return _estimate_memory_usage; }
269
270
6.63M
    void reset_estimate_memory_usage() { _estimate_memory_usage = 0; }
271
272
7.44M
    bool low_memory_mode() {
273
#ifdef BE_TEST
274
        return false;
275
#else
276
7.44M
        return _state->low_memory_mode();
277
7.44M
#endif
278
7.44M
    }
279
280
protected:
281
    friend class OperatorXBase;
282
    template <typename LocalStateType>
283
    friend class ScanOperatorX;
284
285
    ObjectPool* _pool = nullptr;
286
    int64_t _num_rows_returned {0};
287
    int64_t _estimate_memory_usage {0};
288
289
    /*
290
    Each operator has its profile like this:
291
    XXXX_OPERATOR:
292
        CommonCounters:
293
            ...
294
        CustomCounters:
295
            ...
296
    */
297
    // Profile of this operator.
298
    // Should not modify this profile usually.
299
    std::unique_ptr<RuntimeProfile> _operator_profile;
300
    // CommonCounters of this operator.
301
    // CommonCounters are counters that will be used by all operators.
302
    std::unique_ptr<RuntimeProfile> _common_profile;
303
    // CustomCounters of this operator.
304
    // CustomCounters are counters that will be used by this operator only.
305
    std::unique_ptr<RuntimeProfile> _custom_profile;
306
307
    RuntimeProfile::Counter* _rows_returned_counter = nullptr;
308
    RuntimeProfile::Counter* _blocks_returned_counter = nullptr;
309
    RuntimeProfile::Counter* _wait_for_dependency_timer = nullptr;
310
    // Account for current memory and peak memory used by this node
311
    RuntimeProfile::HighWaterMarkCounter* _memory_used_counter = nullptr;
312
    RuntimeProfile::Counter* _projection_timer = nullptr;
313
    RuntimeProfile::Counter* _exec_timer = nullptr;
314
    RuntimeProfile::Counter* _init_timer = nullptr;
315
    RuntimeProfile::Counter* _open_timer = nullptr;
316
    RuntimeProfile::Counter* _close_timer = nullptr;
317
318
    OperatorXBase* _parent = nullptr;
319
    RuntimeState* _state = nullptr;
320
    VExprContextSPtrs _conjuncts;
321
    VExprContextSPtrs _projections;
322
    std::shared_ptr<ScoreRuntime> _score_runtime;
323
    std::shared_ptr<segment_v2::AnnTopNRuntime> _ann_topn_runtime;
324
    // Used in common subexpression elimination to compute intermediate results.
325
    std::vector<VExprContextSPtrs> _intermediate_projections;
326
327
    bool _closed = false;
328
    std::atomic<bool> _terminated = false;
329
    Block _origin_block;
330
};
331
332
template <typename SharedStateArg = FakeSharedState>
333
class PipelineXLocalState : public PipelineXLocalStateBase {
334
public:
335
    using SharedStateType = SharedStateArg;
336
    PipelineXLocalState(RuntimeState* state, OperatorXBase* parent)
337
2.56M
            : PipelineXLocalStateBase(state, parent) {}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEEC2EPNS_12RuntimeStateEPNS_13OperatorXBaseE
Line
Count
Source
337
136k
            : PipelineXLocalStateBase(state, parent) {}
_ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEEC2EPNS_12RuntimeStateEPNS_13OperatorXBaseE
Line
Count
Source
337
24
            : PipelineXLocalStateBase(state, parent) {}
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEEC2EPNS_12RuntimeStateEPNS_13OperatorXBaseE
Line
Count
Source
337
191k
            : PipelineXLocalStateBase(state, parent) {}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEEC2EPNS_12RuntimeStateEPNS_13OperatorXBaseE
Line
Count
Source
337
19
            : PipelineXLocalStateBase(state, parent) {}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEEC2EPNS_12RuntimeStateEPNS_13OperatorXBaseE
Line
Count
Source
337
5.12k
            : PipelineXLocalStateBase(state, parent) {}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEEC2EPNS_12RuntimeStateEPNS_13OperatorXBaseE
Line
Count
Source
337
10.0k
            : PipelineXLocalStateBase(state, parent) {}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEEC2EPNS_12RuntimeStateEPNS_13OperatorXBaseE
Line
Count
Source
337
119k
            : PipelineXLocalStateBase(state, parent) {}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEEC2EPNS_12RuntimeStateEPNS_13OperatorXBaseE
Line
Count
Source
337
323
            : PipelineXLocalStateBase(state, parent) {}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEEC2EPNS_12RuntimeStateEPNS_13OperatorXBaseE
Line
Count
Source
337
1.32M
            : PipelineXLocalStateBase(state, parent) {}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEEC2EPNS_12RuntimeStateEPNS_13OperatorXBaseE
Line
Count
Source
337
39.3k
            : PipelineXLocalStateBase(state, parent) {}
_ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEEC2EPNS_12RuntimeStateEPNS_13OperatorXBaseE
Line
Count
Source
337
369
            : PipelineXLocalStateBase(state, parent) {}
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEEC2EPNS_12RuntimeStateEPNS_13OperatorXBaseE
Line
Count
Source
337
6.34k
            : PipelineXLocalStateBase(state, parent) {}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEEC2EPNS_12RuntimeStateEPNS_13OperatorXBaseE
Line
Count
Source
337
422
            : PipelineXLocalStateBase(state, parent) {}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEEC2EPNS_12RuntimeStateEPNS_13OperatorXBaseE
Line
Count
Source
337
4.85k
            : PipelineXLocalStateBase(state, parent) {}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEEC2EPNS_12RuntimeStateEPNS_13OperatorXBaseE
Line
Count
Source
337
725k
            : PipelineXLocalStateBase(state, parent) {}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEEC2EPNS_12RuntimeStateEPNS_13OperatorXBaseE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEEC2EPNS_12RuntimeStateEPNS_13OperatorXBaseE
Line
Count
Source
337
150
            : PipelineXLocalStateBase(state, parent) {}
338
    ~PipelineXLocalState() override = default;
339
340
    Status init(RuntimeState* state, LocalStateInfo& info) override;
341
11.5M
    Status prepare(RuntimeState* state) override { return Status::OK(); }
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE7prepareEPNS_12RuntimeStateE
Line
Count
Source
341
5.19M
    Status prepare(RuntimeState* state) override { return Status::OK(); }
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE7prepareEPNS_12RuntimeStateE
Line
Count
Source
341
24.2k
    Status prepare(RuntimeState* state) override { return Status::OK(); }
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE7prepareEPNS_12RuntimeStateE
Line
Count
Source
341
1.00M
    Status prepare(RuntimeState* state) override { return Status::OK(); }
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE7prepareEPNS_12RuntimeStateE
Line
Count
Source
341
3.84M
    Status prepare(RuntimeState* state) override { return Status::OK(); }
_ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE7prepareEPNS_12RuntimeStateE
Line
Count
Source
341
1.55k
    Status prepare(RuntimeState* state) override { return Status::OK(); }
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE7prepareEPNS_12RuntimeStateE
Line
Count
Source
341
1.71k
    Status prepare(RuntimeState* state) override { return Status::OK(); }
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE7prepareEPNS_12RuntimeStateE
Line
Count
Source
341
96.6k
    Status prepare(RuntimeState* state) override { return Status::OK(); }
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE7prepareEPNS_12RuntimeStateE
Line
Count
Source
341
617k
    Status prepare(RuntimeState* state) override { return Status::OK(); }
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE7prepareEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE7prepareEPNS_12RuntimeStateE
Line
Count
Source
341
102
    Status prepare(RuntimeState* state) override { return Status::OK(); }
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE7prepareEPNS_12RuntimeStateE
Line
Count
Source
341
37.0k
    Status prepare(RuntimeState* state) override { return Status::OK(); }
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE7prepareEPNS_12RuntimeStateE
Line
Count
Source
341
50.1k
    Status prepare(RuntimeState* state) override { return Status::OK(); }
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE7prepareEPNS_12RuntimeStateE
Line
Count
Source
341
576k
    Status prepare(RuntimeState* state) override { return Status::OK(); }
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE7prepareEPNS_12RuntimeStateE
Line
Count
Source
341
2.48k
    Status prepare(RuntimeState* state) override { return Status::OK(); }
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE7prepareEPNS_12RuntimeStateE
Line
Count
Source
341
45.9k
    Status prepare(RuntimeState* state) override { return Status::OK(); }
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE7prepareEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE7prepareEPNS_12RuntimeStateE
Line
Count
Source
341
4.31k
    Status prepare(RuntimeState* state) override { return Status::OK(); }
342
    Status open(RuntimeState* state) override;
343
344
    virtual std::string name_suffix() const;
345
346
    Status close(RuntimeState* state) override;
347
    Status terminate(RuntimeState* state) override;
348
349
    [[nodiscard]] std::string debug_string(int indentation_level = 0) const override;
350
351
27.7M
    std::vector<Dependency*> dependencies() const override {
352
27.7M
        return _dependency ? std::vector<Dependency*> {_dependency} : std::vector<Dependency*> {};
353
27.7M
    }
_ZNK5doris19PipelineXLocalStateINS_15FakeSharedStateEE12dependenciesEv
Line
Count
Source
351
553k
    std::vector<Dependency*> dependencies() const override {
352
553k
        return _dependency ? std::vector<Dependency*> {_dependency} : std::vector<Dependency*> {};
353
553k
    }
_ZNK5doris19PipelineXLocalStateINS_14SetSharedStateEE12dependenciesEv
Line
Count
Source
351
4.83k
    std::vector<Dependency*> dependencies() const override {
352
18.4E
        return _dependency ? std::vector<Dependency*> {_dependency} : std::vector<Dependency*> {};
353
4.83k
    }
_ZNK5doris19PipelineXLocalStateINS_15SortSharedStateEE12dependenciesEv
Line
Count
Source
351
164k
    std::vector<Dependency*> dependencies() const override {
352
164k
        return _dependency ? std::vector<Dependency*> {_dependency} : std::vector<Dependency*> {};
353
164k
    }
_ZNK5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE12dependenciesEv
Line
Count
Source
351
723k
    std::vector<Dependency*> dependencies() const override {
352
18.4E
        return _dependency ? std::vector<Dependency*> {_dependency} : std::vector<Dependency*> {};
353
723k
    }
_ZNK5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE12dependenciesEv
Line
Count
Source
351
363
    std::vector<Dependency*> dependencies() const override {
352
18.4E
        return _dependency ? std::vector<Dependency*> {_dependency} : std::vector<Dependency*> {};
353
363
    }
_ZNK5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE12dependenciesEv
Line
Count
Source
351
26.0M
    std::vector<Dependency*> dependencies() const override {
352
26.0M
        return _dependency ? std::vector<Dependency*> {_dependency} : std::vector<Dependency*> {};
353
26.0M
    }
_ZNK5doris19PipelineXLocalStateINS_16UnionSharedStateEE12dependenciesEv
Line
Count
Source
351
39.5k
    std::vector<Dependency*> dependencies() const override {
352
39.5k
        return _dependency ? std::vector<Dependency*> {_dependency} : std::vector<Dependency*> {};
353
39.5k
    }
_ZNK5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE12dependenciesEv
Line
Count
Source
351
112k
    std::vector<Dependency*> dependencies() const override {
352
18.4E
        return _dependency ? std::vector<Dependency*> {_dependency} : std::vector<Dependency*> {};
353
112k
    }
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE12dependenciesEv
_ZNK5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE12dependenciesEv
Line
Count
Source
351
14
    std::vector<Dependency*> dependencies() const override {
352
14
        return _dependency ? std::vector<Dependency*> {_dependency} : std::vector<Dependency*> {};
353
14
    }
_ZNK5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE12dependenciesEv
Line
Count
Source
351
5.25k
    std::vector<Dependency*> dependencies() const override {
352
5.25k
        return _dependency ? std::vector<Dependency*> {_dependency} : std::vector<Dependency*> {};
353
5.25k
    }
_ZNK5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE12dependenciesEv
Line
Count
Source
351
10.0k
    std::vector<Dependency*> dependencies() const override {
352
10.0k
        return _dependency ? std::vector<Dependency*> {_dependency} : std::vector<Dependency*> {};
353
10.0k
    }
_ZNK5doris19PipelineXLocalStateINS_14AggSharedStateEE12dependenciesEv
Line
Count
Source
351
118k
    std::vector<Dependency*> dependencies() const override {
352
18.4E
        return _dependency ? std::vector<Dependency*> {_dependency} : std::vector<Dependency*> {};
353
118k
    }
_ZNK5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE12dependenciesEv
Line
Count
Source
351
318
    std::vector<Dependency*> dependencies() const override {
352
318
        return _dependency ? std::vector<Dependency*> {_dependency} : std::vector<Dependency*> {};
353
318
    }
_ZNK5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE12dependenciesEv
Line
Count
Source
351
6.32k
    std::vector<Dependency*> dependencies() const override {
352
18.4E
        return _dependency ? std::vector<Dependency*> {_dependency} : std::vector<Dependency*> {};
353
6.32k
    }
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_16BasicSharedStateEE12dependenciesEv
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_17RecCTESharedStateEE12dependenciesEv
354
355
2.49M
    virtual bool must_set_shared_state() const {
356
2.49M
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
357
2.49M
    }
_ZNK5doris19PipelineXLocalStateINS_15FakeSharedStateEE21must_set_shared_stateEv
Line
Count
Source
355
1.31M
    virtual bool must_set_shared_state() const {
356
1.31M
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
357
1.31M
    }
_ZNK5doris19PipelineXLocalStateINS_14SetSharedStateEE21must_set_shared_stateEv
Line
Count
Source
355
4.81k
    virtual bool must_set_shared_state() const {
356
4.81k
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
357
4.81k
    }
_ZNK5doris19PipelineXLocalStateINS_15SortSharedStateEE21must_set_shared_stateEv
Line
Count
Source
355
188k
    virtual bool must_set_shared_state() const {
356
188k
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
357
188k
    }
_ZNK5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE21must_set_shared_stateEv
Line
Count
Source
355
713k
    virtual bool must_set_shared_state() const {
356
713k
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
357
713k
    }
_ZNK5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE21must_set_shared_stateEv
Line
Count
Source
355
368
    virtual bool must_set_shared_state() const {
356
368
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
357
368
    }
_ZNK5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE21must_set_shared_stateEv
Line
Count
Source
355
422
    virtual bool must_set_shared_state() const {
356
422
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
357
422
    }
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_16UnionSharedStateEE21must_set_shared_stateEv
_ZNK5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE21must_set_shared_stateEv
Line
Count
Source
355
134k
    virtual bool must_set_shared_state() const {
356
134k
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
357
134k
    }
_ZNK5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE21must_set_shared_stateEv
Line
Count
Source
355
1
    virtual bool must_set_shared_state() const {
356
1
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
357
1
    }
_ZNK5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE21must_set_shared_stateEv
Line
Count
Source
355
19
    virtual bool must_set_shared_state() const {
356
19
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
357
19
    }
_ZNK5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE21must_set_shared_stateEv
Line
Count
Source
355
5.07k
    virtual bool must_set_shared_state() const {
356
5.07k
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
357
5.07k
    }
_ZNK5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE21must_set_shared_stateEv
Line
Count
Source
355
10.0k
    virtual bool must_set_shared_state() const {
356
10.0k
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
357
10.0k
    }
_ZNK5doris19PipelineXLocalStateINS_14AggSharedStateEE21must_set_shared_stateEv
Line
Count
Source
355
117k
    virtual bool must_set_shared_state() const {
356
117k
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
357
117k
    }
_ZNK5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE21must_set_shared_stateEv
Line
Count
Source
355
322
    virtual bool must_set_shared_state() const {
356
322
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
357
322
    }
_ZNK5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE21must_set_shared_stateEv
Line
Count
Source
355
6.29k
    virtual bool must_set_shared_state() const {
356
6.29k
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
357
6.29k
    }
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_16BasicSharedStateEE21must_set_shared_stateEv
_ZNK5doris19PipelineXLocalStateINS_17RecCTESharedStateEE21must_set_shared_stateEv
Line
Count
Source
355
150
    virtual bool must_set_shared_state() const {
356
150
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
357
150
    }
358
359
protected:
360
    Dependency* _dependency = nullptr;
361
    SharedStateArg* _shared_state = nullptr;
362
};
363
364
template <typename SharedStateArg>
365
class PipelineXSpillLocalState : public PipelineXLocalState<SharedStateArg> {
366
public:
367
    using Base = PipelineXLocalState<SharedStateArg>;
368
    PipelineXSpillLocalState(RuntimeState* state, OperatorXBase* parent)
369
6.70k
            : PipelineXLocalState<SharedStateArg>(state, parent) {}
_ZN5doris24PipelineXSpillLocalStateINS_30PartitionedHashJoinSharedStateEEC2EPNS_12RuntimeStateEPNS_13OperatorXBaseE
Line
Count
Source
369
24
            : PipelineXLocalState<SharedStateArg>(state, parent) {}
_ZN5doris24PipelineXSpillLocalStateINS_20SpillSortSharedStateEEC2EPNS_12RuntimeStateEPNS_13OperatorXBaseE
Line
Count
Source
369
19
            : PipelineXLocalState<SharedStateArg>(state, parent) {}
_ZN5doris24PipelineXSpillLocalStateINS_25PartitionedAggSharedStateEEC2EPNS_12RuntimeStateEPNS_13OperatorXBaseE
Line
Count
Source
369
323
            : PipelineXLocalState<SharedStateArg>(state, parent) {}
_ZN5doris24PipelineXSpillLocalStateINS_20MultiCastSharedStateEEC2EPNS_12RuntimeStateEPNS_13OperatorXBaseE
Line
Count
Source
369
6.34k
            : PipelineXLocalState<SharedStateArg>(state, parent) {}
370
    ~PipelineXSpillLocalState() override = default;
371
372
6.68k
    Status init(RuntimeState* state, LocalStateInfo& info) override {
373
6.68k
        RETURN_IF_ERROR(PipelineXLocalState<SharedStateArg>::init(state, info));
374
375
6.68k
        init_spill_read_counters();
376
377
6.68k
        return Status::OK();
378
6.68k
    }
_ZN5doris24PipelineXSpillLocalStateINS_20SpillSortSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
372
19
    Status init(RuntimeState* state, LocalStateInfo& info) override {
373
19
        RETURN_IF_ERROR(PipelineXLocalState<SharedStateArg>::init(state, info));
374
375
19
        init_spill_read_counters();
376
377
19
        return Status::OK();
378
19
    }
_ZN5doris24PipelineXSpillLocalStateINS_25PartitionedAggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
372
323
    Status init(RuntimeState* state, LocalStateInfo& info) override {
373
323
        RETURN_IF_ERROR(PipelineXLocalState<SharedStateArg>::init(state, info));
374
375
323
        init_spill_read_counters();
376
377
323
        return Status::OK();
378
323
    }
_ZN5doris24PipelineXSpillLocalStateINS_20MultiCastSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
372
6.34k
    Status init(RuntimeState* state, LocalStateInfo& info) override {
373
6.34k
        RETURN_IF_ERROR(PipelineXLocalState<SharedStateArg>::init(state, info));
374
375
6.34k
        init_spill_read_counters();
376
377
6.34k
        return Status::OK();
378
6.34k
    }
_ZN5doris24PipelineXSpillLocalStateINS_30PartitionedHashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
372
1
    Status init(RuntimeState* state, LocalStateInfo& info) override {
373
1
        RETURN_IF_ERROR(PipelineXLocalState<SharedStateArg>::init(state, info));
374
375
1
        init_spill_read_counters();
376
377
1
        return Status::OK();
378
1
    }
379
380
41
    void init_spill_write_counters() {
381
41
        _spill_write_timer = ADD_TIMER_WITH_LEVEL(Base::custom_profile(), "SpillWriteTime", 1);
382
383
41
        _spill_write_wait_in_queue_task_count = ADD_COUNTER_WITH_LEVEL(
384
41
                Base::custom_profile(), "SpillWriteTaskWaitInQueueCount", TUnit::UNIT, 1);
385
41
        _spill_writing_task_count = ADD_COUNTER_WITH_LEVEL(Base::custom_profile(),
386
41
                                                           "SpillWriteTaskCount", TUnit::UNIT, 1);
387
41
        _spill_write_wait_in_queue_timer =
388
41
                ADD_TIMER_WITH_LEVEL(Base::custom_profile(), "SpillWriteTaskWaitInQueueTime", 1);
389
390
41
        _spill_write_file_timer =
391
41
                ADD_TIMER_WITH_LEVEL(Base::custom_profile(), "SpillWriteFileTime", 1);
392
393
41
        _spill_write_serialize_block_timer =
394
41
                ADD_TIMER_WITH_LEVEL(Base::custom_profile(), "SpillWriteSerializeBlockTime", 1);
395
41
        _spill_write_block_count = ADD_COUNTER_WITH_LEVEL(Base::custom_profile(),
396
41
                                                          "SpillWriteBlockCount", TUnit::UNIT, 1);
397
41
        _spill_write_block_data_size = ADD_COUNTER_WITH_LEVEL(
398
41
                Base::custom_profile(), "SpillWriteBlockBytes", TUnit::BYTES, 1);
399
41
        _spill_write_file_total_size = ADD_COUNTER_WITH_LEVEL(
400
41
                Base::custom_profile(), "SpillWriteFileBytes", TUnit::BYTES, 1);
401
41
        _spill_write_rows_count =
402
41
                ADD_COUNTER_WITH_LEVEL(Base::custom_profile(), "SpillWriteRows", TUnit::UNIT, 1);
403
41
        _spill_file_total_count = ADD_COUNTER_WITH_LEVEL(
404
41
                Base::custom_profile(), "SpillWriteFileTotalCount", TUnit::UNIT, 1);
405
41
    }
_ZN5doris24PipelineXSpillLocalStateINS_30PartitionedHashJoinSharedStateEE25init_spill_write_countersEv
Line
Count
Source
380
24
    void init_spill_write_counters() {
381
24
        _spill_write_timer = ADD_TIMER_WITH_LEVEL(Base::custom_profile(), "SpillWriteTime", 1);
382
383
24
        _spill_write_wait_in_queue_task_count = ADD_COUNTER_WITH_LEVEL(
384
24
                Base::custom_profile(), "SpillWriteTaskWaitInQueueCount", TUnit::UNIT, 1);
385
24
        _spill_writing_task_count = ADD_COUNTER_WITH_LEVEL(Base::custom_profile(),
386
24
                                                           "SpillWriteTaskCount", TUnit::UNIT, 1);
387
24
        _spill_write_wait_in_queue_timer =
388
24
                ADD_TIMER_WITH_LEVEL(Base::custom_profile(), "SpillWriteTaskWaitInQueueTime", 1);
389
390
24
        _spill_write_file_timer =
391
24
                ADD_TIMER_WITH_LEVEL(Base::custom_profile(), "SpillWriteFileTime", 1);
392
393
24
        _spill_write_serialize_block_timer =
394
24
                ADD_TIMER_WITH_LEVEL(Base::custom_profile(), "SpillWriteSerializeBlockTime", 1);
395
24
        _spill_write_block_count = ADD_COUNTER_WITH_LEVEL(Base::custom_profile(),
396
24
                                                          "SpillWriteBlockCount", TUnit::UNIT, 1);
397
24
        _spill_write_block_data_size = ADD_COUNTER_WITH_LEVEL(
398
24
                Base::custom_profile(), "SpillWriteBlockBytes", TUnit::BYTES, 1);
399
24
        _spill_write_file_total_size = ADD_COUNTER_WITH_LEVEL(
400
24
                Base::custom_profile(), "SpillWriteFileBytes", TUnit::BYTES, 1);
401
24
        _spill_write_rows_count =
402
24
                ADD_COUNTER_WITH_LEVEL(Base::custom_profile(), "SpillWriteRows", TUnit::UNIT, 1);
403
24
        _spill_file_total_count = ADD_COUNTER_WITH_LEVEL(
404
24
                Base::custom_profile(), "SpillWriteFileTotalCount", TUnit::UNIT, 1);
405
24
    }
_ZN5doris24PipelineXSpillLocalStateINS_20SpillSortSharedStateEE25init_spill_write_countersEv
Line
Count
Source
380
17
    void init_spill_write_counters() {
381
17
        _spill_write_timer = ADD_TIMER_WITH_LEVEL(Base::custom_profile(), "SpillWriteTime", 1);
382
383
17
        _spill_write_wait_in_queue_task_count = ADD_COUNTER_WITH_LEVEL(
384
17
                Base::custom_profile(), "SpillWriteTaskWaitInQueueCount", TUnit::UNIT, 1);
385
17
        _spill_writing_task_count = ADD_COUNTER_WITH_LEVEL(Base::custom_profile(),
386
17
                                                           "SpillWriteTaskCount", TUnit::UNIT, 1);
387
17
        _spill_write_wait_in_queue_timer =
388
17
                ADD_TIMER_WITH_LEVEL(Base::custom_profile(), "SpillWriteTaskWaitInQueueTime", 1);
389
390
17
        _spill_write_file_timer =
391
17
                ADD_TIMER_WITH_LEVEL(Base::custom_profile(), "SpillWriteFileTime", 1);
392
393
17
        _spill_write_serialize_block_timer =
394
17
                ADD_TIMER_WITH_LEVEL(Base::custom_profile(), "SpillWriteSerializeBlockTime", 1);
395
17
        _spill_write_block_count = ADD_COUNTER_WITH_LEVEL(Base::custom_profile(),
396
17
                                                          "SpillWriteBlockCount", TUnit::UNIT, 1);
397
17
        _spill_write_block_data_size = ADD_COUNTER_WITH_LEVEL(
398
17
                Base::custom_profile(), "SpillWriteBlockBytes", TUnit::BYTES, 1);
399
17
        _spill_write_file_total_size = ADD_COUNTER_WITH_LEVEL(
400
17
                Base::custom_profile(), "SpillWriteFileBytes", TUnit::BYTES, 1);
401
17
        _spill_write_rows_count =
402
17
                ADD_COUNTER_WITH_LEVEL(Base::custom_profile(), "SpillWriteRows", TUnit::UNIT, 1);
403
17
        _spill_file_total_count = ADD_COUNTER_WITH_LEVEL(
404
17
                Base::custom_profile(), "SpillWriteFileTotalCount", TUnit::UNIT, 1);
405
17
    }
406
407
6.66k
    void init_spill_read_counters() {
408
6.66k
        _spill_total_timer = ADD_TIMER_WITH_LEVEL(Base::custom_profile(), "SpillTotalTime", 1);
409
410
        // Spill read counters
411
6.66k
        _spill_recover_time = ADD_TIMER_WITH_LEVEL(Base::custom_profile(), "SpillRecoverTime", 1);
412
413
6.66k
        _spill_read_wait_in_queue_task_count = ADD_COUNTER_WITH_LEVEL(
414
6.66k
                Base::custom_profile(), "SpillReadTaskWaitInQueueCount", TUnit::UNIT, 1);
415
6.66k
        _spill_reading_task_count = ADD_COUNTER_WITH_LEVEL(Base::custom_profile(),
416
6.66k
                                                           "SpillReadTaskCount", TUnit::UNIT, 1);
417
6.66k
        _spill_read_wait_in_queue_timer =
418
6.66k
                ADD_TIMER_WITH_LEVEL(Base::custom_profile(), "SpillReadTaskWaitInQueueTime", 1);
419
420
6.66k
        _spill_read_file_time =
421
6.66k
                ADD_TIMER_WITH_LEVEL(Base::custom_profile(), "SpillReadFileTime", 1);
422
6.66k
        _spill_read_deserialize_block_timer =
423
6.66k
                ADD_TIMER_WITH_LEVEL(Base::custom_profile(), "SpillReadDeserializeBlockTime", 1);
424
425
6.66k
        _spill_read_block_count = ADD_COUNTER_WITH_LEVEL(Base::custom_profile(),
426
6.66k
                                                         "SpillReadBlockCount", TUnit::UNIT, 1);
427
6.66k
        _spill_read_block_data_size = ADD_COUNTER_WITH_LEVEL(
428
6.66k
                Base::custom_profile(), "SpillReadBlockBytes", TUnit::BYTES, 1);
429
6.66k
        _spill_read_file_size = ADD_COUNTER_WITH_LEVEL(Base::custom_profile(), "SpillReadFileBytes",
430
6.66k
                                                       TUnit::BYTES, 1);
431
6.66k
        _spill_read_rows_count =
432
6.66k
                ADD_COUNTER_WITH_LEVEL(Base::custom_profile(), "SpillReadRows", TUnit::UNIT, 1);
433
6.66k
        _spill_read_file_count = ADD_COUNTER_WITH_LEVEL(Base::custom_profile(),
434
6.66k
                                                        "SpillReadFileCount", TUnit::UNIT, 1);
435
436
6.66k
        _spill_file_current_size = ADD_COUNTER_WITH_LEVEL(
437
6.66k
                Base::custom_profile(), "SpillWriteFileCurrentBytes", TUnit::BYTES, 1);
438
6.66k
        _spill_file_current_count = ADD_COUNTER_WITH_LEVEL(
439
6.66k
                Base::custom_profile(), "SpillWriteFileCurrentCount", TUnit::UNIT, 1);
440
6.66k
    }
_ZN5doris24PipelineXSpillLocalStateINS_20SpillSortSharedStateEE24init_spill_read_countersEv
Line
Count
Source
407
17
    void init_spill_read_counters() {
408
17
        _spill_total_timer = ADD_TIMER_WITH_LEVEL(Base::custom_profile(), "SpillTotalTime", 1);
409
410
        // Spill read counters
411
17
        _spill_recover_time = ADD_TIMER_WITH_LEVEL(Base::custom_profile(), "SpillRecoverTime", 1);
412
413
17
        _spill_read_wait_in_queue_task_count = ADD_COUNTER_WITH_LEVEL(
414
17
                Base::custom_profile(), "SpillReadTaskWaitInQueueCount", TUnit::UNIT, 1);
415
17
        _spill_reading_task_count = ADD_COUNTER_WITH_LEVEL(Base::custom_profile(),
416
17
                                                           "SpillReadTaskCount", TUnit::UNIT, 1);
417
17
        _spill_read_wait_in_queue_timer =
418
17
                ADD_TIMER_WITH_LEVEL(Base::custom_profile(), "SpillReadTaskWaitInQueueTime", 1);
419
420
17
        _spill_read_file_time =
421
17
                ADD_TIMER_WITH_LEVEL(Base::custom_profile(), "SpillReadFileTime", 1);
422
17
        _spill_read_deserialize_block_timer =
423
17
                ADD_TIMER_WITH_LEVEL(Base::custom_profile(), "SpillReadDeserializeBlockTime", 1);
424
425
17
        _spill_read_block_count = ADD_COUNTER_WITH_LEVEL(Base::custom_profile(),
426
17
                                                         "SpillReadBlockCount", TUnit::UNIT, 1);
427
17
        _spill_read_block_data_size = ADD_COUNTER_WITH_LEVEL(
428
17
                Base::custom_profile(), "SpillReadBlockBytes", TUnit::BYTES, 1);
429
17
        _spill_read_file_size = ADD_COUNTER_WITH_LEVEL(Base::custom_profile(), "SpillReadFileBytes",
430
17
                                                       TUnit::BYTES, 1);
431
17
        _spill_read_rows_count =
432
17
                ADD_COUNTER_WITH_LEVEL(Base::custom_profile(), "SpillReadRows", TUnit::UNIT, 1);
433
17
        _spill_read_file_count = ADD_COUNTER_WITH_LEVEL(Base::custom_profile(),
434
17
                                                        "SpillReadFileCount", TUnit::UNIT, 1);
435
436
17
        _spill_file_current_size = ADD_COUNTER_WITH_LEVEL(
437
17
                Base::custom_profile(), "SpillWriteFileCurrentBytes", TUnit::BYTES, 1);
438
17
        _spill_file_current_count = ADD_COUNTER_WITH_LEVEL(
439
17
                Base::custom_profile(), "SpillWriteFileCurrentCount", TUnit::UNIT, 1);
440
17
    }
_ZN5doris24PipelineXSpillLocalStateINS_25PartitionedAggSharedStateEE24init_spill_read_countersEv
Line
Count
Source
407
320
    void init_spill_read_counters() {
408
320
        _spill_total_timer = ADD_TIMER_WITH_LEVEL(Base::custom_profile(), "SpillTotalTime", 1);
409
410
        // Spill read counters
411
320
        _spill_recover_time = ADD_TIMER_WITH_LEVEL(Base::custom_profile(), "SpillRecoverTime", 1);
412
413
320
        _spill_read_wait_in_queue_task_count = ADD_COUNTER_WITH_LEVEL(
414
320
                Base::custom_profile(), "SpillReadTaskWaitInQueueCount", TUnit::UNIT, 1);
415
320
        _spill_reading_task_count = ADD_COUNTER_WITH_LEVEL(Base::custom_profile(),
416
320
                                                           "SpillReadTaskCount", TUnit::UNIT, 1);
417
320
        _spill_read_wait_in_queue_timer =
418
320
                ADD_TIMER_WITH_LEVEL(Base::custom_profile(), "SpillReadTaskWaitInQueueTime", 1);
419
420
320
        _spill_read_file_time =
421
320
                ADD_TIMER_WITH_LEVEL(Base::custom_profile(), "SpillReadFileTime", 1);
422
320
        _spill_read_deserialize_block_timer =
423
320
                ADD_TIMER_WITH_LEVEL(Base::custom_profile(), "SpillReadDeserializeBlockTime", 1);
424
425
320
        _spill_read_block_count = ADD_COUNTER_WITH_LEVEL(Base::custom_profile(),
426
320
                                                         "SpillReadBlockCount", TUnit::UNIT, 1);
427
320
        _spill_read_block_data_size = ADD_COUNTER_WITH_LEVEL(
428
320
                Base::custom_profile(), "SpillReadBlockBytes", TUnit::BYTES, 1);
429
320
        _spill_read_file_size = ADD_COUNTER_WITH_LEVEL(Base::custom_profile(), "SpillReadFileBytes",
430
320
                                                       TUnit::BYTES, 1);
431
320
        _spill_read_rows_count =
432
320
                ADD_COUNTER_WITH_LEVEL(Base::custom_profile(), "SpillReadRows", TUnit::UNIT, 1);
433
320
        _spill_read_file_count = ADD_COUNTER_WITH_LEVEL(Base::custom_profile(),
434
320
                                                        "SpillReadFileCount", TUnit::UNIT, 1);
435
436
320
        _spill_file_current_size = ADD_COUNTER_WITH_LEVEL(
437
320
                Base::custom_profile(), "SpillWriteFileCurrentBytes", TUnit::BYTES, 1);
438
320
        _spill_file_current_count = ADD_COUNTER_WITH_LEVEL(
439
320
                Base::custom_profile(), "SpillWriteFileCurrentCount", TUnit::UNIT, 1);
440
320
    }
_ZN5doris24PipelineXSpillLocalStateINS_20MultiCastSharedStateEE24init_spill_read_countersEv
Line
Count
Source
407
6.30k
    void init_spill_read_counters() {
408
6.30k
        _spill_total_timer = ADD_TIMER_WITH_LEVEL(Base::custom_profile(), "SpillTotalTime", 1);
409
410
        // Spill read counters
411
6.30k
        _spill_recover_time = ADD_TIMER_WITH_LEVEL(Base::custom_profile(), "SpillRecoverTime", 1);
412
413
6.30k
        _spill_read_wait_in_queue_task_count = ADD_COUNTER_WITH_LEVEL(
414
6.30k
                Base::custom_profile(), "SpillReadTaskWaitInQueueCount", TUnit::UNIT, 1);
415
6.30k
        _spill_reading_task_count = ADD_COUNTER_WITH_LEVEL(Base::custom_profile(),
416
6.30k
                                                           "SpillReadTaskCount", TUnit::UNIT, 1);
417
6.30k
        _spill_read_wait_in_queue_timer =
418
6.30k
                ADD_TIMER_WITH_LEVEL(Base::custom_profile(), "SpillReadTaskWaitInQueueTime", 1);
419
420
6.30k
        _spill_read_file_time =
421
6.30k
                ADD_TIMER_WITH_LEVEL(Base::custom_profile(), "SpillReadFileTime", 1);
422
6.30k
        _spill_read_deserialize_block_timer =
423
6.30k
                ADD_TIMER_WITH_LEVEL(Base::custom_profile(), "SpillReadDeserializeBlockTime", 1);
424
425
6.30k
        _spill_read_block_count = ADD_COUNTER_WITH_LEVEL(Base::custom_profile(),
426
6.30k
                                                         "SpillReadBlockCount", TUnit::UNIT, 1);
427
6.30k
        _spill_read_block_data_size = ADD_COUNTER_WITH_LEVEL(
428
6.30k
                Base::custom_profile(), "SpillReadBlockBytes", TUnit::BYTES, 1);
429
6.30k
        _spill_read_file_size = ADD_COUNTER_WITH_LEVEL(Base::custom_profile(), "SpillReadFileBytes",
430
6.30k
                                                       TUnit::BYTES, 1);
431
6.30k
        _spill_read_rows_count =
432
6.30k
                ADD_COUNTER_WITH_LEVEL(Base::custom_profile(), "SpillReadRows", TUnit::UNIT, 1);
433
6.30k
        _spill_read_file_count = ADD_COUNTER_WITH_LEVEL(Base::custom_profile(),
434
6.30k
                                                        "SpillReadFileCount", TUnit::UNIT, 1);
435
436
6.30k
        _spill_file_current_size = ADD_COUNTER_WITH_LEVEL(
437
6.30k
                Base::custom_profile(), "SpillWriteFileCurrentBytes", TUnit::BYTES, 1);
438
6.30k
        _spill_file_current_count = ADD_COUNTER_WITH_LEVEL(
439
6.30k
                Base::custom_profile(), "SpillWriteFileCurrentCount", TUnit::UNIT, 1);
440
6.30k
    }
_ZN5doris24PipelineXSpillLocalStateINS_30PartitionedHashJoinSharedStateEE24init_spill_read_countersEv
Line
Count
Source
407
24
    void init_spill_read_counters() {
408
24
        _spill_total_timer = ADD_TIMER_WITH_LEVEL(Base::custom_profile(), "SpillTotalTime", 1);
409
410
        // Spill read counters
411
24
        _spill_recover_time = ADD_TIMER_WITH_LEVEL(Base::custom_profile(), "SpillRecoverTime", 1);
412
413
24
        _spill_read_wait_in_queue_task_count = ADD_COUNTER_WITH_LEVEL(
414
24
                Base::custom_profile(), "SpillReadTaskWaitInQueueCount", TUnit::UNIT, 1);
415
24
        _spill_reading_task_count = ADD_COUNTER_WITH_LEVEL(Base::custom_profile(),
416
24
                                                           "SpillReadTaskCount", TUnit::UNIT, 1);
417
24
        _spill_read_wait_in_queue_timer =
418
24
                ADD_TIMER_WITH_LEVEL(Base::custom_profile(), "SpillReadTaskWaitInQueueTime", 1);
419
420
24
        _spill_read_file_time =
421
24
                ADD_TIMER_WITH_LEVEL(Base::custom_profile(), "SpillReadFileTime", 1);
422
24
        _spill_read_deserialize_block_timer =
423
24
                ADD_TIMER_WITH_LEVEL(Base::custom_profile(), "SpillReadDeserializeBlockTime", 1);
424
425
24
        _spill_read_block_count = ADD_COUNTER_WITH_LEVEL(Base::custom_profile(),
426
24
                                                         "SpillReadBlockCount", TUnit::UNIT, 1);
427
24
        _spill_read_block_data_size = ADD_COUNTER_WITH_LEVEL(
428
24
                Base::custom_profile(), "SpillReadBlockBytes", TUnit::BYTES, 1);
429
24
        _spill_read_file_size = ADD_COUNTER_WITH_LEVEL(Base::custom_profile(), "SpillReadFileBytes",
430
24
                                                       TUnit::BYTES, 1);
431
24
        _spill_read_rows_count =
432
24
                ADD_COUNTER_WITH_LEVEL(Base::custom_profile(), "SpillReadRows", TUnit::UNIT, 1);
433
24
        _spill_read_file_count = ADD_COUNTER_WITH_LEVEL(Base::custom_profile(),
434
24
                                                        "SpillReadFileCount", TUnit::UNIT, 1);
435
436
24
        _spill_file_current_size = ADD_COUNTER_WITH_LEVEL(
437
24
                Base::custom_profile(), "SpillWriteFileCurrentBytes", TUnit::BYTES, 1);
438
24
        _spill_file_current_count = ADD_COUNTER_WITH_LEVEL(
439
24
                Base::custom_profile(), "SpillWriteFileCurrentCount", TUnit::UNIT, 1);
440
24
    }
441
442
    // These two counters are shared to spill source operators as the initial value
443
    // Initialize values of counters 'SpillWriteFileCurrentBytes' and 'SpillWriteFileCurrentCount'
444
    // from spill sink operators' "SpillWriteFileTotalCount" and "SpillWriteFileBytes"
445
4.39k
    void copy_shared_spill_profile() {
446
4.39k
        if (_copy_shared_spill_profile) {
447
334
            _copy_shared_spill_profile = false;
448
334
            const auto* spill_shared_state = (const BasicSpillSharedState*)Base::_shared_state;
449
334
            COUNTER_UPDATE(_spill_file_current_size,
450
334
                           spill_shared_state->_spill_write_file_total_size->value());
451
334
            COUNTER_UPDATE(_spill_file_current_count,
452
334
                           spill_shared_state->_spill_file_total_count->value());
453
334
            Base::_shared_state->update_spill_stream_profiles(Base::custom_profile());
454
334
        }
455
4.39k
    }
_ZN5doris24PipelineXSpillLocalStateINS_30PartitionedHashJoinSharedStateEE25copy_shared_spill_profileEv
Line
Count
Source
445
3
    void copy_shared_spill_profile() {
446
3
        if (_copy_shared_spill_profile) {
447
0
            _copy_shared_spill_profile = false;
448
0
            const auto* spill_shared_state = (const BasicSpillSharedState*)Base::_shared_state;
449
0
            COUNTER_UPDATE(_spill_file_current_size,
450
0
                           spill_shared_state->_spill_write_file_total_size->value());
451
0
            COUNTER_UPDATE(_spill_file_current_count,
452
0
                           spill_shared_state->_spill_file_total_count->value());
453
0
            Base::_shared_state->update_spill_stream_profiles(Base::custom_profile());
454
0
        }
455
3
    }
_ZN5doris24PipelineXSpillLocalStateINS_20SpillSortSharedStateEE25copy_shared_spill_profileEv
Line
Count
Source
445
180
    void copy_shared_spill_profile() {
446
180
        if (_copy_shared_spill_profile) {
447
18
            _copy_shared_spill_profile = false;
448
18
            const auto* spill_shared_state = (const BasicSpillSharedState*)Base::_shared_state;
449
18
            COUNTER_UPDATE(_spill_file_current_size,
450
18
                           spill_shared_state->_spill_write_file_total_size->value());
451
18
            COUNTER_UPDATE(_spill_file_current_count,
452
18
                           spill_shared_state->_spill_file_total_count->value());
453
18
            Base::_shared_state->update_spill_stream_profiles(Base::custom_profile());
454
18
        }
455
180
    }
_ZN5doris24PipelineXSpillLocalStateINS_25PartitionedAggSharedStateEE25copy_shared_spill_profileEv
Line
Count
Source
445
4.21k
    void copy_shared_spill_profile() {
446
4.21k
        if (_copy_shared_spill_profile) {
447
316
            _copy_shared_spill_profile = false;
448
316
            const auto* spill_shared_state = (const BasicSpillSharedState*)Base::_shared_state;
449
316
            COUNTER_UPDATE(_spill_file_current_size,
450
316
                           spill_shared_state->_spill_write_file_total_size->value());
451
316
            COUNTER_UPDATE(_spill_file_current_count,
452
316
                           spill_shared_state->_spill_file_total_count->value());
453
316
            Base::_shared_state->update_spill_stream_profiles(Base::custom_profile());
454
316
        }
455
4.21k
    }
456
457
    // Total time of spill, including spill task scheduling time,
458
    // serialize block time, write disk file time,
459
    // and read disk file time, deserialize block time etc.
460
    RuntimeProfile::Counter* _spill_total_timer = nullptr;
461
462
    // Spill write counters
463
    // Total time of spill write, including serialize block time, write disk file,
464
    // and wait in queue time, etc.
465
    RuntimeProfile::Counter* _spill_write_timer = nullptr;
466
467
    RuntimeProfile::Counter* _spill_write_wait_in_queue_task_count = nullptr;
468
    RuntimeProfile::Counter* _spill_writing_task_count = nullptr;
469
    RuntimeProfile::Counter* _spill_write_wait_in_queue_timer = nullptr;
470
471
    // Total time of writing file
472
    RuntimeProfile::Counter* _spill_write_file_timer = nullptr;
473
    RuntimeProfile::Counter* _spill_write_serialize_block_timer = nullptr;
474
    // Original count of spilled Blocks
475
    // One Big Block maybe split into multiple small Blocks when actually written to disk file.
476
    RuntimeProfile::Counter* _spill_write_block_count = nullptr;
477
    // Total bytes of spill data in Block format(in memory format)
478
    RuntimeProfile::Counter* _spill_write_block_data_size = nullptr;
479
    // Total bytes of spill data written to disk file(after serialized)
480
    RuntimeProfile::Counter* _spill_write_file_total_size = nullptr;
481
    RuntimeProfile::Counter* _spill_write_rows_count = nullptr;
482
    RuntimeProfile::Counter* _spill_file_total_count = nullptr;
483
    RuntimeProfile::Counter* _spill_file_current_count = nullptr;
484
    // Spilled file total size
485
    RuntimeProfile::Counter* _spill_file_total_size = nullptr;
486
    // Current spilled file size
487
    RuntimeProfile::Counter* _spill_file_current_size = nullptr;
488
489
    // Spill read counters
490
    // Total time of recovring spilled data, including read file time, deserialize time, etc.
491
    RuntimeProfile::Counter* _spill_recover_time = nullptr;
492
493
    RuntimeProfile::Counter* _spill_read_wait_in_queue_task_count = nullptr;
494
    RuntimeProfile::Counter* _spill_reading_task_count = nullptr;
495
    RuntimeProfile::Counter* _spill_read_wait_in_queue_timer = nullptr;
496
497
    RuntimeProfile::Counter* _spill_read_file_time = nullptr;
498
    RuntimeProfile::Counter* _spill_read_deserialize_block_timer = nullptr;
499
    RuntimeProfile::Counter* _spill_read_block_count = nullptr;
500
    // Total bytes of read data in Block format(in memory format)
501
    RuntimeProfile::Counter* _spill_read_block_data_size = nullptr;
502
    // Total bytes of spill data read from disk file
503
    RuntimeProfile::Counter* _spill_read_file_size = nullptr;
504
    RuntimeProfile::Counter* _spill_read_rows_count = nullptr;
505
    RuntimeProfile::Counter* _spill_read_file_count = nullptr;
506
507
    bool _copy_shared_spill_profile = true;
508
};
509
510
class DataSinkOperatorXBase;
511
512
class PipelineXSinkLocalStateBase {
513
public:
514
    PipelineXSinkLocalStateBase(DataSinkOperatorXBase* parent_, RuntimeState* state_);
515
1.96M
    virtual ~PipelineXSinkLocalStateBase() = default;
516
517
    // Do initialization. This step should be executed only once and in bthread, so we can do some
518
    // lightweight or non-idempotent operations (e.g. init profile, clone expr ctx from operatorX)
519
    virtual Status init(RuntimeState* state, LocalSinkStateInfo& info) = 0;
520
521
    virtual Status prepare(RuntimeState* state) = 0;
522
    // Do initialization. This step can be executed multiple times, so we should make sure it is
523
    // idempotent (e.g. wait for runtime filters).
524
    virtual Status open(RuntimeState* state) = 0;
525
    virtual Status terminate(RuntimeState* state) = 0;
526
    virtual Status close(RuntimeState* state, Status exec_status) = 0;
527
4.42M
    [[nodiscard]] virtual bool is_finished() const { return false; }
528
14.3M
    [[nodiscard]] virtual bool is_blockable() const { return false; }
529
530
    [[nodiscard]] virtual std::string debug_string(int indentation_level) const = 0;
531
532
    template <class TARGET>
533
3.28M
    TARGET& cast() {
534
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
535
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
536
18.4E
                << " and expect type is" << typeid(TARGET).name();
537
3.28M
        return reinterpret_cast<TARGET&>(*this);
538
3.28M
    }
_ZN5doris27PipelineXSinkLocalStateBase4castINS_22ExchangeSinkLocalStateEEERT_v
Line
Count
Source
533
730k
    TARGET& cast() {
534
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
535
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
536
18.4E
                << " and expect type is" << typeid(TARGET).name();
537
730k
        return reinterpret_cast<TARGET&>(*this);
538
730k
    }
_ZN5doris27PipelineXSinkLocalStateBase4castINS_19UnionSinkLocalStateEEERT_v
Line
Count
Source
533
11.9k
    TARGET& cast() {
534
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
535
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
536
18.4E
                << " and expect type is" << typeid(TARGET).name();
537
11.9k
        return reinterpret_cast<TARGET&>(*this);
538
11.9k
    }
_ZN5doris27PipelineXSinkLocalStateBase4castINS_25OlapTableSinkV2LocalStateEEERT_v
Line
Count
Source
533
22
    TARGET& cast() {
534
22
        DCHECK(dynamic_cast<TARGET*>(this))
535
0
                << " Mismatch type! Current type is " << typeid(*this).name()
536
0
                << " and expect type is" << typeid(TARGET).name();
537
22
        return reinterpret_cast<TARGET&>(*this);
538
22
    }
_ZN5doris27PipelineXSinkLocalStateBase4castINS_23OlapTableSinkLocalStateEEERT_v
Line
Count
Source
533
76.3k
    TARGET& cast() {
534
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
535
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
536
18.4E
                << " and expect type is" << typeid(TARGET).name();
537
76.3k
        return reinterpret_cast<TARGET&>(*this);
538
76.3k
    }
Unexecuted instantiation: _ZN5doris27PipelineXSinkLocalStateBase4castINS_23HiveTableSinkLocalStateEEERT_v
Unexecuted instantiation: _ZN5doris27PipelineXSinkLocalStateBase4castINS_26IcebergTableSinkLocalStateEEERT_v
Unexecuted instantiation: _ZN5doris27PipelineXSinkLocalStateBase4castINS_21MCTableSinkLocalStateEEERT_v
Unexecuted instantiation: _ZN5doris27PipelineXSinkLocalStateBase4castINS_22TVFTableSinkLocalStateEEERT_v
_ZN5doris27PipelineXSinkLocalStateBase4castINS_27LocalExchangeSinkLocalStateEEERT_v
Line
Count
Source
533
473k
    TARGET& cast() {
534
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
535
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
536
18.4E
                << " and expect type is" << typeid(TARGET).name();
537
473k
        return reinterpret_cast<TARGET&>(*this);
538
473k
    }
_ZN5doris27PipelineXSinkLocalStateBase4castINS_17AggSinkLocalStateEEERT_v
Line
Count
Source
533
462k
    TARGET& cast() {
534
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
535
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
536
18.4E
                << " and expect type is" << typeid(TARGET).name();
537
462k
        return reinterpret_cast<TARGET&>(*this);
538
462k
    }
_ZN5doris27PipelineXSinkLocalStateBase4castINS_27HashJoinBuildSinkLocalStateEEERT_v
Line
Count
Source
533
673k
    TARGET& cast() {
534
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
535
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
536
18.4E
                << " and expect type is" << typeid(TARGET).name();
537
673k
        return reinterpret_cast<TARGET&>(*this);
538
673k
    }
_ZN5doris27PipelineXSinkLocalStateBase4castINS_26RecCTEAnchorSinkLocalStateEEERT_v
Line
Count
Source
533
471
    TARGET& cast() {
534
471
        DCHECK(dynamic_cast<TARGET*>(this))
535
0
                << " Mismatch type! Current type is " << typeid(*this).name()
536
0
                << " and expect type is" << typeid(TARGET).name();
537
471
        return reinterpret_cast<TARGET&>(*this);
538
471
    }
_ZN5doris27PipelineXSinkLocalStateBase4castINS_20RecCTESinkLocalStateEEERT_v
Line
Count
Source
533
5.77k
    TARGET& cast() {
534
5.77k
        DCHECK(dynamic_cast<TARGET*>(this))
535
0
                << " Mismatch type! Current type is " << typeid(*this).name()
536
0
                << " and expect type is" << typeid(TARGET).name();
537
5.77k
        return reinterpret_cast<TARGET&>(*this);
538
5.77k
    }
_ZN5doris27PipelineXSinkLocalStateBase4castINS_20ResultSinkLocalStateEEERT_v
Line
Count
Source
533
443k
    TARGET& cast() {
534
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
535
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
536
18.4E
                << " and expect type is" << typeid(TARGET).name();
537
443k
        return reinterpret_cast<TARGET&>(*this);
538
443k
    }
Unexecuted instantiation: _ZN5doris27PipelineXSinkLocalStateBase4castINS_23JdbcTableSinkLocalStateEEERT_v
_ZN5doris27PipelineXSinkLocalStateBase4castINS_27MemoryScratchSinkLocalStateEEERT_v
Line
Count
Source
533
3
    TARGET& cast() {
534
3
        DCHECK(dynamic_cast<TARGET*>(this))
535
0
                << " Mismatch type! Current type is " << typeid(*this).name()
536
0
                << " and expect type is" << typeid(TARGET).name();
537
3
        return reinterpret_cast<TARGET&>(*this);
538
3
    }
_ZN5doris27PipelineXSinkLocalStateBase4castINS_24ResultFileSinkLocalStateEEERT_v
Line
Count
Source
533
1.22k
    TARGET& cast() {
534
1.22k
        DCHECK(dynamic_cast<TARGET*>(this))
535
0
                << " Mismatch type! Current type is " << typeid(*this).name()
536
0
                << " and expect type is" << typeid(TARGET).name();
537
1.22k
        return reinterpret_cast<TARGET&>(*this);
538
1.22k
    }
Unexecuted instantiation: _ZN5doris27PipelineXSinkLocalStateBase4castINS_31SpillIcebergTableSinkLocalStateEEERT_v
_ZN5doris27PipelineXSinkLocalStateBase4castINS_22AnalyticSinkLocalStateEEERT_v
Line
Count
Source
533
32.6k
    TARGET& cast() {
534
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
535
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
536
18.4E
                << " and expect type is" << typeid(TARGET).name();
537
32.6k
        return reinterpret_cast<TARGET&>(*this);
538
32.6k
    }
_ZN5doris27PipelineXSinkLocalStateBase4castINS_23BlackholeSinkLocalStateEEERT_v
Line
Count
Source
533
27
    TARGET& cast() {
534
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
535
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
536
18.4E
                << " and expect type is" << typeid(TARGET).name();
537
27
        return reinterpret_cast<TARGET&>(*this);
538
27
    }
_ZN5doris27PipelineXSinkLocalStateBase4castINS_18SortSinkLocalStateEEERT_v
Line
Count
Source
533
298k
    TARGET& cast() {
534
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
535
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
536
18.4E
                << " and expect type is" << typeid(TARGET).name();
537
298k
        return reinterpret_cast<TARGET&>(*this);
538
298k
    }
_ZN5doris27PipelineXSinkLocalStateBase4castINS_23SpillSortSinkLocalStateEEERT_v
Line
Count
Source
533
1.82k
    TARGET& cast() {
534
1.82k
        DCHECK(dynamic_cast<TARGET*>(this))
535
0
                << " Mismatch type! Current type is " << typeid(*this).name()
536
0
                << " and expect type is" << typeid(TARGET).name();
537
1.82k
        return reinterpret_cast<TARGET&>(*this);
538
1.82k
    }
_ZN5doris27PipelineXSinkLocalStateBase4castINS_28PartitionedAggSinkLocalStateEEERT_v
Line
Count
Source
533
19.4k
    TARGET& cast() {
534
19.4k
        DCHECK(dynamic_cast<TARGET*>(this))
535
0
                << " Mismatch type! Current type is " << typeid(*this).name()
536
0
                << " and expect type is" << typeid(TARGET).name();
537
19.4k
        return reinterpret_cast<TARGET&>(*this);
538
19.4k
    }
_ZN5doris27PipelineXSinkLocalStateBase4castINS_33NestedLoopJoinBuildSinkLocalStateEEERT_v
Line
Count
Source
533
13.7k
    TARGET& cast() {
534
13.7k
        DCHECK(dynamic_cast<TARGET*>(this))
535
2
                << " Mismatch type! Current type is " << typeid(*this).name()
536
2
                << " and expect type is" << typeid(TARGET).name();
537
13.7k
        return reinterpret_cast<TARGET&>(*this);
538
13.7k
    }
_ZN5doris27PipelineXSinkLocalStateBase4castINS_33MultiCastDataStreamSinkLocalStateEEERT_v
Line
Count
Source
533
7.78k
    TARGET& cast() {
534
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
535
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
536
18.4E
                << " and expect type is" << typeid(TARGET).name();
537
7.78k
        return reinterpret_cast<TARGET&>(*this);
538
7.78k
    }
_ZN5doris27PipelineXSinkLocalStateBase4castINS_27PartitionSortSinkLocalStateEEERT_v
Line
Count
Source
533
1.26k
    TARGET& cast() {
534
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
535
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
536
18.4E
                << " and expect type is" << typeid(TARGET).name();
537
1.26k
        return reinterpret_cast<TARGET&>(*this);
538
1.26k
    }
_ZN5doris27PipelineXSinkLocalStateBase4castINS_22SetProbeSinkLocalStateILb1EEEEERT_v
Line
Count
Source
533
10.8k
    TARGET& cast() {
534
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
535
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
536
18.4E
                << " and expect type is" << typeid(TARGET).name();
537
10.8k
        return reinterpret_cast<TARGET&>(*this);
538
10.8k
    }
_ZN5doris27PipelineXSinkLocalStateBase4castINS_22SetProbeSinkLocalStateILb0EEEEERT_v
Line
Count
Source
533
5.95k
    TARGET& cast() {
534
5.95k
        DCHECK(dynamic_cast<TARGET*>(this))
535
0
                << " Mismatch type! Current type is " << typeid(*this).name()
536
0
                << " and expect type is" << typeid(TARGET).name();
537
5.95k
        return reinterpret_cast<TARGET&>(*this);
538
5.95k
    }
_ZN5doris27PipelineXSinkLocalStateBase4castINS_17SetSinkLocalStateILb1EEEEERT_v
Line
Count
Source
533
5.94k
    TARGET& cast() {
534
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
535
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
536
18.4E
                << " and expect type is" << typeid(TARGET).name();
537
5.94k
        return reinterpret_cast<TARGET&>(*this);
538
5.94k
    }
_ZN5doris27PipelineXSinkLocalStateBase4castINS_17SetSinkLocalStateILb0EEEEERT_v
Line
Count
Source
533
5.86k
    TARGET& cast() {
534
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
535
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
536
18.4E
                << " and expect type is" << typeid(TARGET).name();
537
5.86k
        return reinterpret_cast<TARGET&>(*this);
538
5.86k
    }
_ZN5doris27PipelineXSinkLocalStateBase4castINS_33PartitionedHashJoinSinkLocalStateEEERT_v
Line
Count
Source
533
9
    TARGET& cast() {
534
9
        DCHECK(dynamic_cast<TARGET*>(this))
535
0
                << " Mismatch type! Current type is " << typeid(*this).name()
536
0
                << " and expect type is" << typeid(TARGET).name();
537
9
        return reinterpret_cast<TARGET&>(*this);
538
9
    }
_ZN5doris27PipelineXSinkLocalStateBase4castINS_30GroupCommitBlockSinkLocalStateEEERT_v
Line
Count
Source
533
605
    TARGET& cast() {
534
605
        DCHECK(dynamic_cast<TARGET*>(this))
535
0
                << " Mismatch type! Current type is " << typeid(*this).name()
536
0
                << " and expect type is" << typeid(TARGET).name();
537
605
        return reinterpret_cast<TARGET&>(*this);
538
605
    }
_ZN5doris27PipelineXSinkLocalStateBase4castINS_19CacheSinkLocalStateEEERT_v
Line
Count
Source
533
365
    TARGET& cast() {
534
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
535
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
536
18.4E
                << " and expect type is" << typeid(TARGET).name();
537
365
        return reinterpret_cast<TARGET&>(*this);
538
365
    }
_ZN5doris27PipelineXSinkLocalStateBase4castINS_18DictSinkLocalStateEEERT_v
Line
Count
Source
533
280
    TARGET& cast() {
534
280
        DCHECK(dynamic_cast<TARGET*>(this))
535
0
                << " Mismatch type! Current type is " << typeid(*this).name()
536
0
                << " and expect type is" << typeid(TARGET).name();
537
280
        return reinterpret_cast<TARGET&>(*this);
538
280
    }
539
    template <class TARGET>
540
    const TARGET& cast() const {
541
        DCHECK(dynamic_cast<const TARGET*>(this))
542
                << " Mismatch type! Current type is " << typeid(*this).name()
543
                << " and expect type is" << typeid(TARGET).name();
544
        return reinterpret_cast<const TARGET&>(*this);
545
    }
546
547
244k
    DataSinkOperatorXBase* parent() { return _parent; }
548
9.20M
    RuntimeState* state() { return _state; }
549
1.95M
    RuntimeProfile* operator_profile() { return _operator_profile; }
550
4.50M
    RuntimeProfile* common_profile() { return _common_profile; }
551
16.6M
    RuntimeProfile* custom_profile() { return _custom_profile; }
552
553
12.5k
    [[nodiscard]] RuntimeProfile* faker_runtime_profile() const {
554
12.5k
        return _faker_runtime_profile.get();
555
12.5k
    }
556
557
2.59M
    RuntimeProfile::Counter* rows_input_counter() { return _rows_input_counter; }
558
7.83M
    RuntimeProfile::Counter* exec_time_counter() { return _exec_timer; }
559
4.47M
    RuntimeProfile::Counter* memory_used_counter() { return _memory_used_counter; }
560
561
0
    virtual std::vector<Dependency*> dependencies() const { return {nullptr}; }
562
563
    // override in exchange sink , AsyncWriterSink
564
1.09M
    virtual Dependency* finishdependency() { return nullptr; }
565
566
739k
    bool low_memory_mode() { return _state->low_memory_mode(); }
567
568
protected:
569
    DataSinkOperatorXBase* _parent = nullptr;
570
    RuntimeState* _state = nullptr;
571
    RuntimeProfile* _operator_profile = nullptr;
572
    RuntimeProfile* _common_profile = nullptr;
573
    RuntimeProfile* _custom_profile = nullptr;
574
    // Set to true after close() has been called. subclasses should check and set this in
575
    // close().
576
    bool _closed = false;
577
    bool _terminated = false;
578
    //NOTICE: now add a faker profile, because sometimes the profile record is useless
579
    //so we want remove some counters and timers, eg: in join node, if it's broadcast_join
580
    //and shared hash table, some counter/timer about build hash table is useless,
581
    //so we could add those counter/timer in faker profile, and those will not display in web profile.
582
    std::unique_ptr<RuntimeProfile> _faker_runtime_profile =
583
            std::make_unique<RuntimeProfile>("faker profile");
584
585
    RuntimeProfile::Counter* _rows_input_counter = nullptr;
586
    RuntimeProfile::Counter* _init_timer = nullptr;
587
    RuntimeProfile::Counter* _open_timer = nullptr;
588
    RuntimeProfile::Counter* _close_timer = nullptr;
589
    RuntimeProfile::Counter* _wait_for_dependency_timer = nullptr;
590
    RuntimeProfile::Counter* _wait_for_finish_dependency_timer = nullptr;
591
    RuntimeProfile::Counter* _exec_timer = nullptr;
592
    RuntimeProfile::HighWaterMarkCounter* _memory_used_counter = nullptr;
593
};
594
595
template <typename SharedStateArg = FakeSharedState>
596
class PipelineXSinkLocalState : public PipelineXSinkLocalStateBase {
597
public:
598
    using SharedStateType = SharedStateArg;
599
    PipelineXSinkLocalState(DataSinkOperatorXBase* parent, RuntimeState* state)
600
1.95M
            : PipelineXSinkLocalStateBase(parent, state) {}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Line
Count
Source
600
185k
            : PipelineXSinkLocalStateBase(parent, state) {}
_ZN5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Line
Count
Source
600
5
            : PipelineXSinkLocalStateBase(parent, state) {}
_ZN5doris23PipelineXSinkLocalStateINS_15SortSharedStateEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Line
Count
Source
600
193k
            : PipelineXSinkLocalStateBase(parent, state) {}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Line
Count
Source
600
22
            : PipelineXSinkLocalStateBase(parent, state) {}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Line
Count
Source
600
5.25k
            : PipelineXSinkLocalStateBase(parent, state) {}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Line
Count
Source
600
10.1k
            : PipelineXSinkLocalStateBase(parent, state) {}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Line
Count
Source
600
119k
            : PipelineXSinkLocalStateBase(parent, state) {}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Line
Count
Source
600
329
            : PipelineXSinkLocalStateBase(parent, state) {}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Line
Count
Source
600
604k
            : PipelineXSinkLocalStateBase(parent, state) {}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Line
Count
Source
600
7.25k
            : PipelineXSinkLocalStateBase(parent, state) {}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Line
Count
Source
600
422
            : PipelineXSinkLocalStateBase(parent, state) {}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Line
Count
Source
600
2.40k
            : PipelineXSinkLocalStateBase(parent, state) {}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Line
Count
Source
600
11.9k
            : PipelineXSinkLocalStateBase(parent, state) {}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Line
Count
Source
600
365k
            : PipelineXSinkLocalStateBase(parent, state) {}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Line
Count
Source
600
448k
            : PipelineXSinkLocalStateBase(parent, state) {}
_ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Line
Count
Source
600
368
            : PipelineXSinkLocalStateBase(parent, state) {}
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Line
Count
Source
600
300
            : PipelineXSinkLocalStateBase(parent, state) {}
601
    ~PipelineXSinkLocalState() override = default;
602
603
    Status init(RuntimeState* state, LocalSinkStateInfo& info) override;
604
605
10.6M
    Status prepare(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE7prepareEPNS_12RuntimeStateE
Line
Count
Source
605
3.25M
    Status prepare(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE7prepareEPNS_12RuntimeStateE
Line
Count
Source
605
39.0k
    Status prepare(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE7prepareEPNS_12RuntimeStateE
Line
Count
Source
605
2.78M
    Status prepare(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE7prepareEPNS_12RuntimeStateE
Line
Count
Source
605
1.94M
    Status prepare(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE7prepareEPNS_12RuntimeStateE
Line
Count
Source
605
49.3k
    Status prepare(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE7prepareEPNS_12RuntimeStateE
Line
Count
Source
605
1.42k
    Status prepare(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE7prepareEPNS_12RuntimeStateE
Line
Count
Source
605
15.1k
    Status prepare(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE7prepareEPNS_12RuntimeStateE
Line
Count
Source
605
1.81k
    Status prepare(RuntimeState* state) override { return Status::OK(); }
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE7prepareEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE7prepareEPNS_12RuntimeStateE
Line
Count
Source
605
4.93k
    Status prepare(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE7prepareEPNS_12RuntimeStateE
Line
Count
Source
605
1.09M
    Status prepare(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE7prepareEPNS_12RuntimeStateE
Line
Count
Source
605
578k
    Status prepare(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE7prepareEPNS_12RuntimeStateE
Line
Count
Source
605
715
    Status prepare(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE7prepareEPNS_12RuntimeStateE
Line
Count
Source
605
29.4k
    Status prepare(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE7prepareEPNS_12RuntimeStateE
Line
Count
Source
605
741k
    Status prepare(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE7prepareEPNS_12RuntimeStateE
Line
Count
Source
605
4.59k
    Status prepare(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE7prepareEPNS_12RuntimeStateE
Line
Count
Source
605
65.3k
    Status prepare(RuntimeState* state) override { return Status::OK(); }
606
1.96M
    Status open(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
606
608k
    Status open(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
606
7.27k
    Status open(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
606
367k
    Status open(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
606
10.1k
    Status open(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
606
369
    Status open(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
606
453k
    Status open(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
606
2.39k
    Status open(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
606
422
    Status open(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
606
2
    Status open(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
606
300
    Status open(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
606
193k
    Status open(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
606
185k
    Status open(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
606
21
    Status open(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
606
5.27k
    Status open(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
606
119k
    Status open(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
606
327
    Status open(RuntimeState* state) override { return Status::OK(); }
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
606
12.0k
    Status open(RuntimeState* state) override { return Status::OK(); }
607
608
    Status terminate(RuntimeState* state) override;
609
    Status close(RuntimeState* state, Status exec_status) override;
610
611
    [[nodiscard]] std::string debug_string(int indentation_level) const override;
612
613
    virtual std::string name_suffix();
614
615
1.21M
    std::vector<Dependency*> dependencies() const override {
616
18.4E
        return _dependency ? std::vector<Dependency*> {_dependency} : std::vector<Dependency*> {};
617
1.21M
    }
_ZNK5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE12dependenciesEv
Line
Count
Source
615
18
    std::vector<Dependency*> dependencies() const override {
616
18
        return _dependency ? std::vector<Dependency*> {_dependency} : std::vector<Dependency*> {};
617
18
    }
_ZNK5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE12dependenciesEv
Line
Count
Source
615
7.25k
    std::vector<Dependency*> dependencies() const override {
616
18.4E
        return _dependency ? std::vector<Dependency*> {_dependency} : std::vector<Dependency*> {};
617
7.25k
    }
_ZNK5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE12dependenciesEv
Line
Count
Source
615
366k
    std::vector<Dependency*> dependencies() const override {
616
18.4E
        return _dependency ? std::vector<Dependency*> {_dependency} : std::vector<Dependency*> {};
617
366k
    }
_ZNK5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE12dependenciesEv
Line
Count
Source
615
10.1k
    std::vector<Dependency*> dependencies() const override {
616
18.4E
        return _dependency ? std::vector<Dependency*> {_dependency} : std::vector<Dependency*> {};
617
10.1k
    }
_ZNK5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE12dependenciesEv
Line
Count
Source
615
364
    std::vector<Dependency*> dependencies() const override {
616
18.4E
        return _dependency ? std::vector<Dependency*> {_dependency} : std::vector<Dependency*> {};
617
364
    }
_ZNK5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE12dependenciesEv
Line
Count
Source
615
384k
    std::vector<Dependency*> dependencies() const override {
616
18.4E
        return _dependency ? std::vector<Dependency*> {_dependency} : std::vector<Dependency*> {};
617
384k
    }
_ZNK5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE12dependenciesEv
Line
Count
Source
615
2.41k
    std::vector<Dependency*> dependencies() const override {
616
2.41k
        return _dependency ? std::vector<Dependency*> {_dependency} : std::vector<Dependency*> {};
617
2.41k
    }
_ZNK5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE12dependenciesEv
Line
Count
Source
615
320
    std::vector<Dependency*> dependencies() const override {
616
320
        return _dependency ? std::vector<Dependency*> {_dependency} : std::vector<Dependency*> {};
617
320
    }
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE12dependenciesEv
_ZNK5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE12dependenciesEv
Line
Count
Source
615
300
    std::vector<Dependency*> dependencies() const override {
616
300
        return _dependency ? std::vector<Dependency*> {_dependency} : std::vector<Dependency*> {};
617
300
    }
_ZNK5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE12dependenciesEv
Line
Count
Source
615
192k
    std::vector<Dependency*> dependencies() const override {
616
192k
        return _dependency ? std::vector<Dependency*> {_dependency} : std::vector<Dependency*> {};
617
192k
    }
_ZNK5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE12dependenciesEv
Line
Count
Source
615
112k
    std::vector<Dependency*> dependencies() const override {
616
18.4E
        return _dependency ? std::vector<Dependency*> {_dependency} : std::vector<Dependency*> {};
617
112k
    }
_ZNK5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE12dependenciesEv
Line
Count
Source
615
14
    std::vector<Dependency*> dependencies() const override {
616
14
        return _dependency ? std::vector<Dependency*> {_dependency} : std::vector<Dependency*> {};
617
14
    }
_ZNK5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE12dependenciesEv
Line
Count
Source
615
5.26k
    std::vector<Dependency*> dependencies() const override {
616
18.4E
        return _dependency ? std::vector<Dependency*> {_dependency} : std::vector<Dependency*> {};
617
5.26k
    }
_ZNK5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE12dependenciesEv
Line
Count
Source
615
119k
    std::vector<Dependency*> dependencies() const override {
616
18.4E
        return _dependency ? std::vector<Dependency*> {_dependency} : std::vector<Dependency*> {};
617
119k
    }
_ZNK5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE12dependenciesEv
Line
Count
Source
615
316
    std::vector<Dependency*> dependencies() const override {
616
316
        return _dependency ? std::vector<Dependency*> {_dependency} : std::vector<Dependency*> {};
617
316
    }
_ZNK5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE12dependenciesEv
Line
Count
Source
615
11.9k
    std::vector<Dependency*> dependencies() const override {
616
18.4E
        return _dependency ? std::vector<Dependency*> {_dependency} : std::vector<Dependency*> {};
617
11.9k
    }
618
619
1.91M
    virtual bool must_set_shared_state() const {
620
1.91M
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
621
1.91M
    }
_ZNK5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE21must_set_shared_stateEv
Line
Count
Source
619
590k
    virtual bool must_set_shared_state() const {
620
590k
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
621
590k
    }
_ZNK5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE21must_set_shared_stateEv
Line
Count
Source
619
7.15k
    virtual bool must_set_shared_state() const {
620
7.15k
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
621
7.15k
    }
_ZNK5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE21must_set_shared_stateEv
Line
Count
Source
619
438k
    virtual bool must_set_shared_state() const {
620
438k
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
621
438k
    }
_ZNK5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE21must_set_shared_stateEv
Line
Count
Source
619
359k
    virtual bool must_set_shared_state() const {
620
359k
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
621
359k
    }
_ZNK5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE21must_set_shared_stateEv
Line
Count
Source
619
10.0k
    virtual bool must_set_shared_state() const {
620
10.0k
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
621
10.0k
    }
_ZNK5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE21must_set_shared_stateEv
Line
Count
Source
619
369
    virtual bool must_set_shared_state() const {
620
369
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
621
369
    }
_ZNK5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE21must_set_shared_stateEv
Line
Count
Source
619
2.36k
    virtual bool must_set_shared_state() const {
620
2.36k
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
621
2.36k
    }
_ZNK5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE21must_set_shared_stateEv
Line
Count
Source
619
422
    virtual bool must_set_shared_state() const {
620
422
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
621
422
    }
_ZNK5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE21must_set_shared_stateEv
Line
Count
Source
619
2
    virtual bool must_set_shared_state() const {
620
2
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
621
2
    }
_ZNK5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE21must_set_shared_stateEv
Line
Count
Source
619
300
    virtual bool must_set_shared_state() const {
620
300
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
621
300
    }
_ZNK5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE21must_set_shared_stateEv
Line
Count
Source
619
190k
    virtual bool must_set_shared_state() const {
620
190k
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
621
190k
    }
_ZNK5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE21must_set_shared_stateEv
Line
Count
Source
619
183k
    virtual bool must_set_shared_state() const {
620
183k
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
621
183k
    }
_ZNK5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE21must_set_shared_stateEv
Line
Count
Source
619
21
    virtual bool must_set_shared_state() const {
620
21
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
621
21
    }
_ZNK5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE21must_set_shared_stateEv
Line
Count
Source
619
5.19k
    virtual bool must_set_shared_state() const {
620
5.19k
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
621
5.19k
    }
_ZNK5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE21must_set_shared_stateEv
Line
Count
Source
619
117k
    virtual bool must_set_shared_state() const {
620
117k
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
621
117k
    }
_ZNK5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE21must_set_shared_stateEv
Line
Count
Source
619
327
    virtual bool must_set_shared_state() const {
620
327
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
621
327
    }
_ZNK5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE21must_set_shared_stateEv
Line
Count
Source
619
11.8k
    virtual bool must_set_shared_state() const {
620
11.8k
        return !std::is_same_v<SharedStateArg, FakeSharedState>;
621
11.8k
    }
622
623
protected:
624
    Dependency* _dependency = nullptr;
625
    SharedStateType* _shared_state = nullptr;
626
};
627
628
class DataSinkOperatorXBase : public OperatorBase {
629
public:
630
    DataSinkOperatorXBase(const int operator_id, const int node_id, const int dest_id)
631
447k
            : _operator_id(operator_id), _node_id(node_id), _dests_id({dest_id}) {}
632
    DataSinkOperatorXBase(const int operator_id, const TPlanNode& tnode, const int dest_id)
633
166k
            : OperatorBase(tnode.__isset.is_serial_operator && tnode.is_serial_operator),
634
166k
              _operator_id(operator_id),
635
166k
              _node_id(tnode.node_id),
636
166k
              _dests_id({dest_id}) {}
637
638
    DataSinkOperatorXBase(const int operator_id, const int node_id, std::vector<int>& dests)
639
783
            : _operator_id(operator_id), _node_id(node_id), _dests_id(dests) {}
640
641
#ifdef BE_TEST
642
    DataSinkOperatorXBase() : _operator_id(-1), _node_id(0), _dests_id({-1}) {};
643
#endif
644
645
690k
    ~DataSinkOperatorXBase() override = default;
646
647
    // For agg/sort/join sink.
648
    virtual Status init(const TPlanNode& tnode, RuntimeState* state);
649
650
1.88M
    virtual bool reset_to_rerun(RuntimeState* state, OperatorXBase* root) const { return false; }
651
652
    Status init(const TDataSink& tsink) override;
653
    [[nodiscard]] virtual Status init(RuntimeState* state, ExchangeType type, const int num_buckets,
654
                                      const bool use_global_hash_shuffle,
655
0
                                      const std::map<int, int>& shuffle_idx_to_instance_idx) {
656
0
        return Status::InternalError("init() is only implemented in local exchange!");
657
0
    }
658
659
615k
    Status prepare(RuntimeState* state) override { return Status::OK(); }
660
    Status terminate(RuntimeState* state) override;
661
6.88M
    [[nodiscard]] bool is_finished(RuntimeState* state) const {
662
6.88M
        auto result = state->get_sink_local_state_result();
663
6.88M
        if (!result) {
664
0
            return result.error();
665
0
        }
666
6.88M
        return result.value()->is_finished();
667
6.88M
    }
668
669
    [[nodiscard]] virtual Status sink(RuntimeState* state, Block* block, bool eos) = 0;
670
671
    [[nodiscard]] virtual Status setup_local_state(RuntimeState* state,
672
                                                   LocalSinkStateInfo& info) = 0;
673
674
2.05M
    [[nodiscard]] virtual size_t get_reserve_mem_size(RuntimeState* state, bool eos) {
675
2.05M
        return state->minimum_operator_memory_required_bytes();
676
2.05M
    }
677
6.49M
    bool is_blockable(RuntimeState* state) const override {
678
6.49M
        return state->get_sink_local_state()->is_blockable();
679
6.49M
    }
680
681
21.8k
    [[nodiscard]] bool is_spillable() const { return _spillable; }
682
683
    template <class TARGET>
684
7.43M
    TARGET& cast() {
685
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
686
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
687
18.4E
                << " and expect type is" << typeid(TARGET).name();
688
7.43M
        return reinterpret_cast<TARGET&>(*this);
689
7.43M
    }
_ZN5doris21DataSinkOperatorXBase4castINS_23ResultFileSinkOperatorXEEERT_v
Line
Count
Source
684
2.24k
    TARGET& cast() {
685
2.24k
        DCHECK(dynamic_cast<TARGET*>(this))
686
0
                << " Mismatch type! Current type is " << typeid(*this).name()
687
0
                << " and expect type is" << typeid(TARGET).name();
688
2.24k
        return reinterpret_cast<TARGET&>(*this);
689
2.24k
    }
Unexecuted instantiation: _ZN5doris21DataSinkOperatorXBase4castINS_22JdbcTableSinkOperatorXEEERT_v
_ZN5doris21DataSinkOperatorXBase4castINS_22OlapTableSinkOperatorXEEERT_v
Line
Count
Source
684
450k
    TARGET& cast() {
685
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
686
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
687
18.4E
                << " and expect type is" << typeid(TARGET).name();
688
450k
        return reinterpret_cast<TARGET&>(*this);
689
450k
    }
_ZN5doris21DataSinkOperatorXBase4castINS_24OlapTableSinkV2OperatorXEEERT_v
Line
Count
Source
684
396
    TARGET& cast() {
685
396
        DCHECK(dynamic_cast<TARGET*>(this))
686
0
                << " Mismatch type! Current type is " << typeid(*this).name()
687
0
                << " and expect type is" << typeid(TARGET).name();
688
396
        return reinterpret_cast<TARGET&>(*this);
689
396
    }
Unexecuted instantiation: _ZN5doris21DataSinkOperatorXBase4castINS_22HiveTableSinkOperatorXEEERT_v
Unexecuted instantiation: _ZN5doris21DataSinkOperatorXBase4castINS_25IcebergTableSinkOperatorXEEERT_v
Unexecuted instantiation: _ZN5doris21DataSinkOperatorXBase4castINS_30SpillIcebergTableSinkOperatorXEEERT_v
Unexecuted instantiation: _ZN5doris21DataSinkOperatorXBase4castINS_20MCTableSinkOperatorXEEERT_v
Unexecuted instantiation: _ZN5doris21DataSinkOperatorXBase4castINS_21TVFTableSinkOperatorXEEERT_v
_ZN5doris21DataSinkOperatorXBase4castINS_26HashJoinBuildSinkOperatorXEEERT_v
Line
Count
Source
684
2.09M
    TARGET& cast() {
685
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
686
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
687
18.4E
                << " and expect type is" << typeid(TARGET).name();
688
2.09M
        return reinterpret_cast<TARGET&>(*this);
689
2.09M
    }
_ZN5doris21DataSinkOperatorXBase4castINS_32NestedLoopJoinBuildSinkOperatorXEEERT_v
Line
Count
Source
684
10.3k
    TARGET& cast() {
685
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
686
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
687
18.4E
                << " and expect type is" << typeid(TARGET).name();
688
10.3k
        return reinterpret_cast<TARGET&>(*this);
689
10.3k
    }
_ZN5doris21DataSinkOperatorXBase4castINS_32PartitionedHashJoinSinkOperatorXEEERT_v
Line
Count
Source
684
14
    TARGET& cast() {
685
14
        DCHECK(dynamic_cast<TARGET*>(this))
686
0
                << " Mismatch type! Current type is " << typeid(*this).name()
687
0
                << " and expect type is" << typeid(TARGET).name();
688
14
        return reinterpret_cast<TARGET&>(*this);
689
14
    }
_ZN5doris21DataSinkOperatorXBase4castINS_19ResultSinkOperatorXEEERT_v
Line
Count
Source
684
1.13M
    TARGET& cast() {
685
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
686
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
687
18.4E
                << " and expect type is" << typeid(TARGET).name();
688
1.13M
        return reinterpret_cast<TARGET&>(*this);
689
1.13M
    }
_ZN5doris21DataSinkOperatorXBase4castINS_26MemoryScratchSinkOperatorXEEERT_v
Line
Count
Source
684
3
    TARGET& cast() {
685
3
        DCHECK(dynamic_cast<TARGET*>(this))
686
0
                << " Mismatch type! Current type is " << typeid(*this).name()
687
0
                << " and expect type is" << typeid(TARGET).name();
688
3
        return reinterpret_cast<TARGET&>(*this);
689
3
    }
_ZN5doris21DataSinkOperatorXBase4castINS_21AnalyticSinkOperatorXEEERT_v
Line
Count
Source
684
28.7k
    TARGET& cast() {
685
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
686
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
687
18.4E
                << " and expect type is" << typeid(TARGET).name();
688
28.7k
        return reinterpret_cast<TARGET&>(*this);
689
28.7k
    }
_ZN5doris21DataSinkOperatorXBase4castINS_17SortSinkOperatorXEEERT_v
Line
Count
Source
684
193k
    TARGET& cast() {
685
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
686
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
687
18.4E
                << " and expect type is" << typeid(TARGET).name();
688
193k
        return reinterpret_cast<TARGET&>(*this);
689
193k
    }
_ZN5doris21DataSinkOperatorXBase4castINS_22SpillSortSinkOperatorXEEERT_v
Line
Count
Source
684
539
    TARGET& cast() {
685
539
        DCHECK(dynamic_cast<TARGET*>(this))
686
0
                << " Mismatch type! Current type is " << typeid(*this).name()
687
0
                << " and expect type is" << typeid(TARGET).name();
688
539
        return reinterpret_cast<TARGET&>(*this);
689
539
    }
_ZN5doris21DataSinkOperatorXBase4castINS_26LocalExchangeSinkOperatorXEEERT_v
Line
Count
Source
684
1.04M
    TARGET& cast() {
685
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
686
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
687
18.4E
                << " and expect type is" << typeid(TARGET).name();
688
1.04M
        return reinterpret_cast<TARGET&>(*this);
689
1.04M
    }
_ZN5doris21DataSinkOperatorXBase4castINS_16AggSinkOperatorXEEERT_v
Line
Count
Source
684
516k
    TARGET& cast() {
685
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
686
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
687
18.4E
                << " and expect type is" << typeid(TARGET).name();
688
516k
        return reinterpret_cast<TARGET&>(*this);
689
516k
    }
_ZN5doris21DataSinkOperatorXBase4castINS_27PartitionedAggSinkOperatorXEEERT_v
Line
Count
Source
684
1.53k
    TARGET& cast() {
685
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
686
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
687
18.4E
                << " and expect type is" << typeid(TARGET).name();
688
1.53k
        return reinterpret_cast<TARGET&>(*this);
689
1.53k
    }
_ZN5doris21DataSinkOperatorXBase4castINS_21ExchangeSinkOperatorXEEERT_v
Line
Count
Source
684
1.91M
    TARGET& cast() {
685
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
686
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
687
18.4E
                << " and expect type is" << typeid(TARGET).name();
688
1.91M
        return reinterpret_cast<TARGET&>(*this);
689
1.91M
    }
_ZN5doris21DataSinkOperatorXBase4castINS_18UnionSinkOperatorXEEERT_v
Line
Count
Source
684
14.3k
    TARGET& cast() {
685
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
686
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
687
18.4E
                << " and expect type is" << typeid(TARGET).name();
688
14.3k
        return reinterpret_cast<TARGET&>(*this);
689
14.3k
    }
_ZN5doris21DataSinkOperatorXBase4castINS_26PartitionSortSinkOperatorXEEERT_v
Line
Count
Source
684
421
    TARGET& cast() {
685
421
        DCHECK(dynamic_cast<TARGET*>(this))
686
1
                << " Mismatch type! Current type is " << typeid(*this).name()
687
1
                << " and expect type is" << typeid(TARGET).name();
688
421
        return reinterpret_cast<TARGET&>(*this);
689
421
    }
_ZN5doris21DataSinkOperatorXBase4castINS_21SetProbeSinkOperatorXILb1EEEEERT_v
Line
Count
Source
684
4.54k
    TARGET& cast() {
685
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
686
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
687
18.4E
                << " and expect type is" << typeid(TARGET).name();
688
4.54k
        return reinterpret_cast<TARGET&>(*this);
689
4.54k
    }
_ZN5doris21DataSinkOperatorXBase4castINS_21SetProbeSinkOperatorXILb0EEEEERT_v
Line
Count
Source
684
2.48k
    TARGET& cast() {
685
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
686
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
687
18.4E
                << " and expect type is" << typeid(TARGET).name();
688
2.48k
        return reinterpret_cast<TARGET&>(*this);
689
2.48k
    }
_ZN5doris21DataSinkOperatorXBase4castINS_16SetSinkOperatorXILb1EEEEERT_v
Line
Count
Source
684
4.79k
    TARGET& cast() {
685
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
686
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
687
18.4E
                << " and expect type is" << typeid(TARGET).name();
688
4.79k
        return reinterpret_cast<TARGET&>(*this);
689
4.79k
    }
_ZN5doris21DataSinkOperatorXBase4castINS_16SetSinkOperatorXILb0EEEEERT_v
Line
Count
Source
684
4.84k
    TARGET& cast() {
685
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
686
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
687
18.4E
                << " and expect type is" << typeid(TARGET).name();
688
4.84k
        return reinterpret_cast<TARGET&>(*this);
689
4.84k
    }
_ZN5doris21DataSinkOperatorXBase4castINS_29GroupCommitBlockSinkOperatorXEEERT_v
Line
Count
Source
684
1.16k
    TARGET& cast() {
685
1.16k
        DCHECK(dynamic_cast<TARGET*>(this))
686
0
                << " Mismatch type! Current type is " << typeid(*this).name()
687
0
                << " and expect type is" << typeid(TARGET).name();
688
1.16k
        return reinterpret_cast<TARGET&>(*this);
689
1.16k
    }
_ZN5doris21DataSinkOperatorXBase4castINS_17DictSinkOperatorXEEERT_v
Line
Count
Source
684
212
    TARGET& cast() {
685
212
        DCHECK(dynamic_cast<TARGET*>(this))
686
0
                << " Mismatch type! Current type is " << typeid(*this).name()
687
0
                << " and expect type is" << typeid(TARGET).name();
688
212
        return reinterpret_cast<TARGET&>(*this);
689
212
    }
_ZN5doris21DataSinkOperatorXBase4castINS_19RecCTESinkOperatorXEEERT_v
Line
Count
Source
684
150
    TARGET& cast() {
685
150
        DCHECK(dynamic_cast<TARGET*>(this))
686
0
                << " Mismatch type! Current type is " << typeid(*this).name()
687
0
                << " and expect type is" << typeid(TARGET).name();
688
150
        return reinterpret_cast<TARGET&>(*this);
689
150
    }
_ZN5doris21DataSinkOperatorXBase4castINS_25RecCTEAnchorSinkOperatorXEEERT_v
Line
Count
Source
684
150
    TARGET& cast() {
685
150
        DCHECK(dynamic_cast<TARGET*>(this))
686
0
                << " Mismatch type! Current type is " << typeid(*this).name()
687
0
                << " and expect type is" << typeid(TARGET).name();
688
150
        return reinterpret_cast<TARGET&>(*this);
689
150
    }
690
    template <class TARGET>
691
    const TARGET& cast() const {
692
        DCHECK(dynamic_cast<const TARGET*>(this))
693
                << " Mismatch type! Current type is " << typeid(*this).name()
694
                << " and expect type is" << typeid(TARGET).name();
695
        return reinterpret_cast<const TARGET&>(*this);
696
    }
697
698
    [[nodiscard]] virtual std::shared_ptr<BasicSharedState> create_shared_state() const = 0;
699
700
0
    Status close(RuntimeState* state) override {
701
0
        return Status::InternalError("Should not reach here!");
702
0
    }
703
704
    [[nodiscard]] virtual std::string debug_string(int indentation_level) const;
705
706
    [[nodiscard]] virtual std::string debug_string(RuntimeState* state,
707
                                                   int indentation_level) const;
708
709
687k
    [[nodiscard]] bool is_sink() const override { return true; }
710
711
1.96M
    static Status close(RuntimeState* state, Status exec_status) {
712
1.96M
        auto result = state->get_sink_local_state_result();
713
1.96M
        if (!result) {
714
0
            return result.error();
715
0
        }
716
1.96M
        return result.value()->close(state, exec_status);
717
1.96M
    }
718
719
4.78M
    [[nodiscard]] int operator_id() const { return _operator_id; }
720
721
8.44M
    [[nodiscard]] const std::vector<int>& dests_id() const { return _dests_id; }
722
723
1.86M
    [[nodiscard]] int nereids_id() const { return _nereids_id; }
724
725
6.36M
    [[nodiscard]] int node_id() const override { return _node_id; }
726
727
4.32M
    [[nodiscard]] std::string get_name() const override { return _name; }
728
729
1.78M
    virtual bool should_dry_run(RuntimeState* state) { return false; }
730
731
320k
    [[nodiscard]] virtual bool count_down_destination() { return true; }
732
733
protected:
734
    template <typename Writer, typename Parent>
735
        requires(std::is_base_of_v<AsyncResultWriter, Writer>)
736
    friend class AsyncWriterSink;
737
    // _operator_id : the current Operator's ID, which is not visible to the user.
738
    // _node_id : the plan node ID corresponding to the Operator, which is visible on the profile.
739
    // _dests_id : the target _operator_id of the sink, for example, in the case of a multi-sink, there are multiple targets.
740
    const int _operator_id;
741
    const int _node_id;
742
    int _nereids_id = -1;
743
    bool _spillable = false;
744
    std::vector<int> _dests_id;
745
    std::string _name;
746
};
747
748
template <typename LocalStateType>
749
class DataSinkOperatorX : public DataSinkOperatorXBase {
750
public:
751
    DataSinkOperatorX(const int id, const int node_id, const int dest_id)
752
448k
            : DataSinkOperatorXBase(id, node_id, dest_id) {}
_ZN5doris17DataSinkOperatorXINS_27LocalExchangeSinkLocalStateEEC2Eiii
Line
Count
Source
752
111k
            : DataSinkOperatorXBase(id, node_id, dest_id) {}
_ZN5doris17DataSinkOperatorXINS_25OlapTableSinkV2LocalStateEEC2Eiii
Line
Count
Source
752
22
            : DataSinkOperatorXBase(id, node_id, dest_id) {}
_ZN5doris17DataSinkOperatorXINS_23OlapTableSinkLocalStateEEC2Eiii
Line
Count
Source
752
28.3k
            : DataSinkOperatorXBase(id, node_id, dest_id) {}
_ZN5doris17DataSinkOperatorXINS_30GroupCommitBlockSinkLocalStateEEC2Eiii
Line
Count
Source
752
163
            : DataSinkOperatorXBase(id, node_id, dest_id) {}
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_23HiveTableSinkLocalStateEEC2Eiii
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_26IcebergTableSinkLocalStateEEC2Eiii
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_21MCTableSinkLocalStateEEC2Eiii
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_22TVFTableSinkLocalStateEEC2Eiii
_ZN5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb1EEEEC2Eiii
Line
Count
Source
752
119
            : DataSinkOperatorXBase(id, node_id, dest_id) {}
_ZN5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb1EEEEC2Eiii
Line
Count
Source
752
197
            : DataSinkOperatorXBase(id, node_id, dest_id) {}
_ZN5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb0EEEEC2Eiii
Line
Count
Source
752
129
            : DataSinkOperatorXBase(id, node_id, dest_id) {}
_ZN5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb0EEEEC2Eiii
Line
Count
Source
752
144
            : DataSinkOperatorXBase(id, node_id, dest_id) {}
_ZN5doris17DataSinkOperatorXINS_26RecCTEAnchorSinkLocalStateEEC2Eiii
Line
Count
Source
752
150
            : DataSinkOperatorXBase(id, node_id, dest_id) {}
_ZN5doris17DataSinkOperatorXINS_20RecCTESinkLocalStateEEC2Eiii
Line
Count
Source
752
150
            : DataSinkOperatorXBase(id, node_id, dest_id) {}
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_27HashJoinBuildSinkLocalStateEEC2Eiii
_ZN5doris17DataSinkOperatorXINS_20ResultSinkLocalStateEEC2Eiii
Line
Count
Source
752
178k
            : DataSinkOperatorXBase(id, node_id, dest_id) {}
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_23JdbcTableSinkLocalStateEEC2Eiii
_ZN5doris17DataSinkOperatorXINS_27MemoryScratchSinkLocalStateEEC2Eiii
Line
Count
Source
752
3
            : DataSinkOperatorXBase(id, node_id, dest_id) {}
_ZN5doris17DataSinkOperatorXINS_24ResultFileSinkLocalStateEEC2Eiii
Line
Count
Source
752
319
            : DataSinkOperatorXBase(id, node_id, dest_id) {}
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_31SpillIcebergTableSinkLocalStateEEC2Eiii
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_22AnalyticSinkLocalStateEEC2Eiii
_ZN5doris17DataSinkOperatorXINS_23BlackholeSinkLocalStateEEC2Eiii
Line
Count
Source
752
3
            : DataSinkOperatorXBase(id, node_id, dest_id) {}
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_18SortSinkLocalStateEEC2Eiii
_ZN5doris17DataSinkOperatorXINS_23SpillSortSinkLocalStateEEC2Eiii
Line
Count
Source
752
17
            : DataSinkOperatorXBase(id, node_id, dest_id) {}
_ZN5doris17DataSinkOperatorXINS_17AggSinkLocalStateEEC2Eiii
Line
Count
Source
752
27
            : DataSinkOperatorXBase(id, node_id, dest_id) {}
_ZN5doris17DataSinkOperatorXINS_28PartitionedAggSinkLocalStateEEC2Eiii
Line
Count
Source
752
325
            : DataSinkOperatorXBase(id, node_id, dest_id) {}
_ZN5doris17DataSinkOperatorXINS_22ExchangeSinkLocalStateEEC2Eiii
Line
Count
Source
752
126k
            : DataSinkOperatorXBase(id, node_id, dest_id) {}
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_33NestedLoopJoinBuildSinkLocalStateEEC2Eiii
_ZN5doris17DataSinkOperatorXINS_19UnionSinkLocalStateEEC2Eiii
Line
Count
Source
752
1.12k
            : DataSinkOperatorXBase(id, node_id, dest_id) {}
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_33MultiCastDataStreamSinkLocalStateEEC2Eiii
_ZN5doris17DataSinkOperatorXINS_27PartitionSortSinkLocalStateEEC2Eiii
Line
Count
Source
752
64
            : DataSinkOperatorXBase(id, node_id, dest_id) {}
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_33PartitionedHashJoinSinkLocalStateEEC2Eiii
_ZN5doris17DataSinkOperatorXINS_19CacheSinkLocalStateEEC2Eiii
Line
Count
Source
752
19
            : DataSinkOperatorXBase(id, node_id, dest_id) {}
_ZN5doris17DataSinkOperatorXINS_18DictSinkLocalStateEEC2Eiii
Line
Count
Source
752
106
            : DataSinkOperatorXBase(id, node_id, dest_id) {}
753
    DataSinkOperatorX(const int id, const TPlanNode& tnode, const int dest_id)
754
167k
            : DataSinkOperatorXBase(id, tnode, dest_id) {}
_ZN5doris17DataSinkOperatorXINS_27HashJoinBuildSinkLocalStateEEC2EiRKNS_9TPlanNodeEi
Line
Count
Source
754
81.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_21MCTableSinkLocalStateEEC2EiRKNS_9TPlanNodeEi
_ZN5doris17DataSinkOperatorXINS_22AnalyticSinkLocalStateEEC2EiRKNS_9TPlanNodeEi
Line
Count
Source
754
1.73k
            : DataSinkOperatorXBase(id, tnode, dest_id) {}
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_23BlackholeSinkLocalStateEEC2EiRKNS_9TPlanNodeEi
_ZN5doris17DataSinkOperatorXINS_18SortSinkLocalStateEEC2EiRKNS_9TPlanNodeEi
Line
Count
Source
754
33.3k
            : DataSinkOperatorXBase(id, tnode, dest_id) {}
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_23SpillSortSinkLocalStateEEC2EiRKNS_9TPlanNodeEi
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_27LocalExchangeSinkLocalStateEEC2EiRKNS_9TPlanNodeEi
_ZN5doris17DataSinkOperatorXINS_17AggSinkLocalStateEEC2EiRKNS_9TPlanNodeEi
Line
Count
Source
754
48.5k
            : DataSinkOperatorXBase(id, tnode, dest_id) {}
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_28PartitionedAggSinkLocalStateEEC2EiRKNS_9TPlanNodeEi
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_22ExchangeSinkLocalStateEEC2EiRKNS_9TPlanNodeEi
_ZN5doris17DataSinkOperatorXINS_33NestedLoopJoinBuildSinkLocalStateEEC2EiRKNS_9TPlanNodeEi
Line
Count
Source
754
2.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
754
32
            : 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
755
756
    DataSinkOperatorX(const int id, const int node_id, std::vector<int> dest_ids)
757
783
            : DataSinkOperatorXBase(id, node_id, dest_ids) {}
_ZN5doris17DataSinkOperatorXINS_33MultiCastDataStreamSinkLocalStateEEC2EiiSt6vectorIiSaIiEE
Line
Count
Source
757
783
            : 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_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_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
758
#ifdef BE_TEST
759
    DataSinkOperatorX() = default;
760
#endif
761
    ~DataSinkOperatorX() override = default;
762
763
    Status setup_local_state(RuntimeState* state, LocalSinkStateInfo& info) override;
764
    std::shared_ptr<BasicSharedState> create_shared_state() const override;
765
766
    using LocalState = LocalStateType;
767
3.26M
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
768
3.26M
        return state->get_sink_local_state()->template cast<LocalState>();
769
3.26M
    }
_ZNK5doris17DataSinkOperatorXINS_22ExchangeSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
767
732k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
768
732k
        return state->get_sink_local_state()->template cast<LocalState>();
769
732k
    }
_ZNK5doris17DataSinkOperatorXINS_19UnionSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
767
11.9k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
768
11.9k
        return state->get_sink_local_state()->template cast<LocalState>();
769
11.9k
    }
_ZNK5doris17DataSinkOperatorXINS_25OlapTableSinkV2LocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
767
22
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
768
22
        return state->get_sink_local_state()->template cast<LocalState>();
769
22
    }
_ZNK5doris17DataSinkOperatorXINS_23OlapTableSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
767
76.4k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
768
76.4k
        return state->get_sink_local_state()->template cast<LocalState>();
769
76.4k
    }
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_23HiveTableSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_26IcebergTableSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_21MCTableSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22TVFTableSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
_ZNK5doris17DataSinkOperatorXINS_27LocalExchangeSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
767
474k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
768
474k
        return state->get_sink_local_state()->template cast<LocalState>();
769
474k
    }
_ZNK5doris17DataSinkOperatorXINS_17AggSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
767
462k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
768
462k
        return state->get_sink_local_state()->template cast<LocalState>();
769
462k
    }
_ZNK5doris17DataSinkOperatorXINS_26RecCTEAnchorSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
767
471
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
768
471
        return state->get_sink_local_state()->template cast<LocalState>();
769
471
    }
_ZNK5doris17DataSinkOperatorXINS_20RecCTESinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
767
5.77k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
768
5.77k
        return state->get_sink_local_state()->template cast<LocalState>();
769
5.77k
    }
_ZNK5doris17DataSinkOperatorXINS_27HashJoinBuildSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
767
644k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
768
644k
        return state->get_sink_local_state()->template cast<LocalState>();
769
644k
    }
_ZNK5doris17DataSinkOperatorXINS_20ResultSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
767
444k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
768
444k
        return state->get_sink_local_state()->template cast<LocalState>();
769
444k
    }
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_23JdbcTableSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
_ZNK5doris17DataSinkOperatorXINS_27MemoryScratchSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
767
3
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
768
3
        return state->get_sink_local_state()->template cast<LocalState>();
769
3
    }
_ZNK5doris17DataSinkOperatorXINS_24ResultFileSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
767
1.22k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
768
1.22k
        return state->get_sink_local_state()->template cast<LocalState>();
769
1.22k
    }
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_31SpillIcebergTableSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
_ZNK5doris17DataSinkOperatorXINS_22AnalyticSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
767
32.6k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
768
32.6k
        return state->get_sink_local_state()->template cast<LocalState>();
769
32.6k
    }
_ZNK5doris17DataSinkOperatorXINS_23BlackholeSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
767
28
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
768
28
        return state->get_sink_local_state()->template cast<LocalState>();
769
28
    }
_ZNK5doris17DataSinkOperatorXINS_18SortSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
767
299k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
768
299k
        return state->get_sink_local_state()->template cast<LocalState>();
769
299k
    }
_ZNK5doris17DataSinkOperatorXINS_23SpillSortSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
767
1.82k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
768
1.82k
        return state->get_sink_local_state()->template cast<LocalState>();
769
1.82k
    }
_ZNK5doris17DataSinkOperatorXINS_28PartitionedAggSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
767
19.4k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
768
19.4k
        return state->get_sink_local_state()->template cast<LocalState>();
769
19.4k
    }
_ZNK5doris17DataSinkOperatorXINS_33NestedLoopJoinBuildSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
767
13.7k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
768
13.7k
        return state->get_sink_local_state()->template cast<LocalState>();
769
13.7k
    }
_ZNK5doris17DataSinkOperatorXINS_33MultiCastDataStreamSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
767
7.79k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
768
7.79k
        return state->get_sink_local_state()->template cast<LocalState>();
769
7.79k
    }
_ZNK5doris17DataSinkOperatorXINS_27PartitionSortSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
767
1.26k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
768
1.26k
        return state->get_sink_local_state()->template cast<LocalState>();
769
1.26k
    }
_ZNK5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb1EEEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
767
10.8k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
768
10.8k
        return state->get_sink_local_state()->template cast<LocalState>();
769
10.8k
    }
_ZNK5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb0EEEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
767
5.95k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
768
5.95k
        return state->get_sink_local_state()->template cast<LocalState>();
769
5.95k
    }
_ZNK5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb1EEEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
767
5.95k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
768
5.95k
        return state->get_sink_local_state()->template cast<LocalState>();
769
5.95k
    }
_ZNK5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb0EEEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
767
5.86k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
768
5.86k
        return state->get_sink_local_state()->template cast<LocalState>();
769
5.86k
    }
_ZNK5doris17DataSinkOperatorXINS_33PartitionedHashJoinSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
767
9
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
768
9
        return state->get_sink_local_state()->template cast<LocalState>();
769
9
    }
_ZNK5doris17DataSinkOperatorXINS_30GroupCommitBlockSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
767
605
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
768
605
        return state->get_sink_local_state()->template cast<LocalState>();
769
605
    }
_ZNK5doris17DataSinkOperatorXINS_19CacheSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
767
367
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
768
367
        return state->get_sink_local_state()->template cast<LocalState>();
769
367
    }
_ZNK5doris17DataSinkOperatorXINS_18DictSinkLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
767
280
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
768
280
        return state->get_sink_local_state()->template cast<LocalState>();
769
280
    }
770
};
771
772
template <typename SharedStateArg>
773
class PipelineXSpillSinkLocalState : public PipelineXSinkLocalState<SharedStateArg> {
774
public:
775
    using Base = PipelineXSinkLocalState<SharedStateArg>;
776
    PipelineXSpillSinkLocalState(DataSinkOperatorXBase* parent, RuntimeState* state)
777
2.73k
            : Base(parent, state) {}
_ZN5doris28PipelineXSpillSinkLocalStateINS_20MultiCastSharedStateEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Line
Count
Source
777
2.38k
            : Base(parent, state) {}
_ZN5doris28PipelineXSpillSinkLocalStateINS_30PartitionedHashJoinSharedStateEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Line
Count
Source
777
5
            : Base(parent, state) {}
_ZN5doris28PipelineXSpillSinkLocalStateINS_20SpillSortSharedStateEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Line
Count
Source
777
22
            : Base(parent, state) {}
_ZN5doris28PipelineXSpillSinkLocalStateINS_25PartitionedAggSharedStateEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Line
Count
Source
777
329
            : Base(parent, state) {}
778
2.79k
    ~PipelineXSpillSinkLocalState() override = default;
_ZN5doris28PipelineXSpillSinkLocalStateINS_20MultiCastSharedStateEED2Ev
Line
Count
Source
778
2.43k
    ~PipelineXSpillSinkLocalState() override = default;
_ZN5doris28PipelineXSpillSinkLocalStateINS_30PartitionedHashJoinSharedStateEED2Ev
Line
Count
Source
778
5
    ~PipelineXSpillSinkLocalState() override = default;
_ZN5doris28PipelineXSpillSinkLocalStateINS_20SpillSortSharedStateEED2Ev
Line
Count
Source
778
22
    ~PipelineXSpillSinkLocalState() override = default;
_ZN5doris28PipelineXSpillSinkLocalStateINS_25PartitionedAggSharedStateEED2Ev
Line
Count
Source
778
327
    ~PipelineXSpillSinkLocalState() override = default;
779
780
2.72k
    Status init(RuntimeState* state, LocalSinkStateInfo& info) override {
781
2.72k
        RETURN_IF_ERROR(Base::init(state, info));
782
2.72k
        init_spill_counters();
783
2.72k
        return Status::OK();
784
2.72k
    }
_ZN5doris28PipelineXSpillSinkLocalStateINS_20MultiCastSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
780
2.37k
    Status init(RuntimeState* state, LocalSinkStateInfo& info) override {
781
2.37k
        RETURN_IF_ERROR(Base::init(state, info));
782
2.37k
        init_spill_counters();
783
2.37k
        return Status::OK();
784
2.37k
    }
_ZN5doris28PipelineXSpillSinkLocalStateINS_30PartitionedHashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
780
2
    Status init(RuntimeState* state, LocalSinkStateInfo& info) override {
781
2
        RETURN_IF_ERROR(Base::init(state, info));
782
2
        init_spill_counters();
783
2
        return Status::OK();
784
2
    }
_ZN5doris28PipelineXSpillSinkLocalStateINS_20SpillSortSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
780
21
    Status init(RuntimeState* state, LocalSinkStateInfo& info) override {
781
21
        RETURN_IF_ERROR(Base::init(state, info));
782
21
        init_spill_counters();
783
21
        return Status::OK();
784
21
    }
_ZN5doris28PipelineXSpillSinkLocalStateINS_25PartitionedAggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
780
329
    Status init(RuntimeState* state, LocalSinkStateInfo& info) override {
781
329
        RETURN_IF_ERROR(Base::init(state, info));
782
329
        init_spill_counters();
783
329
        return Status::OK();
784
329
    }
785
786
2.73k
    void init_spill_counters() {
787
2.73k
        _spill_total_timer = ADD_TIMER_WITH_LEVEL(Base::custom_profile(), "SpillTotalTime", 1);
788
789
2.73k
        _spill_write_timer = ADD_TIMER_WITH_LEVEL(Base::custom_profile(), "SpillWriteTime", 1);
790
791
2.73k
        _spill_write_wait_in_queue_task_count = ADD_COUNTER_WITH_LEVEL(
792
2.73k
                Base::custom_profile(), "SpillWriteTaskWaitInQueueCount", TUnit::UNIT, 1);
793
2.73k
        _spill_writing_task_count = ADD_COUNTER_WITH_LEVEL(Base::custom_profile(),
794
2.73k
                                                           "SpillWriteTaskCount", TUnit::UNIT, 1);
795
2.73k
        _spill_write_wait_in_queue_timer =
796
2.73k
                ADD_TIMER_WITH_LEVEL(Base::custom_profile(), "SpillWriteTaskWaitInQueueTime", 1);
797
798
2.73k
        _spill_write_file_timer =
799
2.73k
                ADD_TIMER_WITH_LEVEL(Base::custom_profile(), "SpillWriteFileTime", 1);
800
801
2.73k
        _spill_write_serialize_block_timer =
802
2.73k
                ADD_TIMER_WITH_LEVEL(Base::custom_profile(), "SpillWriteSerializeBlockTime", 1);
803
2.73k
        _spill_write_block_count = ADD_COUNTER_WITH_LEVEL(Base::custom_profile(),
804
2.73k
                                                          "SpillWriteBlockCount", TUnit::UNIT, 1);
805
2.73k
        _spill_write_block_data_size = ADD_COUNTER_WITH_LEVEL(
806
2.73k
                Base::custom_profile(), "SpillWriteBlockBytes", TUnit::BYTES, 1);
807
2.73k
        _spill_write_rows_count =
808
2.73k
                ADD_COUNTER_WITH_LEVEL(Base::custom_profile(), "SpillWriteRows", TUnit::UNIT, 1);
809
810
2.73k
        _spill_max_rows_of_partition = ADD_COUNTER_WITH_LEVEL(
811
2.73k
                Base::custom_profile(), "SpillMaxRowsOfPartition", TUnit::UNIT, 1);
812
2.73k
        _spill_min_rows_of_partition = ADD_COUNTER_WITH_LEVEL(
813
2.73k
                Base::custom_profile(), "SpillMinRowsOfPartition", TUnit::UNIT, 1);
814
2.73k
    }
_ZN5doris28PipelineXSpillSinkLocalStateINS_20MultiCastSharedStateEE19init_spill_countersEv
Line
Count
Source
786
2.38k
    void init_spill_counters() {
787
2.38k
        _spill_total_timer = ADD_TIMER_WITH_LEVEL(Base::custom_profile(), "SpillTotalTime", 1);
788
789
2.38k
        _spill_write_timer = ADD_TIMER_WITH_LEVEL(Base::custom_profile(), "SpillWriteTime", 1);
790
791
2.38k
        _spill_write_wait_in_queue_task_count = ADD_COUNTER_WITH_LEVEL(
792
2.38k
                Base::custom_profile(), "SpillWriteTaskWaitInQueueCount", TUnit::UNIT, 1);
793
2.38k
        _spill_writing_task_count = ADD_COUNTER_WITH_LEVEL(Base::custom_profile(),
794
2.38k
                                                           "SpillWriteTaskCount", TUnit::UNIT, 1);
795
2.38k
        _spill_write_wait_in_queue_timer =
796
2.38k
                ADD_TIMER_WITH_LEVEL(Base::custom_profile(), "SpillWriteTaskWaitInQueueTime", 1);
797
798
2.38k
        _spill_write_file_timer =
799
2.38k
                ADD_TIMER_WITH_LEVEL(Base::custom_profile(), "SpillWriteFileTime", 1);
800
801
2.38k
        _spill_write_serialize_block_timer =
802
2.38k
                ADD_TIMER_WITH_LEVEL(Base::custom_profile(), "SpillWriteSerializeBlockTime", 1);
803
2.38k
        _spill_write_block_count = ADD_COUNTER_WITH_LEVEL(Base::custom_profile(),
804
2.38k
                                                          "SpillWriteBlockCount", TUnit::UNIT, 1);
805
2.38k
        _spill_write_block_data_size = ADD_COUNTER_WITH_LEVEL(
806
2.38k
                Base::custom_profile(), "SpillWriteBlockBytes", TUnit::BYTES, 1);
807
2.38k
        _spill_write_rows_count =
808
2.38k
                ADD_COUNTER_WITH_LEVEL(Base::custom_profile(), "SpillWriteRows", TUnit::UNIT, 1);
809
810
2.38k
        _spill_max_rows_of_partition = ADD_COUNTER_WITH_LEVEL(
811
2.38k
                Base::custom_profile(), "SpillMaxRowsOfPartition", TUnit::UNIT, 1);
812
2.38k
        _spill_min_rows_of_partition = ADD_COUNTER_WITH_LEVEL(
813
2.38k
                Base::custom_profile(), "SpillMinRowsOfPartition", TUnit::UNIT, 1);
814
2.38k
    }
_ZN5doris28PipelineXSpillSinkLocalStateINS_30PartitionedHashJoinSharedStateEE19init_spill_countersEv
Line
Count
Source
786
5
    void init_spill_counters() {
787
5
        _spill_total_timer = ADD_TIMER_WITH_LEVEL(Base::custom_profile(), "SpillTotalTime", 1);
788
789
5
        _spill_write_timer = ADD_TIMER_WITH_LEVEL(Base::custom_profile(), "SpillWriteTime", 1);
790
791
5
        _spill_write_wait_in_queue_task_count = ADD_COUNTER_WITH_LEVEL(
792
5
                Base::custom_profile(), "SpillWriteTaskWaitInQueueCount", TUnit::UNIT, 1);
793
5
        _spill_writing_task_count = ADD_COUNTER_WITH_LEVEL(Base::custom_profile(),
794
5
                                                           "SpillWriteTaskCount", TUnit::UNIT, 1);
795
5
        _spill_write_wait_in_queue_timer =
796
5
                ADD_TIMER_WITH_LEVEL(Base::custom_profile(), "SpillWriteTaskWaitInQueueTime", 1);
797
798
5
        _spill_write_file_timer =
799
5
                ADD_TIMER_WITH_LEVEL(Base::custom_profile(), "SpillWriteFileTime", 1);
800
801
5
        _spill_write_serialize_block_timer =
802
5
                ADD_TIMER_WITH_LEVEL(Base::custom_profile(), "SpillWriteSerializeBlockTime", 1);
803
5
        _spill_write_block_count = ADD_COUNTER_WITH_LEVEL(Base::custom_profile(),
804
5
                                                          "SpillWriteBlockCount", TUnit::UNIT, 1);
805
5
        _spill_write_block_data_size = ADD_COUNTER_WITH_LEVEL(
806
5
                Base::custom_profile(), "SpillWriteBlockBytes", TUnit::BYTES, 1);
807
5
        _spill_write_rows_count =
808
5
                ADD_COUNTER_WITH_LEVEL(Base::custom_profile(), "SpillWriteRows", TUnit::UNIT, 1);
809
810
5
        _spill_max_rows_of_partition = ADD_COUNTER_WITH_LEVEL(
811
5
                Base::custom_profile(), "SpillMaxRowsOfPartition", TUnit::UNIT, 1);
812
5
        _spill_min_rows_of_partition = ADD_COUNTER_WITH_LEVEL(
813
5
                Base::custom_profile(), "SpillMinRowsOfPartition", TUnit::UNIT, 1);
814
5
    }
_ZN5doris28PipelineXSpillSinkLocalStateINS_20SpillSortSharedStateEE19init_spill_countersEv
Line
Count
Source
786
21
    void init_spill_counters() {
787
21
        _spill_total_timer = ADD_TIMER_WITH_LEVEL(Base::custom_profile(), "SpillTotalTime", 1);
788
789
21
        _spill_write_timer = ADD_TIMER_WITH_LEVEL(Base::custom_profile(), "SpillWriteTime", 1);
790
791
21
        _spill_write_wait_in_queue_task_count = ADD_COUNTER_WITH_LEVEL(
792
21
                Base::custom_profile(), "SpillWriteTaskWaitInQueueCount", TUnit::UNIT, 1);
793
21
        _spill_writing_task_count = ADD_COUNTER_WITH_LEVEL(Base::custom_profile(),
794
21
                                                           "SpillWriteTaskCount", TUnit::UNIT, 1);
795
21
        _spill_write_wait_in_queue_timer =
796
21
                ADD_TIMER_WITH_LEVEL(Base::custom_profile(), "SpillWriteTaskWaitInQueueTime", 1);
797
798
21
        _spill_write_file_timer =
799
21
                ADD_TIMER_WITH_LEVEL(Base::custom_profile(), "SpillWriteFileTime", 1);
800
801
21
        _spill_write_serialize_block_timer =
802
21
                ADD_TIMER_WITH_LEVEL(Base::custom_profile(), "SpillWriteSerializeBlockTime", 1);
803
21
        _spill_write_block_count = ADD_COUNTER_WITH_LEVEL(Base::custom_profile(),
804
21
                                                          "SpillWriteBlockCount", TUnit::UNIT, 1);
805
21
        _spill_write_block_data_size = ADD_COUNTER_WITH_LEVEL(
806
21
                Base::custom_profile(), "SpillWriteBlockBytes", TUnit::BYTES, 1);
807
21
        _spill_write_rows_count =
808
21
                ADD_COUNTER_WITH_LEVEL(Base::custom_profile(), "SpillWriteRows", TUnit::UNIT, 1);
809
810
21
        _spill_max_rows_of_partition = ADD_COUNTER_WITH_LEVEL(
811
21
                Base::custom_profile(), "SpillMaxRowsOfPartition", TUnit::UNIT, 1);
812
21
        _spill_min_rows_of_partition = ADD_COUNTER_WITH_LEVEL(
813
21
                Base::custom_profile(), "SpillMinRowsOfPartition", TUnit::UNIT, 1);
814
21
    }
_ZN5doris28PipelineXSpillSinkLocalStateINS_25PartitionedAggSharedStateEE19init_spill_countersEv
Line
Count
Source
786
328
    void init_spill_counters() {
787
328
        _spill_total_timer = ADD_TIMER_WITH_LEVEL(Base::custom_profile(), "SpillTotalTime", 1);
788
789
328
        _spill_write_timer = ADD_TIMER_WITH_LEVEL(Base::custom_profile(), "SpillWriteTime", 1);
790
791
328
        _spill_write_wait_in_queue_task_count = ADD_COUNTER_WITH_LEVEL(
792
328
                Base::custom_profile(), "SpillWriteTaskWaitInQueueCount", TUnit::UNIT, 1);
793
328
        _spill_writing_task_count = ADD_COUNTER_WITH_LEVEL(Base::custom_profile(),
794
328
                                                           "SpillWriteTaskCount", TUnit::UNIT, 1);
795
328
        _spill_write_wait_in_queue_timer =
796
328
                ADD_TIMER_WITH_LEVEL(Base::custom_profile(), "SpillWriteTaskWaitInQueueTime", 1);
797
798
328
        _spill_write_file_timer =
799
328
                ADD_TIMER_WITH_LEVEL(Base::custom_profile(), "SpillWriteFileTime", 1);
800
801
328
        _spill_write_serialize_block_timer =
802
328
                ADD_TIMER_WITH_LEVEL(Base::custom_profile(), "SpillWriteSerializeBlockTime", 1);
803
328
        _spill_write_block_count = ADD_COUNTER_WITH_LEVEL(Base::custom_profile(),
804
328
                                                          "SpillWriteBlockCount", TUnit::UNIT, 1);
805
328
        _spill_write_block_data_size = ADD_COUNTER_WITH_LEVEL(
806
328
                Base::custom_profile(), "SpillWriteBlockBytes", TUnit::BYTES, 1);
807
328
        _spill_write_rows_count =
808
328
                ADD_COUNTER_WITH_LEVEL(Base::custom_profile(), "SpillWriteRows", TUnit::UNIT, 1);
809
810
328
        _spill_max_rows_of_partition = ADD_COUNTER_WITH_LEVEL(
811
328
                Base::custom_profile(), "SpillMaxRowsOfPartition", TUnit::UNIT, 1);
812
328
        _spill_min_rows_of_partition = ADD_COUNTER_WITH_LEVEL(
813
328
                Base::custom_profile(), "SpillMinRowsOfPartition", TUnit::UNIT, 1);
814
328
    }
815
816
2.74k
    std::vector<Dependency*> dependencies() const override {
817
2.74k
        auto dependencies = Base::dependencies();
818
2.74k
        return dependencies;
819
2.74k
    }
_ZNK5doris28PipelineXSpillSinkLocalStateINS_20MultiCastSharedStateEE12dependenciesEv
Line
Count
Source
816
2.41k
    std::vector<Dependency*> dependencies() const override {
817
2.41k
        auto dependencies = Base::dependencies();
818
2.41k
        return dependencies;
819
2.41k
    }
Unexecuted instantiation: _ZNK5doris28PipelineXSpillSinkLocalStateINS_30PartitionedHashJoinSharedStateEE12dependenciesEv
_ZNK5doris28PipelineXSpillSinkLocalStateINS_20SpillSortSharedStateEE12dependenciesEv
Line
Count
Source
816
14
    std::vector<Dependency*> dependencies() const override {
817
14
        auto dependencies = Base::dependencies();
818
14
        return dependencies;
819
14
    }
_ZNK5doris28PipelineXSpillSinkLocalStateINS_25PartitionedAggSharedStateEE12dependenciesEv
Line
Count
Source
816
318
    std::vector<Dependency*> dependencies() const override {
817
318
        auto dependencies = Base::dependencies();
818
318
        return dependencies;
819
318
    }
820
821
2.51k
    void update_max_min_rows_counter() {
822
2.51k
        int64_t max_rows = 0;
823
2.51k
        int64_t min_rows = std::numeric_limits<int64_t>::max();
824
825
80.2k
        for (auto rows : _rows_in_partitions) {
826
80.2k
            if (rows > max_rows) {
827
2.07k
                max_rows = rows;
828
2.07k
            }
829
80.2k
            if (rows < min_rows) {
830
3.25k
                min_rows = rows;
831
3.25k
            }
832
80.2k
        }
833
834
2.51k
        COUNTER_SET(_spill_max_rows_of_partition, max_rows);
835
2.51k
        COUNTER_SET(_spill_min_rows_of_partition, min_rows);
836
2.51k
    }
_ZN5doris28PipelineXSpillSinkLocalStateINS_30PartitionedHashJoinSharedStateEE27update_max_min_rows_counterEv
Line
Count
Source
821
2
    void update_max_min_rows_counter() {
822
2
        int64_t max_rows = 0;
823
2
        int64_t min_rows = std::numeric_limits<int64_t>::max();
824
825
16
        for (auto rows : _rows_in_partitions) {
826
16
            if (rows > max_rows) {
827
2
                max_rows = rows;
828
2
            }
829
16
            if (rows < min_rows) {
830
4
                min_rows = rows;
831
4
            }
832
16
        }
833
834
2
        COUNTER_SET(_spill_max_rows_of_partition, max_rows);
835
2
        COUNTER_SET(_spill_min_rows_of_partition, min_rows);
836
2
    }
_ZN5doris28PipelineXSpillSinkLocalStateINS_25PartitionedAggSharedStateEE27update_max_min_rows_counterEv
Line
Count
Source
821
2.50k
    void update_max_min_rows_counter() {
822
2.50k
        int64_t max_rows = 0;
823
2.50k
        int64_t min_rows = std::numeric_limits<int64_t>::max();
824
825
80.2k
        for (auto rows : _rows_in_partitions) {
826
80.2k
            if (rows > max_rows) {
827
2.07k
                max_rows = rows;
828
2.07k
            }
829
80.2k
            if (rows < min_rows) {
830
3.24k
                min_rows = rows;
831
3.24k
            }
832
80.2k
        }
833
834
2.50k
        COUNTER_SET(_spill_max_rows_of_partition, max_rows);
835
2.50k
        COUNTER_SET(_spill_min_rows_of_partition, min_rows);
836
2.50k
    }
837
838
    std::vector<int64_t> _rows_in_partitions;
839
840
    // Total time of spill, including spill task scheduling time,
841
    // serialize block time, write disk file time,
842
    // and read disk file time, deserialize block time etc.
843
    RuntimeProfile::Counter* _spill_total_timer = nullptr;
844
845
    // Spill write counters
846
    // Total time of spill write, including serialize block time, write disk file,
847
    // and wait in queue time, etc.
848
    RuntimeProfile::Counter* _spill_write_timer = nullptr;
849
850
    RuntimeProfile::Counter* _spill_write_wait_in_queue_task_count = nullptr;
851
    RuntimeProfile::Counter* _spill_writing_task_count = nullptr;
852
    RuntimeProfile::Counter* _spill_write_wait_in_queue_timer = nullptr;
853
854
    // Total time of writing file
855
    RuntimeProfile::Counter* _spill_write_file_timer = nullptr;
856
    RuntimeProfile::Counter* _spill_write_serialize_block_timer = nullptr;
857
    // Original count of spilled Blocks
858
    // One Big Block maybe split into multiple small Blocks when actually written to disk file.
859
    RuntimeProfile::Counter* _spill_write_block_count = nullptr;
860
    // Total bytes of spill data in Block format(in memory format)
861
    RuntimeProfile::Counter* _spill_write_block_data_size = nullptr;
862
    RuntimeProfile::Counter* _spill_write_rows_count = nullptr;
863
    // Spilled file total size
864
    RuntimeProfile::Counter* _spill_file_total_size = nullptr;
865
866
    RuntimeProfile::Counter* _spill_max_rows_of_partition = nullptr;
867
    RuntimeProfile::Counter* _spill_min_rows_of_partition = nullptr;
868
};
869
870
class OperatorXBase : public OperatorBase {
871
public:
872
    OperatorXBase(ObjectPool* pool, const TPlanNode& tnode, const int operator_id,
873
                  const DescriptorTbl& descs)
874
616k
            : OperatorBase(tnode.__isset.is_serial_operator && tnode.is_serial_operator),
875
616k
              _operator_id(operator_id),
876
616k
              _node_id(tnode.node_id),
877
616k
              _type(tnode.node_type),
878
616k
              _pool(pool),
879
616k
              _tuple_ids(tnode.row_tuples),
880
616k
              _row_descriptor(descs, tnode.row_tuples),
881
616k
              _resource_profile(tnode.resource_profile),
882
616k
              _limit(tnode.limit) {
883
616k
        if (tnode.__isset.output_tuple_id) {
884
292k
            _output_row_descriptor.reset(new RowDescriptor(descs, {tnode.output_tuple_id}));
885
292k
            _output_row_descriptor =
886
292k
                    std::make_unique<RowDescriptor>(descs, std::vector {tnode.output_tuple_id});
887
292k
        }
888
616k
        if (!tnode.intermediate_output_tuple_id_list.empty()) {
889
            // common subexpression elimination
890
2.88k
            _intermediate_output_row_descriptor.reserve(
891
2.88k
                    tnode.intermediate_output_tuple_id_list.size());
892
3.78k
            for (auto output_tuple_id : tnode.intermediate_output_tuple_id_list) {
893
3.78k
                _intermediate_output_row_descriptor.push_back(
894
3.78k
                        RowDescriptor(descs, std::vector {output_tuple_id}));
895
3.78k
            }
896
2.88k
        }
897
616k
    }
898
899
    OperatorXBase(ObjectPool* pool, int node_id, int operator_id)
900
113k
            : OperatorBase(),
901
113k
              _operator_id(operator_id),
902
113k
              _node_id(node_id),
903
113k
              _pool(pool),
904
113k
              _limit(-1) {}
905
906
#ifdef BE_TEST
907
    OperatorXBase() : _operator_id(-1), _node_id(0), _limit(-1) {};
908
#endif
909
    virtual Status init(const TPlanNode& tnode, RuntimeState* state);
910
0
    Status init(const TDataSink& tsink) override {
911
0
        throw Exception(Status::FatalError("should not reach here!"));
912
0
    }
913
0
    virtual Status init(ExchangeType type) {
914
0
        throw Exception(Status::FatalError("should not reach here!"));
915
0
    }
916
0
    [[noreturn]] virtual const std::vector<TRuntimeFilterDesc>& runtime_filter_descs() {
917
0
        throw doris::Exception(ErrorCode::NOT_IMPLEMENTED_ERROR, _op_name);
918
0
    }
919
4.38M
    [[nodiscard]] std::string get_name() const override { return _op_name; }
920
5.77M
    [[nodiscard]] virtual bool need_more_input_data(RuntimeState* state) const { return true; }
921
8.72M
    bool is_blockable(RuntimeState* state) const override {
922
8.72M
        return state->get_sink_local_state()->is_blockable() || _blockable;
923
8.72M
    }
924
925
    Status prepare(RuntimeState* state) override;
926
927
    Status terminate(RuntimeState* state) override;
928
    [[nodiscard]] virtual Status get_block(RuntimeState* state, Block* block, bool* eos) = 0;
929
930
    Status close(RuntimeState* state) override;
931
932
1.35M
    [[nodiscard]] virtual const RowDescriptor& intermediate_row_desc() const {
933
1.35M
        return _row_descriptor;
934
1.35M
    }
935
936
3.79k
    [[nodiscard]] const RowDescriptor& intermediate_row_desc(int idx) {
937
3.79k
        if (idx == 0) {
938
2.89k
            return intermediate_row_desc();
939
2.89k
        }
940
3.79k
        DCHECK((idx - 1) < _intermediate_output_row_descriptor.size());
941
898
        return _intermediate_output_row_descriptor[idx - 1];
942
3.79k
    }
943
944
595k
    [[nodiscard]] const RowDescriptor& projections_row_desc() const {
945
595k
        if (_intermediate_output_row_descriptor.empty()) {
946
593k
            return intermediate_row_desc();
947
593k
        } else {
948
2.44k
            return _intermediate_output_row_descriptor.back();
949
2.44k
        }
950
595k
    }
951
952
879
    size_t revocable_mem_size(RuntimeState* state) const override {
953
879
        return (_child and !is_source()) ? _child->revocable_mem_size(state) : 0;
954
879
    }
955
956
    // If this method is not overwrite by child, its default value is 1MB
957
3
    [[nodiscard]] virtual size_t get_reserve_mem_size(RuntimeState* state) {
958
3
        return state->minimum_operator_memory_required_bytes();
959
3
    }
960
961
    virtual std::string debug_string(int indentation_level = 0) const;
962
963
    virtual std::string debug_string(RuntimeState* state, int indentation_level = 0) const;
964
965
    virtual Status setup_local_state(RuntimeState* state, LocalStateInfo& info) = 0;
966
967
    template <class TARGET>
968
17.8M
    TARGET& cast() {
969
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
970
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
971
18.4E
                << " and expect type is" << typeid(TARGET).name();
972
17.8M
        return reinterpret_cast<TARGET&>(*this);
973
17.8M
    }
_ZN5doris13OperatorXBase4castINS_17OlapScanOperatorXEEERT_v
Line
Count
Source
968
13.5M
    TARGET& cast() {
969
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
970
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
971
18.4E
                << " and expect type is" << typeid(TARGET).name();
972
13.5M
        return reinterpret_cast<TARGET&>(*this);
973
13.5M
    }
_ZN5doris13OperatorXBase4castINS_17JDBCScanOperatorXEEERT_v
Line
Count
Source
968
48
    TARGET& cast() {
969
48
        DCHECK(dynamic_cast<TARGET*>(this))
970
0
                << " Mismatch type! Current type is " << typeid(*this).name()
971
0
                << " and expect type is" << typeid(TARGET).name();
972
48
        return reinterpret_cast<TARGET&>(*this);
973
48
    }
_ZN5doris13OperatorXBase4castINS_17FileScanOperatorXEEERT_v
Line
Count
Source
968
51.2k
    TARGET& cast() {
969
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
970
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
971
18.4E
                << " and expect type is" << typeid(TARGET).name();
972
51.2k
        return reinterpret_cast<TARGET&>(*this);
973
51.2k
    }
Unexecuted instantiation: _ZN5doris13OperatorXBase4castINS_15EsScanOperatorXEEERT_v
_ZN5doris13OperatorXBase4castINS_17MetaScanOperatorXEEERT_v
Line
Count
Source
968
35.9k
    TARGET& cast() {
969
35.9k
        DCHECK(dynamic_cast<TARGET*>(this))
970
0
                << " Mismatch type! Current type is " << typeid(*this).name()
971
0
                << " and expect type is" << typeid(TARGET).name();
972
35.9k
        return reinterpret_cast<TARGET&>(*this);
973
35.9k
    }
_ZN5doris13OperatorXBase4castINS_20GroupCommitOperatorXEEERT_v
Line
Count
Source
968
525
    TARGET& cast() {
969
525
        DCHECK(dynamic_cast<TARGET*>(this))
970
0
                << " Mismatch type! Current type is " << typeid(*this).name()
971
0
                << " and expect type is" << typeid(TARGET).name();
972
525
        return reinterpret_cast<TARGET&>(*this);
973
525
    }
_ZN5doris13OperatorXBase4castINS_22HashJoinProbeOperatorXEEERT_v
Line
Count
Source
968
600k
    TARGET& cast() {
969
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
970
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
971
18.4E
                << " and expect type is" << typeid(TARGET).name();
972
600k
        return reinterpret_cast<TARGET&>(*this);
973
600k
    }
_ZN5doris13OperatorXBase4castINS_28NestedLoopJoinProbeOperatorXEEERT_v
Line
Count
Source
968
85.5k
    TARGET& cast() {
969
85.5k
        DCHECK(dynamic_cast<TARGET*>(this))
970
2
                << " Mismatch type! Current type is " << typeid(*this).name()
971
2
                << " and expect type is" << typeid(TARGET).name();
972
85.5k
        return reinterpret_cast<TARGET&>(*this);
973
85.5k
    }
_ZN5doris13OperatorXBase4castINS_33PartitionedHashJoinProbeOperatorXEEERT_v
Line
Count
Source
968
9
    TARGET& cast() {
969
9
        DCHECK(dynamic_cast<TARGET*>(this))
970
0
                << " Mismatch type! Current type is " << typeid(*this).name()
971
0
                << " and expect type is" << typeid(TARGET).name();
972
9
        return reinterpret_cast<TARGET&>(*this);
973
9
    }
_ZN5doris13OperatorXBase4castINS_24SpillSortSourceOperatorXEEERT_v
Line
Count
Source
968
28
    TARGET& cast() {
969
28
        DCHECK(dynamic_cast<TARGET*>(this))
970
0
                << " Mismatch type! Current type is " << typeid(*this).name()
971
0
                << " and expect type is" << typeid(TARGET).name();
972
28
        return reinterpret_cast<TARGET&>(*this);
973
28
    }
_ZN5doris13OperatorXBase4castINS_29LocalMergeSortSourceOperatorXEEERT_v
Line
Count
Source
968
57.7k
    TARGET& cast() {
969
57.7k
        DCHECK(dynamic_cast<TARGET*>(this))
970
0
                << " Mismatch type! Current type is " << typeid(*this).name()
971
0
                << " and expect type is" << typeid(TARGET).name();
972
57.7k
        return reinterpret_cast<TARGET&>(*this);
973
57.7k
    }
_ZN5doris13OperatorXBase4castINS_18AggSourceOperatorXEEERT_v
Line
Count
Source
968
182k
    TARGET& cast() {
969
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
970
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
971
18.4E
                << " and expect type is" << typeid(TARGET).name();
972
182k
        return reinterpret_cast<TARGET&>(*this);
973
182k
    }
_ZN5doris13OperatorXBase4castINS_29PartitionedAggSourceOperatorXEEERT_v
Line
Count
Source
968
319
    TARGET& cast() {
969
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
970
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
971
18.4E
                << " and expect type is" << typeid(TARGET).name();
972
319
        return reinterpret_cast<TARGET&>(*this);
973
319
    }
_ZN5doris13OperatorXBase4castINS_22TableFunctionOperatorXEEERT_v
Line
Count
Source
968
75.4k
    TARGET& cast() {
969
75.4k
        DCHECK(dynamic_cast<TARGET*>(this))
970
5
                << " Mismatch type! Current type is " << typeid(*this).name()
971
5
                << " and expect type is" << typeid(TARGET).name();
972
75.4k
        return reinterpret_cast<TARGET&>(*this);
973
75.4k
    }
_ZN5doris13OperatorXBase4castINS_23ExchangeSourceOperatorXEEERT_v
Line
Count
Source
968
1.34M
    TARGET& cast() {
969
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
970
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
971
18.4E
                << " and expect type is" << typeid(TARGET).name();
972
1.34M
        return reinterpret_cast<TARGET&>(*this);
973
1.34M
    }
_ZN5doris13OperatorXBase4castINS_15RepeatOperatorXEEERT_v
Line
Count
Source
968
4.95k
    TARGET& cast() {
969
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
970
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
971
18.4E
                << " and expect type is" << typeid(TARGET).name();
972
4.95k
        return reinterpret_cast<TARGET&>(*this);
973
4.95k
    }
_ZN5doris13OperatorXBase4castINS_20UnionSourceOperatorXEEERT_v
Line
Count
Source
968
117k
    TARGET& cast() {
969
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
970
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
971
18.4E
                << " and expect type is" << typeid(TARGET).name();
972
117k
        return reinterpret_cast<TARGET&>(*this);
973
117k
    }
_ZN5doris13OperatorXBase4castINS_36MultiCastDataStreamerSourceOperatorXEEERT_v
Line
Count
Source
968
12.5k
    TARGET& cast() {
969
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
970
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
971
18.4E
                << " and expect type is" << typeid(TARGET).name();
972
12.5k
        return reinterpret_cast<TARGET&>(*this);
973
12.5k
    }
_ZN5doris13OperatorXBase4castINS_18SetSourceOperatorXILb1EEEEERT_v
Line
Count
Source
968
4.80k
    TARGET& cast() {
969
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
970
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
971
18.4E
                << " and expect type is" << typeid(TARGET).name();
972
4.80k
        return reinterpret_cast<TARGET&>(*this);
973
4.80k
    }
_ZN5doris13OperatorXBase4castINS_18SetSourceOperatorXILb0EEEEERT_v
Line
Count
Source
968
4.84k
    TARGET& cast() {
969
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
970
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
971
18.4E
                << " and expect type is" << typeid(TARGET).name();
972
4.84k
        return reinterpret_cast<TARGET&>(*this);
973
4.84k
    }
_ZN5doris13OperatorXBase4castINS_22DataGenSourceOperatorXEEERT_v
Line
Count
Source
968
267
    TARGET& cast() {
969
267
        DCHECK(dynamic_cast<TARGET*>(this))
970
0
                << " Mismatch type! Current type is " << typeid(*this).name()
971
0
                << " and expect type is" << typeid(TARGET).name();
972
267
        return reinterpret_cast<TARGET&>(*this);
973
267
    }
_ZN5doris13OperatorXBase4castINS_19SchemaScanOperatorXEEERT_v
Line
Count
Source
968
1.53k
    TARGET& cast() {
969
1.53k
        DCHECK(dynamic_cast<TARGET*>(this))
970
0
                << " Mismatch type! Current type is " << typeid(*this).name()
971
0
                << " and expect type is" << typeid(TARGET).name();
972
1.53k
        return reinterpret_cast<TARGET&>(*this);
973
1.53k
    }
_ZN5doris13OperatorXBase4castINS_20CacheSourceOperatorXEEERT_v
Line
Count
Source
968
735
    TARGET& cast() {
969
735
        DCHECK(dynamic_cast<TARGET*>(this))
970
1
                << " Mismatch type! Current type is " << typeid(*this).name()
971
1
                << " and expect type is" << typeid(TARGET).name();
972
735
        return reinterpret_cast<TARGET&>(*this);
973
735
    }
_ZN5doris13OperatorXBase4castINS_21RecCTESourceOperatorXEEERT_v
Line
Count
Source
968
600
    TARGET& cast() {
969
600
        DCHECK(dynamic_cast<TARGET*>(this))
970
0
                << " Mismatch type! Current type is " << typeid(*this).name()
971
0
                << " and expect type is" << typeid(TARGET).name();
972
600
        return reinterpret_cast<TARGET&>(*this);
973
600
    }
_ZN5doris13OperatorXBase4castINS_21StreamingAggOperatorXEEERT_v
Line
Count
Source
968
514k
    TARGET& cast() {
969
18.4E
        DCHECK(dynamic_cast<TARGET*>(this))
970
18.4E
                << " Mismatch type! Current type is " << typeid(*this).name()
971
18.4E
                << " and expect type is" << typeid(TARGET).name();
972
514k
        return reinterpret_cast<TARGET&>(*this);
973
514k
    }
_ZN5doris13OperatorXBase4castINS_29DistinctStreamingAggOperatorXEEERT_v
Line
Count
Source
968
1.22M
    TARGET& cast() {
969
1.22M
        DCHECK(dynamic_cast<TARGET*>(this))
970
100
                << " Mismatch type! Current type is " << typeid(*this).name()
971
100
                << " and expect type is" << typeid(TARGET).name();
972
1.22M
        return reinterpret_cast<TARGET&>(*this);
973
1.22M
    }
974
    template <class TARGET>
975
    const TARGET& cast() const {
976
        DCHECK(dynamic_cast<const TARGET*>(this))
977
                << " Mismatch type! Current type is " << typeid(*this).name()
978
                << " and expect type is" << typeid(TARGET).name();
979
        return reinterpret_cast<const TARGET&>(*this);
980
    }
981
982
97.2k
    [[nodiscard]] OperatorPtr get_child() { return _child; }
983
984
1.47k
    [[nodiscard]] VExprContextSPtrs& conjuncts() { return _conjuncts; }
985
0
    [[nodiscard]] VExprContextSPtrs& projections() { return _projections; }
986
1.68M
    [[nodiscard]] virtual RowDescriptor& row_descriptor() { return _row_descriptor; }
987
988
71.9M
    [[nodiscard]] int operator_id() const { return _operator_id; }
989
11.0M
    [[nodiscard]] int node_id() const override { return _node_id; }
990
3.62M
    [[nodiscard]] int nereids_id() const { return _nereids_id; }
991
992
504k
    [[nodiscard]] int64_t limit() const { return _limit; }
993
994
10.2M
    [[nodiscard]] const RowDescriptor& row_desc() const override {
995
10.2M
        return _output_row_descriptor ? *_output_row_descriptor : _row_descriptor;
996
10.2M
    }
997
998
1.22M
    [[nodiscard]] const RowDescriptor* output_row_descriptor() {
999
1.22M
        return _output_row_descriptor.get();
1000
1.22M
    }
1001
1002
595k
    bool has_output_row_desc() const { return _output_row_descriptor != nullptr; }
1003
1004
    [[nodiscard]] virtual Status get_block_after_projects(RuntimeState* state, Block* block,
1005
                                                          bool* eos);
1006
1007
    /// Only use in vectorized exec engine try to do projections to trans _row_desc -> _output_row_desc
1008
    Status do_projections(RuntimeState* state, Block* origin_block, Block* output_block) const;
1009
1.01M
    void set_parallel_tasks(int parallel_tasks) { _parallel_tasks = parallel_tasks; }
1010
106
    int parallel_tasks() const { return _parallel_tasks; }
1011
1012
    // To keep compatibility with older FE
1013
1
    void set_serial_operator() { _is_serial_operator = true; }
1014
1015
0
    virtual void reset_reserve_mem_size(RuntimeState* state) {}
1016
1017
protected:
1018
    template <typename Dependency>
1019
    friend class PipelineXLocalState;
1020
    friend class PipelineXLocalStateBase;
1021
    friend class Scanner;
1022
    const int _operator_id;
1023
    const int _node_id; // unique w/in single plan tree
1024
    int _nereids_id = -1;
1025
    TPlanNodeType::type _type;
1026
    ObjectPool* _pool = nullptr;
1027
    std::vector<TupleId> _tuple_ids;
1028
1029
private:
1030
    // The expr of operator set to private permissions, as cannot be executed concurrently,
1031
    // should use local state's expr.
1032
    VExprContextSPtrs _conjuncts;
1033
    VExprContextSPtrs _projections;
1034
    // Used in common subexpression elimination to compute intermediate results.
1035
    std::vector<VExprContextSPtrs> _intermediate_projections;
1036
1037
protected:
1038
    RowDescriptor _row_descriptor;
1039
    std::unique_ptr<RowDescriptor> _output_row_descriptor = nullptr;
1040
    std::vector<RowDescriptor> _intermediate_output_row_descriptor;
1041
1042
    /// Resource information sent from the frontend.
1043
    const TBackendResourceProfile _resource_profile;
1044
1045
    int64_t _limit; // -1: no limit
1046
1047
    uint32_t _debug_point_count = 0;
1048
    std::atomic_uint32_t _bytes_per_row = 0;
1049
1050
    std::string _op_name;
1051
    int _parallel_tasks = 0;
1052
1053
    //_keep_origin is used to avoid copying during projection,
1054
    // currently set to false only in the nestloop join.
1055
    bool _keep_origin = true;
1056
1057
    // _blockable is true if the operator contains expressions that may block execution
1058
    bool _blockable = false;
1059
};
1060
1061
template <typename LocalStateType>
1062
class OperatorX : public OperatorXBase {
1063
public:
1064
    OperatorX(ObjectPool* pool, const TPlanNode& tnode, const int operator_id,
1065
              const DescriptorTbl& descs)
1066
617k
            : OperatorXBase(pool, tnode, operator_id, descs) {}
_ZN5doris9OperatorXINS_21UnionSourceLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1066
37.7k
            : OperatorXBase(pool, tnode, operator_id, descs) {}
_ZN5doris9OperatorXINS_29PartitionSortSourceLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1066
64
            : OperatorXBase(pool, tnode, operator_id, descs) {}
_ZN5doris9OperatorXINS_25MaterializationLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1066
667
            : OperatorXBase(pool, tnode, operator_id, descs) {}
_ZN5doris9OperatorXINS_19SetSourceLocalStateILb1EEEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1066
119
            : OperatorXBase(pool, tnode, operator_id, descs) {}
_ZN5doris9OperatorXINS_19SetSourceLocalStateILb0EEEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1066
129
            : OperatorXBase(pool, tnode, operator_id, descs) {}
_ZN5doris9OperatorXINS_18EmptySetLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1066
1.52k
            : OperatorXBase(pool, tnode, operator_id, descs) {}
_ZN5doris9OperatorXINS_16SelectLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1066
747
            : OperatorXBase(pool, tnode, operator_id, descs) {}
_ZN5doris9OperatorXINS_22RecCTESourceLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1066
150
            : OperatorXBase(pool, tnode, operator_id, descs) {}
_ZN5doris9OperatorXINS_20RecCTEScanLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1066
1.85k
            : OperatorXBase(pool, tnode, operator_id, descs) {}
_ZN5doris9OperatorXINS_23HashJoinProbeLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1066
81.0k
            : OperatorXBase(pool, tnode, operator_id, descs) {}
_ZN5doris9OperatorXINS_18OlapScanLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1066
171k
            : OperatorXBase(pool, tnode, operator_id, descs) {}
_ZN5doris9OperatorXINS_21GroupCommitLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1066
75
            : OperatorXBase(pool, tnode, operator_id, descs) {}
_ZN5doris9OperatorXINS_18JDBCScanLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1066
4
            : OperatorXBase(pool, tnode, operator_id, descs) {}
_ZN5doris9OperatorXINS_18FileScanLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1066
2.65k
            : OperatorXBase(pool, tnode, operator_id, descs) {}
Unexecuted instantiation: _ZN5doris9OperatorXINS_16EsScanLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
_ZN5doris9OperatorXINS_18AnalyticLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1066
1.73k
            : OperatorXBase(pool, tnode, operator_id, descs) {}
_ZN5doris9OperatorXINS_14SortLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1066
4.43k
            : OperatorXBase(pool, tnode, operator_id, descs) {}
_ZN5doris9OperatorXINS_19SpillSortLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1066
17
            : OperatorXBase(pool, tnode, operator_id, descs) {}
_ZN5doris9OperatorXINS_24LocalMergeSortLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1066
28.9k
            : OperatorXBase(pool, tnode, operator_id, descs) {}
_ZN5doris9OperatorXINS_13AggLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1066
48.5k
            : OperatorXBase(pool, tnode, operator_id, descs) {}
_ZN5doris9OperatorXINS_24PartitionedAggLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1066
325
            : OperatorXBase(pool, tnode, operator_id, descs) {}
_ZN5doris9OperatorXINS_23TableFunctionLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1066
869
            : OperatorXBase(pool, tnode, operator_id, descs) {}
_ZN5doris9OperatorXINS_18ExchangeLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1066
124k
            : OperatorXBase(pool, tnode, operator_id, descs) {}
_ZN5doris9OperatorXINS_16RepeatLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1066
311
            : OperatorXBase(pool, tnode, operator_id, descs) {}
_ZN5doris9OperatorXINS_29NestedLoopJoinProbeLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1066
2.42k
            : OperatorXBase(pool, tnode, operator_id, descs) {}
_ZN5doris9OperatorXINS_23AssertNumRowsLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1066
18
            : OperatorXBase(pool, tnode, operator_id, descs) {}
Unexecuted instantiation: _ZN5doris9OperatorXINS_35MultiCastDataStreamSourceLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
_ZN5doris9OperatorXINS_17DataGenLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1066
265
            : OperatorXBase(pool, tnode, operator_id, descs) {}
_ZN5doris9OperatorXINS_20SchemaScanLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1066
1.53k
            : OperatorXBase(pool, tnode, operator_id, descs) {}
_ZN5doris9OperatorXINS_18MetaScanLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1066
5.13k
            : OperatorXBase(pool, tnode, operator_id, descs) {}
Unexecuted instantiation: _ZN5doris9OperatorXINS_29LocalExchangeSourceLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
_ZN5doris9OperatorXINS_34PartitionedHashJoinProbeLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1066
30
            : OperatorXBase(pool, tnode, operator_id, descs) {}
Unexecuted instantiation: _ZN5doris9OperatorXINS_21CacheSourceLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
_ZN5doris9OperatorXINS_22StreamingAggLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1066
1.61k
            : OperatorXBase(pool, tnode, operator_id, descs) {}
_ZN5doris9OperatorXINS_30DistinctStreamingAggLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1066
98.9k
            : OperatorXBase(pool, tnode, operator_id, descs) {}
1067
    OperatorX(ObjectPool* pool, int node_id, int operator_id)
1068
113k
            : OperatorXBase(pool, node_id, operator_id) {};
_ZN5doris9OperatorXINS_21CacheSourceLocalStateEEC2EPNS_10ObjectPoolEii
Line
Count
Source
1068
19
            : OperatorXBase(pool, node_id, operator_id) {};
_ZN5doris9OperatorXINS_29LocalExchangeSourceLocalStateEEC2EPNS_10ObjectPoolEii
Line
Count
Source
1068
111k
            : OperatorXBase(pool, node_id, operator_id) {};
_ZN5doris9OperatorXINS_35MultiCastDataStreamSourceLocalStateEEC2EPNS_10ObjectPoolEii
Line
Count
Source
1068
2.13k
            : OperatorXBase(pool, node_id, operator_id) {};
Unexecuted instantiation: _ZN5doris9OperatorXINS_23HashJoinProbeLocalStateEEC2EPNS_10ObjectPoolEii
Unexecuted instantiation: _ZN5doris9OperatorXINS_18OlapScanLocalStateEEC2EPNS_10ObjectPoolEii
Unexecuted instantiation: _ZN5doris9OperatorXINS_21GroupCommitLocalStateEEC2EPNS_10ObjectPoolEii
Unexecuted instantiation: _ZN5doris9OperatorXINS_18JDBCScanLocalStateEEC2EPNS_10ObjectPoolEii
Unexecuted instantiation: _ZN5doris9OperatorXINS_18FileScanLocalStateEEC2EPNS_10ObjectPoolEii
Unexecuted instantiation: _ZN5doris9OperatorXINS_16EsScanLocalStateEEC2EPNS_10ObjectPoolEii
Unexecuted instantiation: _ZN5doris9OperatorXINS_18AnalyticLocalStateEEC2EPNS_10ObjectPoolEii
Unexecuted instantiation: _ZN5doris9OperatorXINS_14SortLocalStateEEC2EPNS_10ObjectPoolEii
Unexecuted instantiation: _ZN5doris9OperatorXINS_19SpillSortLocalStateEEC2EPNS_10ObjectPoolEii
Unexecuted instantiation: _ZN5doris9OperatorXINS_24LocalMergeSortLocalStateEEC2EPNS_10ObjectPoolEii
Unexecuted instantiation: _ZN5doris9OperatorXINS_13AggLocalStateEEC2EPNS_10ObjectPoolEii
Unexecuted instantiation: _ZN5doris9OperatorXINS_24PartitionedAggLocalStateEEC2EPNS_10ObjectPoolEii
Unexecuted instantiation: _ZN5doris9OperatorXINS_23TableFunctionLocalStateEEC2EPNS_10ObjectPoolEii
Unexecuted instantiation: _ZN5doris9OperatorXINS_18ExchangeLocalStateEEC2EPNS_10ObjectPoolEii
Unexecuted instantiation: _ZN5doris9OperatorXINS_16RepeatLocalStateEEC2EPNS_10ObjectPoolEii
Unexecuted instantiation: _ZN5doris9OperatorXINS_29NestedLoopJoinProbeLocalStateEEC2EPNS_10ObjectPoolEii
Unexecuted instantiation: _ZN5doris9OperatorXINS_23AssertNumRowsLocalStateEEC2EPNS_10ObjectPoolEii
Unexecuted instantiation: _ZN5doris9OperatorXINS_18EmptySetLocalStateEEC2EPNS_10ObjectPoolEii
Unexecuted instantiation: _ZN5doris9OperatorXINS_21UnionSourceLocalStateEEC2EPNS_10ObjectPoolEii
Unexecuted instantiation: _ZN5doris9OperatorXINS_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
1069
1070
#ifdef BE_TEST
1071
    OperatorX() = default;
1072
#endif
1073
1074
    ~OperatorX() override = default;
1075
1076
    Status setup_local_state(RuntimeState* state, LocalStateInfo& info) override;
1077
    using LocalState = LocalStateType;
1078
21.2M
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
1079
21.2M
        return state->get_local_state(operator_id())->template cast<LocalState>();
1080
21.2M
    }
_ZNK5doris9OperatorXINS_18FileScanLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
1078
17.7k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
1079
17.7k
        return state->get_local_state(operator_id())->template cast<LocalState>();
1080
17.7k
    }
_ZNK5doris9OperatorXINS_22RecCTESourceLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
1078
10.4k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
1079
10.4k
        return state->get_local_state(operator_id())->template cast<LocalState>();
1080
10.4k
    }
_ZNK5doris9OperatorXINS_21CacheSourceLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
1078
1.47k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
1079
1.47k
        return state->get_local_state(operator_id())->template cast<LocalState>();
1080
1.47k
    }
_ZNK5doris9OperatorXINS_29LocalExchangeSourceLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
1078
3.02M
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
1079
3.02M
        return state->get_local_state(operator_id())->template cast<LocalState>();
1080
3.02M
    }
_ZNK5doris9OperatorXINS_35MultiCastDataStreamSourceLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
1078
66.1k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
1079
66.1k
        return state->get_local_state(operator_id())->template cast<LocalState>();
1080
66.1k
    }
_ZNK5doris9OperatorXINS_18OlapScanLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
1078
3.33M
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
1079
3.33M
        return state->get_local_state(operator_id())->template cast<LocalState>();
1080
3.33M
    }
_ZNK5doris9OperatorXINS_21GroupCommitLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
1078
4.59M
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
1079
4.59M
        return state->get_local_state(operator_id())->template cast<LocalState>();
1080
4.59M
    }
_ZNK5doris9OperatorXINS_18JDBCScanLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
1078
12
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
1079
12
        return state->get_local_state(operator_id())->template cast<LocalState>();
1080
12
    }
Unexecuted instantiation: _ZNK5doris9OperatorXINS_16EsScanLocalStateEE15get_local_stateEPNS_12RuntimeStateE
_ZNK5doris9OperatorXINS_23HashJoinProbeLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
1078
818k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
1079
818k
        return state->get_local_state(operator_id())->template cast<LocalState>();
1080
818k
    }
_ZNK5doris9OperatorXINS_34PartitionedHashJoinProbeLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
1078
46
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
1079
46
        return state->get_local_state(operator_id())->template cast<LocalState>();
1080
46
    }
_ZNK5doris9OperatorXINS_29NestedLoopJoinProbeLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
1078
112k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
1079
112k
        return state->get_local_state(operator_id())->template cast<LocalState>();
1080
112k
    }
_ZNK5doris9OperatorXINS_21UnionSourceLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
1078
291k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
1079
291k
        return state->get_local_state(operator_id())->template cast<LocalState>();
1080
291k
    }
_ZNK5doris9OperatorXINS_29PartitionSortSourceLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
1078
2.44k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
1079
2.44k
        return state->get_local_state(operator_id())->template cast<LocalState>();
1080
2.44k
    }
_ZNK5doris9OperatorXINS_25MaterializationLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
1078
12.0k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
1079
12.0k
        return state->get_local_state(operator_id())->template cast<LocalState>();
1080
12.0k
    }
_ZNK5doris9OperatorXINS_19SetSourceLocalStateILb1EEEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
1078
7.25k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
1079
7.25k
        return state->get_local_state(operator_id())->template cast<LocalState>();
1080
7.25k
    }
_ZNK5doris9OperatorXINS_19SetSourceLocalStateILb0EEEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
1078
7.30k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
1079
7.30k
        return state->get_local_state(operator_id())->template cast<LocalState>();
1080
7.30k
    }
_ZNK5doris9OperatorXINS_18EmptySetLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
1078
3.04k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
1079
3.04k
        return state->get_local_state(operator_id())->template cast<LocalState>();
1080
3.04k
    }
_ZNK5doris9OperatorXINS_18MetaScanLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
1078
15.4k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
1079
15.4k
        return state->get_local_state(operator_id())->template cast<LocalState>();
1080
15.4k
    }
_ZNK5doris9OperatorXINS_16SelectLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
1078
20.0k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
1079
20.0k
        return state->get_local_state(operator_id())->template cast<LocalState>();
1080
20.0k
    }
_ZNK5doris9OperatorXINS_20RecCTEScanLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
1078
11.7k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
1079
11.7k
        return state->get_local_state(operator_id())->template cast<LocalState>();
1080
11.7k
    }
_ZNK5doris9OperatorXINS_23TableFunctionLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
1078
35.1k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
1079
35.1k
        return state->get_local_state(operator_id())->template cast<LocalState>();
1080
35.1k
    }
_ZNK5doris9OperatorXINS_18ExchangeLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
1078
2.00M
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
1079
2.00M
        return state->get_local_state(operator_id())->template cast<LocalState>();
1080
2.00M
    }
_ZNK5doris9OperatorXINS_30DistinctStreamingAggLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
1078
5.14M
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
1079
5.14M
        return state->get_local_state(operator_id())->template cast<LocalState>();
1080
5.14M
    }
_ZNK5doris9OperatorXINS_22StreamingAggLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
1078
152k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
1079
152k
        return state->get_local_state(operator_id())->template cast<LocalState>();
1080
152k
    }
_ZNK5doris9OperatorXINS_13AggLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
1078
366k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
1079
366k
        return state->get_local_state(operator_id())->template cast<LocalState>();
1080
366k
    }
_ZNK5doris9OperatorXINS_24PartitionedAggLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
1078
12.6k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
1079
12.6k
        return state->get_local_state(operator_id())->template cast<LocalState>();
1080
12.6k
    }
_ZNK5doris9OperatorXINS_14SortLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
1078
56.1k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
1079
56.1k
        return state->get_local_state(operator_id())->template cast<LocalState>();
1080
56.1k
    }
_ZNK5doris9OperatorXINS_19SpillSortLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
1078
510
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
1079
510
        return state->get_local_state(operator_id())->template cast<LocalState>();
1080
510
    }
_ZNK5doris9OperatorXINS_24LocalMergeSortLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
1078
993k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
1079
993k
        return state->get_local_state(operator_id())->template cast<LocalState>();
1080
993k
    }
_ZNK5doris9OperatorXINS_18AnalyticLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
1078
42.7k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
1079
42.7k
        return state->get_local_state(operator_id())->template cast<LocalState>();
1080
42.7k
    }
_ZNK5doris9OperatorXINS_16RepeatLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
1078
13.5k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
1079
13.5k
        return state->get_local_state(operator_id())->template cast<LocalState>();
1080
13.5k
    }
_ZNK5doris9OperatorXINS_23AssertNumRowsLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
1078
85
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
1079
85
        return state->get_local_state(operator_id())->template cast<LocalState>();
1080
85
    }
_ZNK5doris9OperatorXINS_17DataGenLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
1078
40.4k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
1079
40.4k
        return state->get_local_state(operator_id())->template cast<LocalState>();
1080
40.4k
    }
_ZNK5doris9OperatorXINS_20SchemaScanLocalStateEE15get_local_stateEPNS_12RuntimeStateE
Line
Count
Source
1078
8.97k
    [[nodiscard]] LocalState& get_local_state(RuntimeState* state) const {
1079
8.97k
        return state->get_local_state(operator_id())->template cast<LocalState>();
1080
8.97k
    }
1081
1082
3.04M
    size_t get_reserve_mem_size(RuntimeState* state) override {
1083
3.04M
        auto& local_state = get_local_state(state);
1084
3.04M
        auto estimated_size = local_state.estimate_memory_usage();
1085
3.04M
        if (estimated_size < state->minimum_operator_memory_required_bytes()) {
1086
3.04M
            estimated_size = state->minimum_operator_memory_required_bytes();
1087
3.04M
        }
1088
3.04M
        if (!is_source() && _child) {
1089
844k
            auto child_reserve_size = _child->get_reserve_mem_size(state);
1090
844k
            estimated_size +=
1091
844k
                    std::max(state->minimum_operator_memory_required_bytes(), child_reserve_size);
1092
844k
        }
1093
3.04M
        return estimated_size;
1094
3.04M
    }
Unexecuted instantiation: _ZN5doris9OperatorXINS_18FileScanLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
_ZN5doris9OperatorXINS_22RecCTESourceLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1082
2.85k
    size_t get_reserve_mem_size(RuntimeState* state) override {
1083
2.85k
        auto& local_state = get_local_state(state);
1084
2.85k
        auto estimated_size = local_state.estimate_memory_usage();
1085
2.85k
        if (estimated_size < state->minimum_operator_memory_required_bytes()) {
1086
2.85k
            estimated_size = state->minimum_operator_memory_required_bytes();
1087
2.85k
        }
1088
2.85k
        if (!is_source() && _child) {
1089
0
            auto child_reserve_size = _child->get_reserve_mem_size(state);
1090
0
            estimated_size +=
1091
0
                    std::max(state->minimum_operator_memory_required_bytes(), child_reserve_size);
1092
0
        }
1093
2.85k
        return estimated_size;
1094
2.85k
    }
_ZN5doris9OperatorXINS_21CacheSourceLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1082
387
    size_t get_reserve_mem_size(RuntimeState* state) override {
1083
387
        auto& local_state = get_local_state(state);
1084
387
        auto estimated_size = local_state.estimate_memory_usage();
1085
387
        if (estimated_size < state->minimum_operator_memory_required_bytes()) {
1086
387
            estimated_size = state->minimum_operator_memory_required_bytes();
1087
387
        }
1088
387
        if (!is_source() && _child) {
1089
0
            auto child_reserve_size = _child->get_reserve_mem_size(state);
1090
0
            estimated_size +=
1091
0
                    std::max(state->minimum_operator_memory_required_bytes(), child_reserve_size);
1092
0
        }
1093
387
        return estimated_size;
1094
387
    }
_ZN5doris9OperatorXINS_29LocalExchangeSourceLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1082
1.01M
    size_t get_reserve_mem_size(RuntimeState* state) override {
1083
1.01M
        auto& local_state = get_local_state(state);
1084
1.01M
        auto estimated_size = local_state.estimate_memory_usage();
1085
1.01M
        if (estimated_size < state->minimum_operator_memory_required_bytes()) {
1086
1.01M
            estimated_size = state->minimum_operator_memory_required_bytes();
1087
1.01M
        }
1088
1.01M
        if (!is_source() && _child) {
1089
0
            auto child_reserve_size = _child->get_reserve_mem_size(state);
1090
0
            estimated_size +=
1091
0
                    std::max(state->minimum_operator_memory_required_bytes(), child_reserve_size);
1092
0
        }
1093
1.01M
        return estimated_size;
1094
1.01M
    }
_ZN5doris9OperatorXINS_35MultiCastDataStreamSourceLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1082
22.0k
    size_t get_reserve_mem_size(RuntimeState* state) override {
1083
22.0k
        auto& local_state = get_local_state(state);
1084
22.0k
        auto estimated_size = local_state.estimate_memory_usage();
1085
22.1k
        if (estimated_size < state->minimum_operator_memory_required_bytes()) {
1086
22.1k
            estimated_size = state->minimum_operator_memory_required_bytes();
1087
22.1k
        }
1088
22.0k
        if (!is_source() && _child) {
1089
0
            auto child_reserve_size = _child->get_reserve_mem_size(state);
1090
0
            estimated_size +=
1091
0
                    std::max(state->minimum_operator_memory_required_bytes(), child_reserve_size);
1092
0
        }
1093
22.0k
        return estimated_size;
1094
22.0k
    }
_ZN5doris9OperatorXINS_23HashJoinProbeLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1082
188k
    size_t get_reserve_mem_size(RuntimeState* state) override {
1083
188k
        auto& local_state = get_local_state(state);
1084
188k
        auto estimated_size = local_state.estimate_memory_usage();
1085
188k
        if (estimated_size < state->minimum_operator_memory_required_bytes()) {
1086
188k
            estimated_size = state->minimum_operator_memory_required_bytes();
1087
188k
        }
1088
188k
        if (!is_source() && _child) {
1089
188k
            auto child_reserve_size = _child->get_reserve_mem_size(state);
1090
188k
            estimated_size +=
1091
188k
                    std::max(state->minimum_operator_memory_required_bytes(), child_reserve_size);
1092
188k
        }
1093
188k
        return estimated_size;
1094
188k
    }
_ZN5doris9OperatorXINS_34PartitionedHashJoinProbeLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1082
2
    size_t get_reserve_mem_size(RuntimeState* state) override {
1083
2
        auto& local_state = get_local_state(state);
1084
2
        auto estimated_size = local_state.estimate_memory_usage();
1085
2
        if (estimated_size < state->minimum_operator_memory_required_bytes()) {
1086
2
            estimated_size = state->minimum_operator_memory_required_bytes();
1087
2
        }
1088
2
        if (!is_source() && _child) {
1089
2
            auto child_reserve_size = _child->get_reserve_mem_size(state);
1090
2
            estimated_size +=
1091
2
                    std::max(state->minimum_operator_memory_required_bytes(), child_reserve_size);
1092
2
        }
1093
2
        return estimated_size;
1094
2
    }
_ZN5doris9OperatorXINS_29NestedLoopJoinProbeLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1082
27.1k
    size_t get_reserve_mem_size(RuntimeState* state) override {
1083
27.1k
        auto& local_state = get_local_state(state);
1084
27.1k
        auto estimated_size = local_state.estimate_memory_usage();
1085
27.1k
        if (estimated_size < state->minimum_operator_memory_required_bytes()) {
1086
27.1k
            estimated_size = state->minimum_operator_memory_required_bytes();
1087
27.1k
        }
1088
27.1k
        if (!is_source() && _child) {
1089
27.1k
            auto child_reserve_size = _child->get_reserve_mem_size(state);
1090
27.1k
            estimated_size +=
1091
27.1k
                    std::max(state->minimum_operator_memory_required_bytes(), child_reserve_size);
1092
27.1k
        }
1093
27.1k
        return estimated_size;
1094
27.1k
    }
_ZN5doris9OperatorXINS_21UnionSourceLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1082
61.4k
    size_t get_reserve_mem_size(RuntimeState* state) override {
1083
61.4k
        auto& local_state = get_local_state(state);
1084
61.4k
        auto estimated_size = local_state.estimate_memory_usage();
1085
61.4k
        if (estimated_size < state->minimum_operator_memory_required_bytes()) {
1086
61.3k
            estimated_size = state->minimum_operator_memory_required_bytes();
1087
61.3k
        }
1088
61.4k
        if (!is_source() && _child) {
1089
0
            auto child_reserve_size = _child->get_reserve_mem_size(state);
1090
0
            estimated_size +=
1091
0
                    std::max(state->minimum_operator_memory_required_bytes(), child_reserve_size);
1092
0
        }
1093
61.4k
        return estimated_size;
1094
61.4k
    }
_ZN5doris9OperatorXINS_29PartitionSortSourceLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1082
684
    size_t get_reserve_mem_size(RuntimeState* state) override {
1083
684
        auto& local_state = get_local_state(state);
1084
684
        auto estimated_size = local_state.estimate_memory_usage();
1085
684
        if (estimated_size < state->minimum_operator_memory_required_bytes()) {
1086
684
            estimated_size = state->minimum_operator_memory_required_bytes();
1087
684
        }
1088
684
        if (!is_source() && _child) {
1089
0
            auto child_reserve_size = _child->get_reserve_mem_size(state);
1090
0
            estimated_size +=
1091
0
                    std::max(state->minimum_operator_memory_required_bytes(), child_reserve_size);
1092
0
        }
1093
684
        return estimated_size;
1094
684
    }
_ZN5doris9OperatorXINS_25MaterializationLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1082
1.61k
    size_t get_reserve_mem_size(RuntimeState* state) override {
1083
1.61k
        auto& local_state = get_local_state(state);
1084
1.61k
        auto estimated_size = local_state.estimate_memory_usage();
1085
1.61k
        if (estimated_size < state->minimum_operator_memory_required_bytes()) {
1086
1.61k
            estimated_size = state->minimum_operator_memory_required_bytes();
1087
1.61k
        }
1088
1.61k
        if (!is_source() && _child) {
1089
1.61k
            auto child_reserve_size = _child->get_reserve_mem_size(state);
1090
1.61k
            estimated_size +=
1091
1.61k
                    std::max(state->minimum_operator_memory_required_bytes(), child_reserve_size);
1092
1.61k
        }
1093
1.61k
        return estimated_size;
1094
1.61k
    }
_ZN5doris9OperatorXINS_19SetSourceLocalStateILb1EEEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1082
2.41k
    size_t get_reserve_mem_size(RuntimeState* state) override {
1083
2.41k
        auto& local_state = get_local_state(state);
1084
2.41k
        auto estimated_size = local_state.estimate_memory_usage();
1085
2.41k
        if (estimated_size < state->minimum_operator_memory_required_bytes()) {
1086
2.41k
            estimated_size = state->minimum_operator_memory_required_bytes();
1087
2.41k
        }
1088
2.41k
        if (!is_source() && _child) {
1089
0
            auto child_reserve_size = _child->get_reserve_mem_size(state);
1090
0
            estimated_size +=
1091
0
                    std::max(state->minimum_operator_memory_required_bytes(), child_reserve_size);
1092
0
        }
1093
2.41k
        return estimated_size;
1094
2.41k
    }
_ZN5doris9OperatorXINS_19SetSourceLocalStateILb0EEEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1082
2.43k
    size_t get_reserve_mem_size(RuntimeState* state) override {
1083
2.43k
        auto& local_state = get_local_state(state);
1084
2.43k
        auto estimated_size = local_state.estimate_memory_usage();
1085
2.43k
        if (estimated_size < state->minimum_operator_memory_required_bytes()) {
1086
2.43k
            estimated_size = state->minimum_operator_memory_required_bytes();
1087
2.43k
        }
1088
2.43k
        if (!is_source() && _child) {
1089
0
            auto child_reserve_size = _child->get_reserve_mem_size(state);
1090
0
            estimated_size +=
1091
0
                    std::max(state->minimum_operator_memory_required_bytes(), child_reserve_size);
1092
0
        }
1093
2.43k
        return estimated_size;
1094
2.43k
    }
_ZN5doris9OperatorXINS_18EmptySetLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1082
1.52k
    size_t get_reserve_mem_size(RuntimeState* state) override {
1083
1.52k
        auto& local_state = get_local_state(state);
1084
1.52k
        auto estimated_size = local_state.estimate_memory_usage();
1085
1.52k
        if (estimated_size < state->minimum_operator_memory_required_bytes()) {
1086
1.52k
            estimated_size = state->minimum_operator_memory_required_bytes();
1087
1.52k
        }
1088
1.52k
        if (!is_source() && _child) {
1089
0
            auto child_reserve_size = _child->get_reserve_mem_size(state);
1090
0
            estimated_size +=
1091
0
                    std::max(state->minimum_operator_memory_required_bytes(), child_reserve_size);
1092
0
        }
1093
1.52k
        return estimated_size;
1094
1.52k
    }
_ZN5doris9OperatorXINS_16SelectLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1082
6.70k
    size_t get_reserve_mem_size(RuntimeState* state) override {
1083
6.70k
        auto& local_state = get_local_state(state);
1084
6.70k
        auto estimated_size = local_state.estimate_memory_usage();
1085
6.70k
        if (estimated_size < state->minimum_operator_memory_required_bytes()) {
1086
6.70k
            estimated_size = state->minimum_operator_memory_required_bytes();
1087
6.70k
        }
1088
6.70k
        if (!is_source() && _child) {
1089
6.69k
            auto child_reserve_size = _child->get_reserve_mem_size(state);
1090
6.69k
            estimated_size +=
1091
6.69k
                    std::max(state->minimum_operator_memory_required_bytes(), child_reserve_size);
1092
6.69k
        }
1093
6.70k
        return estimated_size;
1094
6.70k
    }
_ZN5doris9OperatorXINS_20RecCTEScanLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1082
3.90k
    size_t get_reserve_mem_size(RuntimeState* state) override {
1083
3.90k
        auto& local_state = get_local_state(state);
1084
3.90k
        auto estimated_size = local_state.estimate_memory_usage();
1085
3.90k
        if (estimated_size < state->minimum_operator_memory_required_bytes()) {
1086
3.90k
            estimated_size = state->minimum_operator_memory_required_bytes();
1087
3.90k
        }
1088
3.90k
        if (!is_source() && _child) {
1089
0
            auto child_reserve_size = _child->get_reserve_mem_size(state);
1090
0
            estimated_size +=
1091
0
                    std::max(state->minimum_operator_memory_required_bytes(), child_reserve_size);
1092
0
        }
1093
3.90k
        return estimated_size;
1094
3.90k
    }
Unexecuted instantiation: _ZN5doris9OperatorXINS_18OlapScanLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris9OperatorXINS_21GroupCommitLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris9OperatorXINS_18JDBCScanLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris9OperatorXINS_16EsScanLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
_ZN5doris9OperatorXINS_18ExchangeLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1082
670k
    size_t get_reserve_mem_size(RuntimeState* state) override {
1083
670k
        auto& local_state = get_local_state(state);
1084
670k
        auto estimated_size = local_state.estimate_memory_usage();
1085
670k
        if (estimated_size < state->minimum_operator_memory_required_bytes()) {
1086
670k
            estimated_size = state->minimum_operator_memory_required_bytes();
1087
670k
        }
1088
670k
        if (!is_source() && _child) {
1089
0
            auto child_reserve_size = _child->get_reserve_mem_size(state);
1090
0
            estimated_size +=
1091
0
                    std::max(state->minimum_operator_memory_required_bytes(), child_reserve_size);
1092
0
        }
1093
670k
        return estimated_size;
1094
670k
    }
_ZN5doris9OperatorXINS_30DistinctStreamingAggLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1082
589k
    size_t get_reserve_mem_size(RuntimeState* state) override {
1083
589k
        auto& local_state = get_local_state(state);
1084
589k
        auto estimated_size = local_state.estimate_memory_usage();
1085
590k
        if (estimated_size < state->minimum_operator_memory_required_bytes()) {
1086
590k
            estimated_size = state->minimum_operator_memory_required_bytes();
1087
590k
        }
1088
589k
        if (!is_source() && _child) {
1089
589k
            auto child_reserve_size = _child->get_reserve_mem_size(state);
1090
589k
            estimated_size +=
1091
589k
                    std::max(state->minimum_operator_memory_required_bytes(), child_reserve_size);
1092
589k
        }
1093
589k
        return estimated_size;
1094
589k
    }
_ZN5doris9OperatorXINS_22StreamingAggLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1082
20.2k
    size_t get_reserve_mem_size(RuntimeState* state) override {
1083
20.2k
        auto& local_state = get_local_state(state);
1084
20.2k
        auto estimated_size = local_state.estimate_memory_usage();
1085
20.2k
        if (estimated_size < state->minimum_operator_memory_required_bytes()) {
1086
19.8k
            estimated_size = state->minimum_operator_memory_required_bytes();
1087
19.8k
        }
1088
20.2k
        if (!is_source() && _child) {
1089
20.2k
            auto child_reserve_size = _child->get_reserve_mem_size(state);
1090
20.2k
            estimated_size +=
1091
20.2k
                    std::max(state->minimum_operator_memory_required_bytes(), child_reserve_size);
1092
20.2k
        }
1093
20.2k
        return estimated_size;
1094
20.2k
    }
_ZN5doris9OperatorXINS_13AggLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1082
119k
    size_t get_reserve_mem_size(RuntimeState* state) override {
1083
119k
        auto& local_state = get_local_state(state);
1084
119k
        auto estimated_size = local_state.estimate_memory_usage();
1085
119k
        if (estimated_size < state->minimum_operator_memory_required_bytes()) {
1086
119k
            estimated_size = state->minimum_operator_memory_required_bytes();
1087
119k
        }
1088
119k
        if (!is_source() && _child) {
1089
0
            auto child_reserve_size = _child->get_reserve_mem_size(state);
1090
0
            estimated_size +=
1091
0
                    std::max(state->minimum_operator_memory_required_bytes(), child_reserve_size);
1092
0
        }
1093
119k
        return estimated_size;
1094
119k
    }
_ZN5doris9OperatorXINS_24PartitionedAggLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1082
4.19k
    size_t get_reserve_mem_size(RuntimeState* state) override {
1083
4.19k
        auto& local_state = get_local_state(state);
1084
4.19k
        auto estimated_size = local_state.estimate_memory_usage();
1085
4.19k
        if (estimated_size < state->minimum_operator_memory_required_bytes()) {
1086
4.19k
            estimated_size = state->minimum_operator_memory_required_bytes();
1087
4.19k
        }
1088
4.19k
        if (!is_source() && _child) {
1089
0
            auto child_reserve_size = _child->get_reserve_mem_size(state);
1090
0
            estimated_size +=
1091
0
                    std::max(state->minimum_operator_memory_required_bytes(), child_reserve_size);
1092
0
        }
1093
4.19k
        return estimated_size;
1094
4.19k
    }
_ZN5doris9OperatorXINS_14SortLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1082
18.7k
    size_t get_reserve_mem_size(RuntimeState* state) override {
1083
18.7k
        auto& local_state = get_local_state(state);
1084
18.7k
        auto estimated_size = local_state.estimate_memory_usage();
1085
18.7k
        if (estimated_size < state->minimum_operator_memory_required_bytes()) {
1086
18.7k
            estimated_size = state->minimum_operator_memory_required_bytes();
1087
18.7k
        }
1088
18.7k
        if (!is_source() && _child) {
1089
0
            auto child_reserve_size = _child->get_reserve_mem_size(state);
1090
0
            estimated_size +=
1091
0
                    std::max(state->minimum_operator_memory_required_bytes(), child_reserve_size);
1092
0
        }
1093
18.7k
        return estimated_size;
1094
18.7k
    }
_ZN5doris9OperatorXINS_19SpillSortLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1082
165
    size_t get_reserve_mem_size(RuntimeState* state) override {
1083
165
        auto& local_state = get_local_state(state);
1084
165
        auto estimated_size = local_state.estimate_memory_usage();
1085
165
        if (estimated_size < state->minimum_operator_memory_required_bytes()) {
1086
165
            estimated_size = state->minimum_operator_memory_required_bytes();
1087
165
        }
1088
165
        if (!is_source() && _child) {
1089
0
            auto child_reserve_size = _child->get_reserve_mem_size(state);
1090
0
            estimated_size +=
1091
0
                    std::max(state->minimum_operator_memory_required_bytes(), child_reserve_size);
1092
0
        }
1093
165
        return estimated_size;
1094
165
    }
_ZN5doris9OperatorXINS_24LocalMergeSortLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1082
248k
    size_t get_reserve_mem_size(RuntimeState* state) override {
1083
248k
        auto& local_state = get_local_state(state);
1084
248k
        auto estimated_size = local_state.estimate_memory_usage();
1085
249k
        if (estimated_size < state->minimum_operator_memory_required_bytes()) {
1086
249k
            estimated_size = state->minimum_operator_memory_required_bytes();
1087
249k
        }
1088
248k
        if (!is_source() && _child) {
1089
0
            auto child_reserve_size = _child->get_reserve_mem_size(state);
1090
0
            estimated_size +=
1091
0
                    std::max(state->minimum_operator_memory_required_bytes(), child_reserve_size);
1092
0
        }
1093
248k
        return estimated_size;
1094
248k
    }
_ZN5doris9OperatorXINS_18AnalyticLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1082
14.2k
    size_t get_reserve_mem_size(RuntimeState* state) override {
1083
14.2k
        auto& local_state = get_local_state(state);
1084
14.2k
        auto estimated_size = local_state.estimate_memory_usage();
1085
14.2k
        if (estimated_size < state->minimum_operator_memory_required_bytes()) {
1086
14.2k
            estimated_size = state->minimum_operator_memory_required_bytes();
1087
14.2k
        }
1088
14.2k
        if (!is_source() && _child) {
1089
0
            auto child_reserve_size = _child->get_reserve_mem_size(state);
1090
0
            estimated_size +=
1091
0
                    std::max(state->minimum_operator_memory_required_bytes(), child_reserve_size);
1092
0
        }
1093
14.2k
        return estimated_size;
1094
14.2k
    }
_ZN5doris9OperatorXINS_16RepeatLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1082
3.07k
    size_t get_reserve_mem_size(RuntimeState* state) override {
1083
3.07k
        auto& local_state = get_local_state(state);
1084
3.07k
        auto estimated_size = local_state.estimate_memory_usage();
1085
3.08k
        if (estimated_size < state->minimum_operator_memory_required_bytes()) {
1086
3.08k
            estimated_size = state->minimum_operator_memory_required_bytes();
1087
3.08k
        }
1088
3.08k
        if (!is_source() && _child) {
1089
3.08k
            auto child_reserve_size = _child->get_reserve_mem_size(state);
1090
3.08k
            estimated_size +=
1091
3.08k
                    std::max(state->minimum_operator_memory_required_bytes(), child_reserve_size);
1092
3.08k
        }
1093
3.07k
        return estimated_size;
1094
3.07k
    }
_ZN5doris9OperatorXINS_23TableFunctionLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1082
7.30k
    size_t get_reserve_mem_size(RuntimeState* state) override {
1083
7.30k
        auto& local_state = get_local_state(state);
1084
7.30k
        auto estimated_size = local_state.estimate_memory_usage();
1085
7.30k
        if (estimated_size < state->minimum_operator_memory_required_bytes()) {
1086
7.30k
            estimated_size = state->minimum_operator_memory_required_bytes();
1087
7.30k
        }
1088
7.30k
        if (!is_source() && _child) {
1089
7.30k
            auto child_reserve_size = _child->get_reserve_mem_size(state);
1090
7.30k
            estimated_size +=
1091
7.30k
                    std::max(state->minimum_operator_memory_required_bytes(), child_reserve_size);
1092
7.30k
        }
1093
7.30k
        return estimated_size;
1094
7.30k
    }
_ZN5doris9OperatorXINS_23AssertNumRowsLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1082
27
    size_t get_reserve_mem_size(RuntimeState* state) override {
1083
27
        auto& local_state = get_local_state(state);
1084
27
        auto estimated_size = local_state.estimate_memory_usage();
1085
27
        if (estimated_size < state->minimum_operator_memory_required_bytes()) {
1086
27
            estimated_size = state->minimum_operator_memory_required_bytes();
1087
27
        }
1088
27
        if (!is_source() && _child) {
1089
27
            auto child_reserve_size = _child->get_reserve_mem_size(state);
1090
27
            estimated_size +=
1091
27
                    std::max(state->minimum_operator_memory_required_bytes(), child_reserve_size);
1092
27
        }
1093
27
        return estimated_size;
1094
27
    }
_ZN5doris9OperatorXINS_17DataGenLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1082
13.4k
    size_t get_reserve_mem_size(RuntimeState* state) override {
1083
13.4k
        auto& local_state = get_local_state(state);
1084
13.4k
        auto estimated_size = local_state.estimate_memory_usage();
1085
13.4k
        if (estimated_size < state->minimum_operator_memory_required_bytes()) {
1086
13.4k
            estimated_size = state->minimum_operator_memory_required_bytes();
1087
13.4k
        }
1088
13.4k
        if (!is_source() && _child) {
1089
0
            auto child_reserve_size = _child->get_reserve_mem_size(state);
1090
0
            estimated_size +=
1091
0
                    std::max(state->minimum_operator_memory_required_bytes(), child_reserve_size);
1092
0
        }
1093
13.4k
        return estimated_size;
1094
13.4k
    }
_ZN5doris9OperatorXINS_20SchemaScanLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1082
2.99k
    size_t get_reserve_mem_size(RuntimeState* state) override {
1083
2.99k
        auto& local_state = get_local_state(state);
1084
2.99k
        auto estimated_size = local_state.estimate_memory_usage();
1085
2.99k
        if (estimated_size < state->minimum_operator_memory_required_bytes()) {
1086
2.99k
            estimated_size = state->minimum_operator_memory_required_bytes();
1087
2.99k
        }
1088
2.99k
        if (!is_source() && _child) {
1089
0
            auto child_reserve_size = _child->get_reserve_mem_size(state);
1090
0
            estimated_size +=
1091
0
                    std::max(state->minimum_operator_memory_required_bytes(), child_reserve_size);
1092
0
        }
1093
2.99k
        return estimated_size;
1094
2.99k
    }
Unexecuted instantiation: _ZN5doris9OperatorXINS_18MetaScanLocalStateEE20get_reserve_mem_sizeEPNS_12RuntimeStateE
1095
1096
5.72M
    void reset_reserve_mem_size(RuntimeState* state) override {
1097
5.72M
        auto& local_state = get_local_state(state);
1098
5.72M
        local_state.reset_estimate_memory_usage();
1099
1100
5.72M
        if (!is_source() && _child) {
1101
844k
            _child->reset_reserve_mem_size(state);
1102
844k
        }
1103
5.72M
    }
_ZN5doris9OperatorXINS_18FileScanLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1096
5.91k
    void reset_reserve_mem_size(RuntimeState* state) override {
1097
5.91k
        auto& local_state = get_local_state(state);
1098
5.91k
        local_state.reset_estimate_memory_usage();
1099
1100
5.91k
        if (!is_source() && _child) {
1101
0
            _child->reset_reserve_mem_size(state);
1102
0
        }
1103
5.91k
    }
_ZN5doris9OperatorXINS_22RecCTESourceLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1096
2.85k
    void reset_reserve_mem_size(RuntimeState* state) override {
1097
2.85k
        auto& local_state = get_local_state(state);
1098
2.85k
        local_state.reset_estimate_memory_usage();
1099
1100
2.85k
        if (!is_source() && _child) {
1101
0
            _child->reset_reserve_mem_size(state);
1102
0
        }
1103
2.85k
    }
_ZN5doris9OperatorXINS_21CacheSourceLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1096
387
    void reset_reserve_mem_size(RuntimeState* state) override {
1097
387
        auto& local_state = get_local_state(state);
1098
387
        local_state.reset_estimate_memory_usage();
1099
1100
387
        if (!is_source() && _child) {
1101
0
            _child->reset_reserve_mem_size(state);
1102
0
        }
1103
387
    }
_ZN5doris9OperatorXINS_29LocalExchangeSourceLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1096
1.01M
    void reset_reserve_mem_size(RuntimeState* state) override {
1097
1.01M
        auto& local_state = get_local_state(state);
1098
1.01M
        local_state.reset_estimate_memory_usage();
1099
1100
1.01M
        if (!is_source() && _child) {
1101
0
            _child->reset_reserve_mem_size(state);
1102
0
        }
1103
1.01M
    }
_ZN5doris9OperatorXINS_35MultiCastDataStreamSourceLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1096
22.0k
    void reset_reserve_mem_size(RuntimeState* state) override {
1097
22.0k
        auto& local_state = get_local_state(state);
1098
22.0k
        local_state.reset_estimate_memory_usage();
1099
1100
22.0k
        if (!is_source() && _child) {
1101
0
            _child->reset_reserve_mem_size(state);
1102
0
        }
1103
22.0k
    }
_ZN5doris9OperatorXINS_18OlapScanLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1096
1.13M
    void reset_reserve_mem_size(RuntimeState* state) override {
1097
1.13M
        auto& local_state = get_local_state(state);
1098
1.13M
        local_state.reset_estimate_memory_usage();
1099
1100
1.13M
        if (!is_source() && _child) {
1101
0
            _child->reset_reserve_mem_size(state);
1102
0
        }
1103
1.13M
    }
_ZN5doris9OperatorXINS_21GroupCommitLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1096
1.53M
    void reset_reserve_mem_size(RuntimeState* state) override {
1097
1.53M
        auto& local_state = get_local_state(state);
1098
1.53M
        local_state.reset_estimate_memory_usage();
1099
1100
1.53M
        if (!is_source() && _child) {
1101
0
            _child->reset_reserve_mem_size(state);
1102
0
        }
1103
1.53M
    }
_ZN5doris9OperatorXINS_18JDBCScanLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1096
4
    void reset_reserve_mem_size(RuntimeState* state) override {
1097
4
        auto& local_state = get_local_state(state);
1098
4
        local_state.reset_estimate_memory_usage();
1099
1100
4
        if (!is_source() && _child) {
1101
0
            _child->reset_reserve_mem_size(state);
1102
0
        }
1103
4
    }
Unexecuted instantiation: _ZN5doris9OperatorXINS_16EsScanLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
_ZN5doris9OperatorXINS_23HashJoinProbeLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1096
188k
    void reset_reserve_mem_size(RuntimeState* state) override {
1097
188k
        auto& local_state = get_local_state(state);
1098
188k
        local_state.reset_estimate_memory_usage();
1099
1100
188k
        if (!is_source() && _child) {
1101
188k
            _child->reset_reserve_mem_size(state);
1102
188k
        }
1103
188k
    }
Unexecuted instantiation: _ZN5doris9OperatorXINS_34PartitionedHashJoinProbeLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
_ZN5doris9OperatorXINS_29NestedLoopJoinProbeLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1096
27.1k
    void reset_reserve_mem_size(RuntimeState* state) override {
1097
27.1k
        auto& local_state = get_local_state(state);
1098
27.1k
        local_state.reset_estimate_memory_usage();
1099
1100
27.1k
        if (!is_source() && _child) {
1101
27.1k
            _child->reset_reserve_mem_size(state);
1102
27.1k
        }
1103
27.1k
    }
_ZN5doris9OperatorXINS_21UnionSourceLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1096
61.3k
    void reset_reserve_mem_size(RuntimeState* state) override {
1097
61.3k
        auto& local_state = get_local_state(state);
1098
61.3k
        local_state.reset_estimate_memory_usage();
1099
1100
61.3k
        if (!is_source() && _child) {
1101
0
            _child->reset_reserve_mem_size(state);
1102
0
        }
1103
61.3k
    }
_ZN5doris9OperatorXINS_29PartitionSortSourceLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1096
684
    void reset_reserve_mem_size(RuntimeState* state) override {
1097
684
        auto& local_state = get_local_state(state);
1098
684
        local_state.reset_estimate_memory_usage();
1099
1100
684
        if (!is_source() && _child) {
1101
0
            _child->reset_reserve_mem_size(state);
1102
0
        }
1103
684
    }
_ZN5doris9OperatorXINS_25MaterializationLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1096
1.61k
    void reset_reserve_mem_size(RuntimeState* state) override {
1097
1.61k
        auto& local_state = get_local_state(state);
1098
1.61k
        local_state.reset_estimate_memory_usage();
1099
1100
1.61k
        if (!is_source() && _child) {
1101
1.61k
            _child->reset_reserve_mem_size(state);
1102
1.61k
        }
1103
1.61k
    }
_ZN5doris9OperatorXINS_19SetSourceLocalStateILb1EEEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1096
2.41k
    void reset_reserve_mem_size(RuntimeState* state) override {
1097
2.41k
        auto& local_state = get_local_state(state);
1098
2.41k
        local_state.reset_estimate_memory_usage();
1099
1100
2.41k
        if (!is_source() && _child) {
1101
0
            _child->reset_reserve_mem_size(state);
1102
0
        }
1103
2.41k
    }
_ZN5doris9OperatorXINS_19SetSourceLocalStateILb0EEEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1096
2.43k
    void reset_reserve_mem_size(RuntimeState* state) override {
1097
2.43k
        auto& local_state = get_local_state(state);
1098
2.43k
        local_state.reset_estimate_memory_usage();
1099
1100
2.43k
        if (!is_source() && _child) {
1101
0
            _child->reset_reserve_mem_size(state);
1102
0
        }
1103
2.43k
    }
_ZN5doris9OperatorXINS_18EmptySetLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1096
1.52k
    void reset_reserve_mem_size(RuntimeState* state) override {
1097
1.52k
        auto& local_state = get_local_state(state);
1098
1.52k
        local_state.reset_estimate_memory_usage();
1099
1100
1.52k
        if (!is_source() && _child) {
1101
0
            _child->reset_reserve_mem_size(state);
1102
0
        }
1103
1.52k
    }
_ZN5doris9OperatorXINS_18MetaScanLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1096
5.13k
    void reset_reserve_mem_size(RuntimeState* state) override {
1097
5.13k
        auto& local_state = get_local_state(state);
1098
5.13k
        local_state.reset_estimate_memory_usage();
1099
1100
5.13k
        if (!is_source() && _child) {
1101
0
            _child->reset_reserve_mem_size(state);
1102
0
        }
1103
5.13k
    }
_ZN5doris9OperatorXINS_16SelectLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1096
6.69k
    void reset_reserve_mem_size(RuntimeState* state) override {
1097
6.69k
        auto& local_state = get_local_state(state);
1098
6.69k
        local_state.reset_estimate_memory_usage();
1099
1100
6.69k
        if (!is_source() && _child) {
1101
6.69k
            _child->reset_reserve_mem_size(state);
1102
6.69k
        }
1103
6.69k
    }
_ZN5doris9OperatorXINS_20RecCTEScanLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1096
3.90k
    void reset_reserve_mem_size(RuntimeState* state) override {
1097
3.90k
        auto& local_state = get_local_state(state);
1098
3.90k
        local_state.reset_estimate_memory_usage();
1099
1100
3.90k
        if (!is_source() && _child) {
1101
0
            _child->reset_reserve_mem_size(state);
1102
0
        }
1103
3.90k
    }
_ZN5doris9OperatorXINS_18ExchangeLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1096
670k
    void reset_reserve_mem_size(RuntimeState* state) override {
1097
670k
        auto& local_state = get_local_state(state);
1098
670k
        local_state.reset_estimate_memory_usage();
1099
1100
670k
        if (!is_source() && _child) {
1101
0
            _child->reset_reserve_mem_size(state);
1102
0
        }
1103
670k
    }
_ZN5doris9OperatorXINS_30DistinctStreamingAggLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1096
589k
    void reset_reserve_mem_size(RuntimeState* state) override {
1097
589k
        auto& local_state = get_local_state(state);
1098
589k
        local_state.reset_estimate_memory_usage();
1099
1100
589k
        if (!is_source() && _child) {
1101
589k
            _child->reset_reserve_mem_size(state);
1102
589k
        }
1103
589k
    }
_ZN5doris9OperatorXINS_22StreamingAggLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1096
20.2k
    void reset_reserve_mem_size(RuntimeState* state) override {
1097
20.2k
        auto& local_state = get_local_state(state);
1098
20.2k
        local_state.reset_estimate_memory_usage();
1099
1100
20.2k
        if (!is_source() && _child) {
1101
20.2k
            _child->reset_reserve_mem_size(state);
1102
20.2k
        }
1103
20.2k
    }
_ZN5doris9OperatorXINS_13AggLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1096
119k
    void reset_reserve_mem_size(RuntimeState* state) override {
1097
119k
        auto& local_state = get_local_state(state);
1098
119k
        local_state.reset_estimate_memory_usage();
1099
1100
119k
        if (!is_source() && _child) {
1101
0
            _child->reset_reserve_mem_size(state);
1102
0
        }
1103
119k
    }
_ZN5doris9OperatorXINS_24PartitionedAggLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1096
4.19k
    void reset_reserve_mem_size(RuntimeState* state) override {
1097
4.19k
        auto& local_state = get_local_state(state);
1098
4.19k
        local_state.reset_estimate_memory_usage();
1099
1100
4.19k
        if (!is_source() && _child) {
1101
0
            _child->reset_reserve_mem_size(state);
1102
0
        }
1103
4.19k
    }
_ZN5doris9OperatorXINS_14SortLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1096
18.7k
    void reset_reserve_mem_size(RuntimeState* state) override {
1097
18.7k
        auto& local_state = get_local_state(state);
1098
18.7k
        local_state.reset_estimate_memory_usage();
1099
1100
18.7k
        if (!is_source() && _child) {
1101
0
            _child->reset_reserve_mem_size(state);
1102
0
        }
1103
18.7k
    }
_ZN5doris9OperatorXINS_19SpillSortLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1096
165
    void reset_reserve_mem_size(RuntimeState* state) override {
1097
165
        auto& local_state = get_local_state(state);
1098
165
        local_state.reset_estimate_memory_usage();
1099
1100
165
        if (!is_source() && _child) {
1101
0
            _child->reset_reserve_mem_size(state);
1102
0
        }
1103
165
    }
_ZN5doris9OperatorXINS_24LocalMergeSortLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1096
248k
    void reset_reserve_mem_size(RuntimeState* state) override {
1097
248k
        auto& local_state = get_local_state(state);
1098
248k
        local_state.reset_estimate_memory_usage();
1099
1100
248k
        if (!is_source() && _child) {
1101
0
            _child->reset_reserve_mem_size(state);
1102
0
        }
1103
248k
    }
_ZN5doris9OperatorXINS_18AnalyticLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1096
14.2k
    void reset_reserve_mem_size(RuntimeState* state) override {
1097
14.2k
        auto& local_state = get_local_state(state);
1098
14.2k
        local_state.reset_estimate_memory_usage();
1099
1100
14.2k
        if (!is_source() && _child) {
1101
0
            _child->reset_reserve_mem_size(state);
1102
0
        }
1103
14.2k
    }
_ZN5doris9OperatorXINS_16RepeatLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1096
3.07k
    void reset_reserve_mem_size(RuntimeState* state) override {
1097
3.07k
        auto& local_state = get_local_state(state);
1098
3.07k
        local_state.reset_estimate_memory_usage();
1099
1100
3.07k
        if (!is_source() && _child) {
1101
3.07k
            _child->reset_reserve_mem_size(state);
1102
3.07k
        }
1103
3.07k
    }
_ZN5doris9OperatorXINS_23TableFunctionLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1096
7.30k
    void reset_reserve_mem_size(RuntimeState* state) override {
1097
7.30k
        auto& local_state = get_local_state(state);
1098
7.30k
        local_state.reset_estimate_memory_usage();
1099
1100
7.30k
        if (!is_source() && _child) {
1101
7.29k
            _child->reset_reserve_mem_size(state);
1102
7.29k
        }
1103
7.30k
    }
_ZN5doris9OperatorXINS_23AssertNumRowsLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1096
27
    void reset_reserve_mem_size(RuntimeState* state) override {
1097
27
        auto& local_state = get_local_state(state);
1098
27
        local_state.reset_estimate_memory_usage();
1099
1100
27
        if (!is_source() && _child) {
1101
27
            _child->reset_reserve_mem_size(state);
1102
27
        }
1103
27
    }
_ZN5doris9OperatorXINS_17DataGenLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1096
13.4k
    void reset_reserve_mem_size(RuntimeState* state) override {
1097
13.4k
        auto& local_state = get_local_state(state);
1098
13.4k
        local_state.reset_estimate_memory_usage();
1099
1100
13.4k
        if (!is_source() && _child) {
1101
0
            _child->reset_reserve_mem_size(state);
1102
0
        }
1103
13.4k
    }
_ZN5doris9OperatorXINS_20SchemaScanLocalStateEE22reset_reserve_mem_sizeEPNS_12RuntimeStateE
Line
Count
Source
1096
2.99k
    void reset_reserve_mem_size(RuntimeState* state) override {
1097
2.99k
        auto& local_state = get_local_state(state);
1098
2.99k
        local_state.reset_estimate_memory_usage();
1099
1100
2.99k
        if (!is_source() && _child) {
1101
0
            _child->reset_reserve_mem_size(state);
1102
0
        }
1103
2.99k
    }
1104
};
1105
1106
/**
1107
 * StreamingOperatorX indicates operators which always processes block in streaming way (one-in-one-out).
1108
 */
1109
template <typename LocalStateType>
1110
class StreamingOperatorX : public OperatorX<LocalStateType> {
1111
public:
1112
    StreamingOperatorX(ObjectPool* pool, const TPlanNode& tnode, int operator_id,
1113
                       const DescriptorTbl& descs)
1114
765
            : OperatorX<LocalStateType>(pool, tnode, operator_id, descs) {}
_ZN5doris18StreamingOperatorXINS_16SelectLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1114
747
            : OperatorX<LocalStateType>(pool, tnode, operator_id, descs) {}
_ZN5doris18StreamingOperatorXINS_23AssertNumRowsLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1114
18
            : OperatorX<LocalStateType>(pool, tnode, operator_id, descs) {}
1115
1116
#ifdef BE_TEST
1117
    StreamingOperatorX() = default;
1118
#endif
1119
1120
    virtual ~StreamingOperatorX() = default;
1121
1122
    Status get_block(RuntimeState* state, Block* block, bool* eos) override;
1123
1124
    virtual Status pull(RuntimeState* state, Block* block, bool* eos) = 0;
1125
};
1126
1127
/**
1128
 * StatefulOperatorX indicates the operators with some states inside.
1129
 *
1130
 * Specifically, we called an operator stateful if an operator can determine its output by itself.
1131
 * 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).
1132
 * If there are still remain rows in probe block, we can get output block by calling `get_block` without any data from its child.
1133
 * In a nutshell, it is a one-to-many relation between input blocks and output blocks for StatefulOperator.
1134
 */
1135
template <typename LocalStateType>
1136
class StatefulOperatorX : public OperatorX<LocalStateType> {
1137
public:
1138
    StatefulOperatorX(ObjectPool* pool, const TPlanNode& tnode, const int operator_id,
1139
                      const DescriptorTbl& descs)
1140
185k
            : OperatorX<LocalStateType>(pool, tnode, operator_id, descs) {}
_ZN5doris17StatefulOperatorXINS_25MaterializationLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1140
667
            : OperatorX<LocalStateType>(pool, tnode, operator_id, descs) {}
_ZN5doris17StatefulOperatorXINS_23HashJoinProbeLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1140
81.0k
            : OperatorX<LocalStateType>(pool, tnode, operator_id, descs) {}
_ZN5doris17StatefulOperatorXINS_34PartitionedHashJoinProbeLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1140
30
            : OperatorX<LocalStateType>(pool, tnode, operator_id, descs) {}
_ZN5doris17StatefulOperatorXINS_16RepeatLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1140
311
            : OperatorX<LocalStateType>(pool, tnode, operator_id, descs) {}
_ZN5doris17StatefulOperatorXINS_22StreamingAggLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1140
1.61k
            : OperatorX<LocalStateType>(pool, tnode, operator_id, descs) {}
_ZN5doris17StatefulOperatorXINS_30DistinctStreamingAggLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1140
98.9k
            : OperatorX<LocalStateType>(pool, tnode, operator_id, descs) {}
_ZN5doris17StatefulOperatorXINS_29NestedLoopJoinProbeLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1140
2.42k
            : OperatorX<LocalStateType>(pool, tnode, operator_id, descs) {}
_ZN5doris17StatefulOperatorXINS_23TableFunctionLocalStateEEC2EPNS_10ObjectPoolERKNS_9TPlanNodeEiRKNS_13DescriptorTblE
Line
Count
Source
1140
869
            : OperatorX<LocalStateType>(pool, tnode, operator_id, descs) {}
1141
#ifdef BE_TEST
1142
    StatefulOperatorX() = default;
1143
#endif
1144
    virtual ~StatefulOperatorX() = default;
1145
1146
    using OperatorX<LocalStateType>::get_local_state;
1147
1148
    [[nodiscard]] Status get_block(RuntimeState* state, Block* block, bool* eos) override;
1149
1150
    [[nodiscard]] virtual Status pull(RuntimeState* state, Block* block, bool* eos) const = 0;
1151
    [[nodiscard]] virtual Status push(RuntimeState* state, Block* input_block, bool eos) const = 0;
1152
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
1153
};
1154
1155
template <typename Writer, typename Parent>
1156
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
1157
class AsyncWriterSink : public PipelineXSinkLocalState<BasicSharedState> {
1158
public:
1159
    using Base = PipelineXSinkLocalState<BasicSharedState>;
1160
    AsyncWriterSink(DataSinkOperatorXBase* parent, RuntimeState* state)
1161
65.3k
            : Base(parent, state), _async_writer_dependency(nullptr) {
1162
65.3k
        _finish_dependency =
1163
65.3k
                std::make_shared<Dependency>(parent->operator_id(), parent->node_id(),
1164
65.3k
                                             parent->get_name() + "_FINISH_DEPENDENCY", true);
1165
65.3k
    }
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Line
Count
Source
1161
361
            : Base(parent, state), _async_writer_dependency(nullptr) {
1162
361
        _finish_dependency =
1163
361
                std::make_shared<Dependency>(parent->operator_id(), parent->node_id(),
1164
361
                                             parent->get_name() + "_FINISH_DEPENDENCY", true);
1165
361
    }
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Line
Count
Source
1161
64.9k
            : Base(parent, state), _async_writer_dependency(nullptr) {
1162
64.9k
        _finish_dependency =
1163
64.9k
                std::make_shared<Dependency>(parent->operator_id(), parent->node_id(),
1164
64.9k
                                             parent->get_name() + "_FINISH_DEPENDENCY", true);
1165
64.9k
    }
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Line
Count
Source
1161
22
            : Base(parent, state), _async_writer_dependency(nullptr) {
1162
22
        _finish_dependency =
1163
22
                std::make_shared<Dependency>(parent->operator_id(), parent->node_id(),
1164
22
                                             parent->get_name() + "_FINISH_DEPENDENCY", true);
1165
22
    }
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEEC2EPNS_21DataSinkOperatorXBaseEPNS_12RuntimeStateE
1166
1167
    Status init(RuntimeState* state, LocalSinkStateInfo& info) override;
1168
1169
    Status open(RuntimeState* state) override;
1170
1171
    Status sink(RuntimeState* state, Block* block, bool eos);
1172
1173
65.8k
    std::vector<Dependency*> dependencies() const override {
1174
65.8k
        return {_async_writer_dependency.get()};
1175
65.8k
    }
_ZNK5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE12dependenciesEv
Line
Count
Source
1173
22
    std::vector<Dependency*> dependencies() const override {
1174
22
        return {_async_writer_dependency.get()};
1175
22
    }
_ZNK5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE12dependenciesEv
Line
Count
Source
1173
65.4k
    std::vector<Dependency*> dependencies() const override {
1174
65.4k
        return {_async_writer_dependency.get()};
1175
65.4k
    }
Unexecuted instantiation: _ZNK5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE12dependenciesEv
Unexecuted instantiation: _ZNK5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE12dependenciesEv
Unexecuted instantiation: _ZNK5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE12dependenciesEv
Unexecuted instantiation: _ZNK5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE12dependenciesEv
Unexecuted instantiation: _ZNK5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE12dependenciesEv
_ZNK5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE12dependenciesEv
Line
Count
Source
1173
361
    std::vector<Dependency*> dependencies() const override {
1174
361
        return {_async_writer_dependency.get()};
1175
361
    }
Unexecuted instantiation: _ZNK5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE12dependenciesEv
1176
    Status close(RuntimeState* state, Status exec_status) override;
1177
1178
65.8k
    Dependency* finishdependency() override { return _finish_dependency.get(); }
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE16finishdependencyEv
Line
Count
Source
1178
22
    Dependency* finishdependency() override { return _finish_dependency.get(); }
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE16finishdependencyEv
Line
Count
Source
1178
65.4k
    Dependency* finishdependency() override { return _finish_dependency.get(); }
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE16finishdependencyEv
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE16finishdependencyEv
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE16finishdependencyEv
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE16finishdependencyEv
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE16finishdependencyEv
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE16finishdependencyEv
Line
Count
Source
1178
361
    Dependency* finishdependency() override { return _finish_dependency.get(); }
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE16finishdependencyEv
1179
1180
protected:
1181
    VExprContextSPtrs _output_vexpr_ctxs;
1182
    std::unique_ptr<Writer> _writer;
1183
1184
    std::shared_ptr<Dependency> _async_writer_dependency;
1185
    std::shared_ptr<Dependency> _finish_dependency;
1186
};
1187
1188
#ifdef BE_TEST
1189
class DummyOperatorLocalState final : public PipelineXLocalState<FakeSharedState> {
1190
public:
1191
    ENABLE_FACTORY_CREATOR(DummyOperatorLocalState);
1192
1193
    DummyOperatorLocalState(RuntimeState* state, OperatorXBase* parent)
1194
            : PipelineXLocalState<FakeSharedState>(state, parent) {
1195
        _tmp_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
1196
                                                    "DummyOperatorDependency", true);
1197
        _finish_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
1198
                                                       "DummyOperatorDependency", true);
1199
        _filter_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
1200
                                                       "DummyOperatorDependency", true);
1201
    }
1202
    Dependency* finishdependency() override { return _finish_dependency.get(); }
1203
    ~DummyOperatorLocalState() = default;
1204
1205
    std::vector<Dependency*> dependencies() const override { return {_tmp_dependency.get()}; }
1206
    std::vector<Dependency*> execution_dependencies() override {
1207
        return {_filter_dependency.get()};
1208
    }
1209
1210
private:
1211
    std::shared_ptr<Dependency> _tmp_dependency;
1212
    std::shared_ptr<Dependency> _finish_dependency;
1213
    std::shared_ptr<Dependency> _filter_dependency;
1214
};
1215
1216
class DummyOperator final : public OperatorX<DummyOperatorLocalState> {
1217
public:
1218
    DummyOperator() : OperatorX<DummyOperatorLocalState>(nullptr, 0, 0) {}
1219
1220
    [[nodiscard]] bool is_source() const override { return true; }
1221
1222
    Status get_block(RuntimeState* state, Block* block, bool* eos) override {
1223
        *eos = _eos;
1224
        return Status::OK();
1225
    }
1226
    void set_low_memory_mode(RuntimeState* state) override { _low_memory_mode = true; }
1227
    Status terminate(RuntimeState* state) override {
1228
        _terminated = true;
1229
        return Status::OK();
1230
    }
1231
    size_t revocable_mem_size(RuntimeState* state) const override { return _revocable_mem_size; }
1232
    size_t get_reserve_mem_size(RuntimeState* state) override {
1233
        return _disable_reserve_mem
1234
                       ? 0
1235
                       : OperatorX<DummyOperatorLocalState>::get_reserve_mem_size(state);
1236
    }
1237
1238
private:
1239
    friend class AssertNumRowsLocalState;
1240
    bool _eos = false;
1241
    bool _low_memory_mode = false;
1242
    bool _terminated = false;
1243
    size_t _revocable_mem_size = 0;
1244
    bool _disable_reserve_mem = false;
1245
};
1246
1247
class DummySinkLocalState final : public PipelineXSinkLocalState<BasicSharedState> {
1248
public:
1249
    using Base = PipelineXSinkLocalState<BasicSharedState>;
1250
    ENABLE_FACTORY_CREATOR(DummySinkLocalState);
1251
    DummySinkLocalState(DataSinkOperatorXBase* parent, RuntimeState* state) : Base(parent, state) {
1252
        _tmp_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
1253
                                                    "DummyOperatorDependency", true);
1254
        _finish_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
1255
                                                       "DummyOperatorDependency", true);
1256
    }
1257
1258
    std::vector<Dependency*> dependencies() const override { return {_tmp_dependency.get()}; }
1259
    Dependency* finishdependency() override { return _finish_dependency.get(); }
1260
    bool is_finished() const override { return _is_finished; }
1261
1262
private:
1263
    std::shared_ptr<Dependency> _tmp_dependency;
1264
    std::shared_ptr<Dependency> _finish_dependency;
1265
    std::atomic_bool _is_finished = false;
1266
};
1267
1268
class DummySinkOperatorX final : public DataSinkOperatorX<DummySinkLocalState> {
1269
public:
1270
    DummySinkOperatorX(int op_id, int node_id, int dest_id)
1271
            : DataSinkOperatorX<DummySinkLocalState>(op_id, node_id, dest_id) {}
1272
    Status sink(RuntimeState* state, Block* in_block, bool eos) override {
1273
        return _return_eof ? Status::Error<ErrorCode::END_OF_FILE>("source have closed")
1274
                           : Status::OK();
1275
    }
1276
    void set_low_memory_mode(RuntimeState* state) override { _low_memory_mode = true; }
1277
    Status terminate(RuntimeState* state) override {
1278
        _terminated = true;
1279
        return Status::OK();
1280
    }
1281
    size_t revocable_mem_size(RuntimeState* state) const override { return _revocable_mem_size; }
1282
    size_t get_reserve_mem_size(RuntimeState* state, bool eos) override {
1283
        return _disable_reserve_mem
1284
                       ? 0
1285
                       : DataSinkOperatorX<DummySinkLocalState>::get_reserve_mem_size(state, eos);
1286
    }
1287
1288
private:
1289
    bool _low_memory_mode = false;
1290
    bool _terminated = false;
1291
    std::atomic_bool _return_eof = false;
1292
    size_t _revocable_mem_size = 0;
1293
    bool _disable_reserve_mem = false;
1294
};
1295
#endif
1296
1297
#include "common/compile_check_end.h"
1298
} // namespace doris