Coverage Report

Created: 2026-05-08 13:07

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