Coverage Report

Created: 2026-03-22 14:59

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