Coverage Report

Created: 2026-09-30 08:53

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
be/src/exec/operator/operator.cpp
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
#include "exec/operator/operator.h"
19
20
#include <algorithm>
21
22
#include "common/status.h"
23
#include "exec/common/util.hpp"
24
#include "exec/exchange/local_exchange_sink_operator.h"
25
#include "exec/exchange/local_exchange_source_operator.h"
26
#include "exec/operator/aggregation_sink_operator.h"
27
#include "exec/operator/aggregation_source_operator.h"
28
#include "exec/operator/analytic_sink_operator.h"
29
#include "exec/operator/analytic_source_operator.h"
30
#include "exec/operator/assert_num_rows_operator.h"
31
#include "exec/operator/blackhole_sink_operator.h"
32
#include "exec/operator/bucketed_aggregation_sink_operator.h"
33
#include "exec/operator/bucketed_aggregation_source_operator.h"
34
#include "exec/operator/cache_sink_operator.h"
35
#include "exec/operator/cache_source_operator.h"
36
#include "exec/operator/datagen_operator.h"
37
#include "exec/operator/dict_sink_operator.h"
38
#include "exec/operator/distinct_streaming_aggregation_operator.h"
39
#include "exec/operator/empty_set_operator.h"
40
#include "exec/operator/exchange_sink_operator.h"
41
#include "exec/operator/exchange_source_operator.h"
42
#include "exec/operator/file_scan_operator.h"
43
#include "exec/operator/group_commit_block_sink_operator.h"
44
#include "exec/operator/group_commit_scan_operator.h"
45
#include "exec/operator/hashjoin_build_sink.h"
46
#include "exec/operator/hashjoin_probe_operator.h"
47
#include "exec/operator/hive_table_sink_operator.h"
48
#include "exec/operator/iceberg_delete_sink_operator.h"
49
#include "exec/operator/iceberg_merge_sink_operator.h"
50
#include "exec/operator/iceberg_table_sink_operator.h"
51
#include "exec/operator/jdbc_scan_operator.h"
52
#include "exec/operator/jdbc_table_sink_operator.h"
53
#include "exec/operator/local_merge_sort_source_operator.h"
54
#include "exec/operator/materialization_opertor.h"
55
#include "exec/operator/maxcompute_table_sink_operator.h"
56
#include "exec/operator/memory_scratch_sink_operator.h"
57
#include "exec/operator/meta_scan_operator.h"
58
#include "exec/operator/mock_operator.h"
59
#include "exec/operator/mock_scan_operator.h"
60
#include "exec/operator/multi_cast_data_stream_sink.h"
61
#include "exec/operator/multi_cast_data_stream_source.h"
62
#include "exec/operator/nested_loop_join_build_operator.h"
63
#include "exec/operator/nested_loop_join_probe_operator.h"
64
#include "exec/operator/olap_scan_operator.h"
65
#include "exec/operator/olap_table_sink_operator.h"
66
#include "exec/operator/olap_table_sink_v2_operator.h"
67
#include "exec/operator/paimon_table_sink_operator.h"
68
#include "exec/operator/partition_sort_sink_operator.h"
69
#include "exec/operator/partition_sort_source_operator.h"
70
#include "exec/operator/partitioned_aggregation_sink_operator.h"
71
#include "exec/operator/partitioned_aggregation_source_operator.h"
72
#include "exec/operator/partitioned_hash_join_probe_operator.h"
73
#include "exec/operator/partitioned_hash_join_sink_operator.h"
74
#include "exec/operator/rec_cte_anchor_sink_operator.h"
75
#include "exec/operator/rec_cte_scan_operator.h"
76
#include "exec/operator/rec_cte_sink_operator.h"
77
#include "exec/operator/rec_cte_source_operator.h"
78
#include "exec/operator/repeat_operator.h"
79
#include "exec/operator/result_file_sink_operator.h"
80
#include "exec/operator/result_sink_operator.h"
81
#include "exec/operator/schema_scan_operator.h"
82
#include "exec/operator/select_operator.h"
83
#include "exec/operator/set_probe_sink_operator.h"
84
#include "exec/operator/set_sink_operator.h"
85
#include "exec/operator/set_source_operator.h"
86
#include "exec/operator/sort_sink_operator.h"
87
#include "exec/operator/sort_source_operator.h"
88
#include "exec/operator/spill_iceberg_table_sink_operator.h"
89
#include "exec/operator/spill_sort_sink_operator.h"
90
#include "exec/operator/spill_sort_source_operator.h"
91
#include "exec/operator/streaming_aggregation_operator.h"
92
#include "exec/operator/table_function_operator.h"
93
#include "exec/operator/tvf_table_sink_operator.h"
94
#include "exec/operator/union_sink_operator.h"
95
#include "exec/operator/union_source_operator.h"
96
#include "exec/pipeline/dependency.h"
97
#include "exec/pipeline/pipeline.h"
98
#include "exprs/vexpr.h"
99
#include "exprs/vexpr_context.h"
100
#include "runtime/runtime_profile.h"
101
#include "runtime/runtime_profile_counter_names.h"
102
#include "util/debug_util.h"
103
#include "util/string_util.h"
104
105
namespace doris {
106
class RowDescriptor;
107
class RuntimeState;
108
} // namespace doris
109
110
namespace doris {
111
112
0
Status OperatorBase::close(RuntimeState* state) {
113
0
    if (_is_closed) {
114
0
        return Status::OK();
115
0
    }
116
0
    _is_closed = true;
117
0
    return Status::OK();
118
0
}
119
120
template <typename SharedStateArg>
121
26.6k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
122
26.6k
    if (_parent->nereids_id() == -1) {
123
1.50k
        return fmt::format("(id={})", _parent->node_id());
124
25.1k
    } else {
125
25.1k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
126
25.1k
    }
127
26.6k
}
_ZNK5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
121
24.0k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
122
24.0k
    if (_parent->nereids_id() == -1) {
123
0
        return fmt::format("(id={})", _parent->node_id());
124
24.0k
    } else {
125
24.0k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
126
24.0k
    }
127
24.0k
}
_ZNK5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
121
1
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
122
1
    if (_parent->nereids_id() == -1) {
123
1
        return fmt::format("(id={})", _parent->node_id());
124
1
    } else {
125
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
126
0
    }
127
1
}
_ZNK5doris19PipelineXLocalStateINS_15SortSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
121
137
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
122
137
    if (_parent->nereids_id() == -1) {
123
12
        return fmt::format("(id={})", _parent->node_id());
124
125
    } else {
125
125
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
126
125
    }
127
137
}
_ZNK5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
121
15
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
122
15
    if (_parent->nereids_id() == -1) {
123
0
        return fmt::format("(id={})", _parent->node_id());
124
15
    } else {
125
15
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
126
15
    }
127
15
}
_ZNK5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
121
192
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
122
192
    if (_parent->nereids_id() == -1) {
123
0
        return fmt::format("(id={})", _parent->node_id());
124
192
    } else {
125
192
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
126
192
    }
127
192
}
_ZNK5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
121
16
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
122
16
    if (_parent->nereids_id() == -1) {
123
16
        return fmt::format("(id={})", _parent->node_id());
124
16
    } else {
125
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
126
0
    }
127
16
}
_ZNK5doris19PipelineXLocalStateINS_14AggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
121
587
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
122
587
    if (_parent->nereids_id() == -1) {
123
29
        return fmt::format("(id={})", _parent->node_id());
124
558
    } else {
125
558
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
126
558
    }
127
587
}
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE11name_suffixB5cxx11Ev
_ZNK5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
121
88
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
122
88
    if (_parent->nereids_id() == -1) {
123
0
        return fmt::format("(id={})", _parent->node_id());
124
88
    } else {
125
88
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
126
88
    }
127
88
}
_ZNK5doris19PipelineXLocalStateINS_15FakeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
121
993
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
122
993
    if (_parent->nereids_id() == -1) {
123
880
        return fmt::format("(id={})", _parent->node_id());
124
880
    } else {
125
113
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
126
113
    }
127
993
}
_ZNK5doris19PipelineXLocalStateINS_16UnionSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
121
10
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
122
10
    if (_parent->nereids_id() == -1) {
123
2
        return fmt::format("(id={})", _parent->node_id());
124
8
    } else {
125
8
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
126
8
    }
127
10
}
_ZNK5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
121
12
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
122
12
    if (_parent->nereids_id() == -1) {
123
12
        return fmt::format("(id={})", _parent->node_id());
124
12
    } else {
125
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
126
0
    }
127
12
}
_ZNK5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
121
288
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
122
288
    if (_parent->nereids_id() == -1) {
123
288
        return fmt::format("(id={})", _parent->node_id());
124
288
    } else {
125
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
126
0
    }
127
288
}
_ZNK5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
121
102
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
122
102
    if (_parent->nereids_id() == -1) {
123
102
        return fmt::format("(id={})", _parent->node_id());
124
102
    } else {
125
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
126
0
    }
127
102
}
_ZNK5doris19PipelineXLocalStateINS_14SetSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
121
13
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
122
13
    if (_parent->nereids_id() == -1) {
123
13
        return fmt::format("(id={})", _parent->node_id());
124
13
    } else {
125
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
126
0
    }
127
13
}
_ZNK5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
121
150
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
122
150
    if (_parent->nereids_id() == -1) {
123
150
        return fmt::format("(id={})", _parent->node_id());
124
150
    } else {
125
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
126
0
    }
127
150
}
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_16BasicSharedStateEE11name_suffixB5cxx11Ev
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_17RecCTESharedStateEE11name_suffixB5cxx11Ev
128
129
template <typename SharedStateArg>
130
73.9k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
131
73.9k
    if (_parent->nereids_id() == -1) {
132
872
        return fmt::format("(id={})", _parent->node_id());
133
73.0k
    } else {
134
73.0k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
135
73.0k
    }
136
73.9k
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
130
72.0k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
131
72.0k
    if (_parent->nereids_id() == -1) {
132
0
        return fmt::format("(id={})", _parent->node_id());
133
72.0k
    } else {
134
72.0k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
135
72.0k
    }
136
72.0k
}
_ZN5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
130
2
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
131
2
    if (_parent->nereids_id() == -1) {
132
1
        return fmt::format("(id={})", _parent->node_id());
133
1
    } else {
134
1
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
135
1
    }
136
2
}
_ZN5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
130
141
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
131
141
    if (_parent->nereids_id() == -1) {
132
9
        return fmt::format("(id={})", _parent->node_id());
133
132
    } else {
134
132
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
135
132
    }
136
141
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
130
22
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
131
22
    if (_parent->nereids_id() == -1) {
132
0
        return fmt::format("(id={})", _parent->node_id());
133
22
    } else {
134
22
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
135
22
    }
136
22
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
130
193
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
131
193
    if (_parent->nereids_id() == -1) {
132
0
        return fmt::format("(id={})", _parent->node_id());
133
193
    } else {
134
193
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
135
193
    }
136
193
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
130
16
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
131
16
    if (_parent->nereids_id() == -1) {
132
16
        return fmt::format("(id={})", _parent->node_id());
133
16
    } else {
134
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
135
0
    }
136
16
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
130
597
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
131
597
    if (_parent->nereids_id() == -1) {
132
29
        return fmt::format("(id={})", _parent->node_id());
133
568
    } else {
134
568
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
135
568
    }
136
597
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE11name_suffixB5cxx11Ev
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
130
98
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
131
98
    if (_parent->nereids_id() == -1) {
132
0
        return fmt::format("(id={})", _parent->node_id());
133
98
    } else {
134
98
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
135
98
    }
136
98
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE11name_suffixB5cxx11Ev
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
130
3
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
131
3
    if (_parent->nereids_id() == -1) {
132
3
        return fmt::format("(id={})", _parent->node_id());
133
3
    } else {
134
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
135
0
    }
136
3
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
130
102
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
131
102
    if (_parent->nereids_id() == -1) {
132
102
        return fmt::format("(id={})", _parent->node_id());
133
102
    } else {
134
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
135
0
    }
136
102
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE11name_suffixB5cxx11Ev
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
130
29
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
131
29
    if (_parent->nereids_id() == -1) {
132
29
        return fmt::format("(id={})", _parent->node_id());
133
29
    } else {
134
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
135
0
    }
136
29
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
130
18
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
131
18
    if (_parent->nereids_id() == -1) {
132
18
        return fmt::format("(id={})", _parent->node_id());
133
18
    } else {
134
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
135
0
    }
136
18
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
130
656
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
131
656
    if (_parent->nereids_id() == -1) {
132
654
        return fmt::format("(id={})", _parent->node_id());
133
654
    } else {
134
2
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
135
2
    }
136
656
}
_ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
130
11
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
131
11
    if (_parent->nereids_id() == -1) {
132
11
        return fmt::format("(id={})", _parent->node_id());
133
11
    } else {
134
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
135
0
    }
136
11
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE11name_suffixB5cxx11Ev
137
138
template <typename SharedStateArg>
139
24.0k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
140
24.0k
    if (_terminated) {
141
0
        return Status::OK();
142
0
    }
143
24.0k
    _terminated = true;
144
24.0k
    return Status::OK();
145
24.0k
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
139
24.0k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
140
24.0k
    if (_terminated) {
141
0
        return Status::OK();
142
0
    }
143
24.0k
    _terminated = true;
144
24.0k
    return Status::OK();
145
24.0k
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
139
6
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
140
6
    if (_terminated) {
141
0
        return Status::OK();
142
0
    }
143
6
    _terminated = true;
144
6
    return Status::OK();
145
6
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
139
2
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
140
2
    if (_terminated) {
141
0
        return Status::OK();
142
0
    }
143
2
    _terminated = true;
144
2
    return Status::OK();
145
2
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
139
74
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
140
74
    if (_terminated) {
141
0
        return Status::OK();
142
0
    }
143
74
    _terminated = true;
144
74
    return Status::OK();
145
74
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE9terminateEPNS_12RuntimeStateE
146
147
2.63k
DataDistribution OperatorBase::required_data_distribution(RuntimeState* /*state*/) const {
148
2.63k
    return _child && _child->is_serial_operator() && !is_source()
149
2.63k
                   ? DataDistribution(TLocalPartitionType::PASSTHROUGH)
150
2.63k
                   : DataDistribution(TLocalPartitionType::NOOP);
151
2.63k
}
152
153
292
bool OperatorBase::child_breaks_local_key_distribution(RuntimeState* state) const {
154
292
    if (!_child) {
155
96
        return false;
156
96
    }
157
196
    if (_child->is_serial_operator()) {
158
64
        return true;
159
64
    }
160
132
    const auto child_distribution = _child->required_data_distribution(state);
161
132
    return child_distribution.need_local_exchange() &&
162
132
           !is_shuffled_exchange(child_distribution.distribution_type);
163
196
}
164
165
template <typename SharedStateArg>
166
16.7k
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
167
16.7k
    fmt::memory_buffer debug_string_buffer;
168
16.7k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
169
16.7k
    return fmt::to_string(debug_string_buffer);
170
16.7k
}
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE12debug_stringB5cxx11Ei
_ZNK5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
166
3
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
167
3
    fmt::memory_buffer debug_string_buffer;
168
3
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
169
3
    return fmt::to_string(debug_string_buffer);
170
3
}
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_15SortSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_14AggSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE12debug_stringB5cxx11Ei
_ZNK5doris19PipelineXLocalStateINS_15FakeSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
166
16.7k
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
167
16.7k
    fmt::memory_buffer debug_string_buffer;
168
16.7k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
169
16.7k
    return fmt::to_string(debug_string_buffer);
170
16.7k
}
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_16UnionSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_14SetSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_16BasicSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_17RecCTESharedStateEE12debug_stringB5cxx11Ei
171
172
template <typename SharedStateArg>
173
16.7k
std::string PipelineXSinkLocalState<SharedStateArg>::debug_string(int indentation_level) const {
174
16.7k
    fmt::memory_buffer debug_string_buffer;
175
16.7k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
176
16.7k
    return fmt::to_string(debug_string_buffer);
177
16.7k
}
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE12debug_stringB5cxx11Ei
_ZNK5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
173
16.7k
std::string PipelineXSinkLocalState<SharedStateArg>::debug_string(int indentation_level) const {
174
16.7k
    fmt::memory_buffer debug_string_buffer;
175
16.7k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
176
16.7k
    return fmt::to_string(debug_string_buffer);
177
16.7k
}
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE12debug_stringB5cxx11Ei
178
179
16.8k
std::string OperatorXBase::debug_string(int indentation_level) const {
180
16.8k
    fmt::memory_buffer debug_string_buffer;
181
16.8k
    fmt::format_to(debug_string_buffer, "{}{}: id={}, parallel_tasks={}, _is_serial_operator={}",
182
16.8k
                   std::string(indentation_level * 2, ' '), _op_name, node_id(), _parallel_tasks,
183
16.8k
                   _is_serial_operator);
184
16.8k
    return fmt::to_string(debug_string_buffer);
185
16.8k
}
186
187
16.7k
std::string OperatorXBase::debug_string(RuntimeState* state, int indentation_level) const {
188
16.7k
    return state->get_local_state(operator_id())->debug_string(indentation_level);
189
16.7k
}
190
191
26.6k
Status OperatorXBase::init(const TPlanNode& tnode, RuntimeState* state) {
192
26.6k
    std::string node_name = print_plan_node_type(tnode.node_type);
193
26.6k
    _nereids_id = tnode.nereids_id;
194
26.6k
    if (!tnode.intermediate_output_tuple_id_list.empty()) {
195
16
        if (!has_projection()) {
196
0
            return Status::InternalError("no final output tuple id");
197
0
        }
198
16
        if (tnode.intermediate_output_tuple_id_list.size() !=
199
16
            tnode.intermediate_projections_list.size()) {
200
0
            return Status::InternalError(
201
0
                    "intermediate_output_tuple_id_list size:{} not match "
202
0
                    "intermediate_projections_list size:{}",
203
0
                    tnode.intermediate_output_tuple_id_list.size(),
204
0
                    tnode.intermediate_projections_list.size());
205
0
        }
206
16
    }
207
26.6k
    auto substr = node_name.substr(0, node_name.find("_NODE"));
208
26.6k
    _op_name = substr + "_OPERATOR";
209
210
26.6k
    if (tnode.__isset.vconjunct) {
211
0
        return Status::InternalError("vconjunct is not supported yet");
212
26.6k
    } else if (tnode.__isset.conjuncts) {
213
1.16k
        for (const auto& conjunct : tnode.conjuncts) {
214
1.16k
            VExprContextSPtr context;
215
1.16k
            RETURN_IF_ERROR(VExpr::create_expr_tree(conjunct, context));
216
1.16k
            _conjuncts.emplace_back(context);
217
1.16k
        }
218
316
    }
219
220
    // create the projections expr
221
26.6k
    if (tnode.__isset.projections) {
222
25.3k
        RETURN_IF_ERROR(VExpr::create_expr_trees(tnode.projections, _projection->projections));
223
25.3k
    }
224
26.6k
    if (!tnode.intermediate_projections_list.empty()) {
225
16
        DCHECK(has_projection()) << "no final projections";
226
16
        _projection->intermediate_projections.reserve(tnode.intermediate_projections_list.size());
227
80
        for (const auto& tnode_projections : tnode.intermediate_projections_list) {
228
80
            VExprContextSPtrs projections;
229
80
            RETURN_IF_ERROR(VExpr::create_expr_trees(tnode_projections, projections));
230
80
            _projection->intermediate_projections.push_back(projections);
231
80
        }
232
16
    }
233
26.6k
    return Status::OK();
234
26.6k
}
235
236
51.0k
Status OperatorXBase::prepare(RuntimeState* state) {
237
51.0k
    for (auto& conjunct : _conjuncts) {
238
1.16k
        RETURN_IF_ERROR(conjunct->prepare(state, operator_row_desc_before_projection()));
239
1.16k
    }
240
51.0k
    if (state->enable_adjust_conjunct_order_by_cost()) {
241
2.79k
        std::ranges::stable_sort(_conjuncts, [](const auto& a, const auto& b) {
242
1.64k
            return a->execute_cost() < b->execute_cost();
243
1.64k
        });
244
2.79k
    };
245
246
51.0k
    if (has_projection()) {
247
25.3k
        auto& projection = *_projection;
248
25.4k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
249
80
            const auto& input_row_desc =
250
80
                    i == 0 ? operator_row_desc_before_projection()
251
80
                           : projection.intermediate_output_row_descriptors[i - 1];
252
80
            RETURN_IF_ERROR(
253
80
                    VExpr::prepare(projection.intermediate_projections[i], state, input_row_desc));
254
80
        }
255
25.3k
        const auto& final_projection_input_row_desc =
256
25.3k
                projection.intermediate_output_row_descriptors.empty()
257
25.3k
                        ? operator_row_desc_before_projection()
258
25.3k
                        : projection.intermediate_output_row_descriptors.back();
259
25.3k
        RETURN_IF_ERROR(
260
25.3k
                VExpr::prepare(projection.projections, state, final_projection_input_row_desc));
261
25.3k
        RETURN_IF_ERROR(VExpr::check_expr_output_type(projection.projections,
262
25.3k
                                                      projection.output_row_descriptor));
263
25.3k
    }
264
265
51.0k
    for (auto& conjunct : _conjuncts) {
266
1.16k
        RETURN_IF_ERROR(conjunct->open(state));
267
1.16k
    }
268
51.0k
    if (has_projection()) {
269
25.3k
        RETURN_IF_ERROR(VExpr::open(_projection->projections, state));
270
25.3k
        for (auto& projections : _projection->intermediate_projections) {
271
80
            RETURN_IF_ERROR(VExpr::open(projections, state));
272
80
        }
273
25.3k
    }
274
51.0k
    if (_child && !is_source()) {
275
24.3k
        RETURN_IF_ERROR(_child->prepare(state));
276
24.3k
    }
277
278
51.0k
    if (VExpr::contains_blockable_function(_conjuncts) ||
279
51.0k
        (has_projection() && VExpr::contains_blockable_function(_projection->projections))) {
280
0
        _blockable = true;
281
0
    }
282
283
51.0k
    return Status::OK();
284
51.0k
}
285
286
156
Status OperatorXBase::terminate(RuntimeState* state) {
287
156
    if (_child && !is_source()) {
288
74
        RETURN_IF_ERROR(_child->terminate(state));
289
74
    }
290
156
    auto result = state->get_local_state_result(operator_id());
291
156
    if (!result) {
292
0
        return result.error();
293
0
    }
294
156
    return result.value()->terminate(state);
295
156
}
296
297
30.7k
Status OperatorXBase::close(RuntimeState* state) {
298
30.7k
    if (_child && !is_source()) {
299
24.5k
        RETURN_IF_ERROR(_child->close(state));
300
24.5k
    }
301
30.7k
    auto result = state->get_local_state_result(operator_id());
302
30.7k
    if (!result) {
303
0
        return result.error();
304
0
    }
305
30.7k
    return result.value()->close(state);
306
30.7k
}
307
308
835
void PipelineXLocalStateBase::clear_origin_block() {
309
835
    _origin_block.clear_column_data(
310
835
            _parent->operator_row_desc_before_projection().num_materialized_slots());
311
835
}
312
313
4.87k
Status PipelineXLocalStateBase::filter_block(const VExprContextSPtrs& expr_contexts, Block* block) {
314
4.87k
    RETURN_IF_ERROR(VExprContext::filter_block(expr_contexts, block, block->columns()));
315
316
4.87k
    _estimate_memory_usage += VExprContext::get_memory_usage(expr_contexts);
317
4.87k
    return Status::OK();
318
4.87k
}
319
320
0
bool PipelineXLocalStateBase::is_blockable() const {
321
0
    return std::any_of(_projections.begin(), _projections.end(),
322
0
                       [&](VExprContextSPtr expr) -> bool { return expr->is_blockable(); });
323
0
}
324
325
Status OperatorXBase::do_projections(RuntimeState* state, Block* origin_block,
326
837
                                     Block* output_block) const {
327
837
    auto* local_state = state->get_local_state(operator_id());
328
837
    SCOPED_TIMER(local_state->exec_time_counter());
329
837
    SCOPED_TIMER(local_state->_projection_timer);
330
837
    const size_t rows = origin_block->rows();
331
837
    if (rows == 0) {
332
213
        return Status::OK();
333
213
    }
334
624
    SCOPED_PEAK_MEM(&local_state->_estimate_memory_usage);
335
336
624
    {
337
624
        Block input_block = *origin_block;
338
339
624
        ColumnsWithTypeAndName new_columns;
340
624
        for (const auto& projections : local_state->_intermediate_projections) {
341
0
            if (projections.empty()) {
342
0
                return Status::InternalError("meet empty intermediate projection, node id: {}",
343
0
                                             node_id());
344
0
            }
345
0
            new_columns.resize(projections.size());
346
0
            for (int i = 0; i < projections.size(); i++) {
347
0
                RETURN_IF_ERROR(projections[i]->execute(&input_block, new_columns[i]));
348
0
                if (new_columns[i].column->size() != rows) {
349
0
                    return Status::InternalError(
350
0
                            "intermediate projection result column size {} not equal input rows "
351
0
                            "{}, expr: {}",
352
0
                            new_columns[i].column->size(), rows,
353
0
                            projections[i]->root()->debug_string());
354
0
                }
355
0
            }
356
0
            Block tmp_block {new_columns};
357
0
            input_block.swap(tmp_block);
358
0
        }
359
360
624
        if (input_block.rows() != rows) {
361
0
            return Status::InternalError(
362
0
                    "after intermediate projections input block rows {} not equal origin rows {}, "
363
0
                    "input_block: {}",
364
0
                    input_block.rows(), rows, input_block.dump_structure());
365
0
        }
366
367
624
        auto scoped_mutable_block = VectorizedUtils::build_scoped_mutable_mem_reuse_block(
368
624
                output_block, _projection->output_row_descriptor);
369
624
        auto& mutable_columns = scoped_mutable_block.mutable_columns();
370
624
        DCHECK_EQ(mutable_columns.size(), local_state->_projections.size()) << debug_string();
371
624
        Columns shared_columns(mutable_columns.size());
372
373
4.26k
        for (int i = 0; i < mutable_columns.size(); ++i) {
374
3.64k
            ColumnPtr column_ptr;
375
3.64k
            RETURN_IF_ERROR(local_state->_projections[i]->execute(&input_block, column_ptr));
376
3.64k
            if (column_ptr->size() != rows) {
377
0
                return Status::InternalError(
378
0
                        "projection result column size {} not equal input rows {}, expr: {}",
379
0
                        column_ptr->size(), rows,
380
0
                        local_state->_projections[i]->root()->debug_string());
381
0
            }
382
3.64k
            column_ptr = column_ptr->convert_to_full_column_if_const();
383
3.64k
            if (is_column_nullable(*mutable_columns[i]) && !is_column_nullable(*column_ptr)) {
384
0
                column_ptr = make_nullable(column_ptr, false);
385
0
            }
386
3.64k
            if (column_ptr->is_exclusive()) {
387
1.69k
                mutable_columns[i] = IColumn::mutate(std::move(column_ptr));
388
1.95k
            } else {
389
1.95k
                shared_columns[i] = std::move(column_ptr);
390
1.95k
            }
391
3.64k
        }
392
393
624
        scoped_mutable_block.restore();
394
4.26k
        for (int i = 0; i < shared_columns.size(); ++i) {
395
3.64k
            if (shared_columns[i]) {
396
1.95k
                output_block->replace_by_position(i, std::move(shared_columns[i]));
397
1.95k
            }
398
3.64k
        }
399
624
    }
400
401
0
    origin_block->clear_column_data(
402
624
            local_state->_parent->operator_row_desc_before_projection().num_materialized_slots());
403
624
    DCHECK_EQ(output_block->rows(), rows);
404
405
624
    return Status::OK();
406
624
}
407
408
1.24M
Status OperatorXBase::get_block_after_projects(RuntimeState* state, Block* block, bool* eos) {
409
1.24M
    DBUG_EXECUTE_IF("Pipeline::return_empty_block", {
410
1.24M
        if (this->_op_name == "AGGREGATION_OPERATOR" || this->_op_name == "HASH_JOIN_OPERATOR" ||
411
1.24M
            this->_op_name == "PARTITIONED_AGGREGATION_OPERATOR" ||
412
1.24M
            this->_op_name == "PARTITIONED_HASH_JOIN_OPERATOR" ||
413
1.24M
            this->_op_name == "CROSS_JOIN_OPERATOR" || this->_op_name == "SORT_OPERATOR") {
414
1.24M
            if (_debug_point_count++ % 2 == 0) {
415
1.24M
                return Status::OK();
416
1.24M
            }
417
1.24M
        }
418
1.24M
    });
419
420
1.24M
    Status status;
421
1.24M
    auto* local_state = state->get_local_state(operator_id());
422
1.24M
    Defer defer([&]() {
423
1.24M
        if (status.ok()) {
424
1.24M
            local_state->update_output_block_counters(*block);
425
1.24M
        }
426
1.24M
    });
427
1.24M
    if (has_projection()) {
428
835
        local_state->clear_origin_block();
429
835
        status = get_block(state, &local_state->_origin_block, eos);
430
835
        if (UNLIKELY(!status.ok())) {
431
0
            return status;
432
0
        }
433
835
        status = do_projections(state, &local_state->_origin_block, block);
434
835
        return status;
435
835
    }
436
1.24M
    status = get_block(state, block, eos);
437
1.24M
    RETURN_IF_ERROR(block->check_type_and_column());
438
1.24M
    return status;
439
1.24M
}
440
441
24.8k
void PipelineXLocalStateBase::reached_limit(Block* block, bool* eos) {
442
24.8k
    if (_parent->_limit != -1 and _num_rows_returned + block->rows() >= _parent->_limit) {
443
36
        block->set_num_rows(_parent->_limit - _num_rows_returned);
444
36
        *eos = true;
445
36
    }
446
447
24.8k
    DBUG_EXECUTE_IF("Pipeline::reached_limit_early", {
448
24.8k
        auto op_name = to_lower(_parent->_op_name);
449
24.8k
        auto arg_op_name = dp->param<std::string>("op_name");
450
24.8k
        arg_op_name = to_lower(arg_op_name);
451
452
24.8k
        if (op_name == arg_op_name) {
453
24.8k
            *eos = true;
454
24.8k
        }
455
24.8k
    });
456
457
24.8k
    if (auto rows = block->rows()) {
458
7.19k
        _num_rows_returned += rows;
459
7.19k
        _state->get_query_ctx()->resource_ctx()->io_context()->update_process_rows(rows);
460
7.19k
    }
461
24.8k
}
462
463
24.0k
Status DataSinkOperatorXBase::terminate(RuntimeState* state) {
464
24.0k
    auto result = state->get_sink_local_state_result();
465
24.0k
    if (!result) {
466
0
        return result.error();
467
0
    }
468
24.0k
    return result.value()->terminate(state);
469
24.0k
}
470
471
16.7k
std::string DataSinkOperatorXBase::debug_string(int indentation_level) const {
472
16.7k
    fmt::memory_buffer debug_string_buffer;
473
474
16.7k
    fmt::format_to(debug_string_buffer, "{}{}: id={}, _is_serial_operator={}",
475
16.7k
                   std::string(indentation_level * 2, ' '), _name, node_id(), _is_serial_operator);
476
16.7k
    return fmt::to_string(debug_string_buffer);
477
16.7k
}
478
479
16.7k
std::string DataSinkOperatorXBase::debug_string(RuntimeState* state, int indentation_level) const {
480
16.7k
    return state->get_sink_local_state()->debug_string(indentation_level);
481
16.7k
}
482
483
1.55k
Status DataSinkOperatorXBase::init(const TDataSink& tsink) {
484
1.55k
    std::string op_name = "UNKNOWN_SINK";
485
1.55k
    auto it = _TDataSinkType_VALUES_TO_NAMES.find(tsink.type);
486
487
1.56k
    if (it != _TDataSinkType_VALUES_TO_NAMES.end()) {
488
1.56k
        op_name = it->second;
489
1.56k
    }
490
1.55k
    _name = op_name + "_OPERATOR";
491
1.55k
    return Status::OK();
492
1.55k
}
493
494
73.1k
Status DataSinkOperatorXBase::init(const TPlanNode& tnode, RuntimeState* state) {
495
73.1k
    std::string op_name = print_plan_node_type(tnode.node_type);
496
73.1k
    _nereids_id = tnode.nereids_id;
497
73.1k
    auto substr = op_name.substr(0, op_name.find("_NODE"));
498
73.1k
    _name = substr + "_SINK_OPERATOR";
499
73.1k
    return Status::OK();
500
73.1k
}
501
502
template <typename LocalStateType>
503
Status DataSinkOperatorX<LocalStateType>::setup_local_state(RuntimeState* state,
504
74.8k
                                                            LocalSinkStateInfo& info) {
505
74.8k
    auto local_state = LocalStateType::create_unique(this, state);
506
74.8k
    RETURN_IF_ERROR(local_state->init(state, info));
507
74.8k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
508
74.8k
    return Status::OK();
509
74.8k
}
_ZN5doris17DataSinkOperatorXINS_27HashJoinBuildSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
504
72.0k
                                                            LocalSinkStateInfo& info) {
505
72.0k
    auto local_state = LocalStateType::create_unique(this, state);
506
72.0k
    RETURN_IF_ERROR(local_state->init(state, info));
507
72.0k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
508
72.0k
    return Status::OK();
509
72.0k
}
_ZN5doris17DataSinkOperatorXINS_20ResultSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
504
556
                                                            LocalSinkStateInfo& info) {
505
556
    auto local_state = LocalStateType::create_unique(this, state);
506
556
    RETURN_IF_ERROR(local_state->init(state, info));
507
556
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
508
556
    return Status::OK();
509
556
}
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_23JdbcTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_27MemoryScratchSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_24ResultFileSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
_ZN5doris17DataSinkOperatorXINS_23OlapTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
504
16
                                                            LocalSinkStateInfo& info) {
505
16
    auto local_state = LocalStateType::create_unique(this, state);
506
16
    RETURN_IF_ERROR(local_state->init(state, info));
507
16
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
508
16
    return Status::OK();
509
16
}
_ZN5doris17DataSinkOperatorXINS_25OlapTableSinkV2LocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
504
8
                                                            LocalSinkStateInfo& info) {
505
8
    auto local_state = LocalStateType::create_unique(this, state);
506
8
    RETURN_IF_ERROR(local_state->init(state, info));
507
8
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
508
8
    return Status::OK();
509
8
}
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_23HiveTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_22TVFTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_26IcebergTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_25PaimonTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_31SpillIcebergTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_27IcebergDeleteSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_26IcebergMergeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_21MCTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_22AnalyticSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_23BlackholeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
_ZN5doris17DataSinkOperatorXINS_18SortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
504
132
                                                            LocalSinkStateInfo& info) {
505
132
    auto local_state = LocalStateType::create_unique(this, state);
506
132
    RETURN_IF_ERROR(local_state->init(state, info));
507
132
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
508
132
    return Status::OK();
509
132
}
_ZN5doris17DataSinkOperatorXINS_23SpillSortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
504
22
                                                            LocalSinkStateInfo& info) {
505
22
    auto local_state = LocalStateType::create_unique(this, state);
506
22
    RETURN_IF_ERROR(local_state->init(state, info));
507
22
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
508
22
    return Status::OK();
509
22
}
_ZN5doris17DataSinkOperatorXINS_27LocalExchangeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
504
18
                                                            LocalSinkStateInfo& info) {
505
18
    auto local_state = LocalStateType::create_unique(this, state);
506
18
    RETURN_IF_ERROR(local_state->init(state, info));
507
18
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
508
18
    return Status::OK();
509
18
}
_ZN5doris17DataSinkOperatorXINS_17AggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
504
568
                                                            LocalSinkStateInfo& info) {
505
568
    auto local_state = LocalStateType::create_unique(this, state);
506
568
    RETURN_IF_ERROR(local_state->init(state, info));
507
568
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
508
568
    return Status::OK();
509
568
}
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_25BucketedAggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
_ZN5doris17DataSinkOperatorXINS_28PartitionedAggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
504
98
                                                            LocalSinkStateInfo& info) {
505
98
    auto local_state = LocalStateType::create_unique(this, state);
506
98
    RETURN_IF_ERROR(local_state->init(state, info));
507
98
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
508
98
    return Status::OK();
509
98
}
_ZN5doris17DataSinkOperatorXINS_22ExchangeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
504
1.07k
                                                            LocalSinkStateInfo& info) {
505
1.07k
    auto local_state = LocalStateType::create_unique(this, state);
506
1.07k
    RETURN_IF_ERROR(local_state->init(state, info));
507
1.07k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
508
1.07k
    return Status::OK();
509
1.07k
}
_ZN5doris17DataSinkOperatorXINS_33NestedLoopJoinBuildSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
504
193
                                                            LocalSinkStateInfo& info) {
505
193
    auto local_state = LocalStateType::create_unique(this, state);
506
193
    RETURN_IF_ERROR(local_state->init(state, info));
507
193
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
508
193
    return Status::OK();
509
193
}
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_19UnionSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
_ZN5doris17DataSinkOperatorXINS_33MultiCastDataStreamSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
504
96
                                                            LocalSinkStateInfo& info) {
505
96
    auto local_state = LocalStateType::create_unique(this, state);
506
96
    RETURN_IF_ERROR(local_state->init(state, info));
507
96
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
508
96
    return Status::OK();
509
96
}
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_27PartitionSortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
_ZN5doris17DataSinkOperatorXINS_33PartitionedHashJoinSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
504
1
                                                            LocalSinkStateInfo& info) {
505
1
    auto local_state = LocalStateType::create_unique(this, state);
506
1
    RETURN_IF_ERROR(local_state->init(state, info));
507
1
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
508
1
    return Status::OK();
509
1
}
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_30GroupCommitBlockSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_19CacheSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
_ZN5doris17DataSinkOperatorXINS_18DictSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
504
56
                                                            LocalSinkStateInfo& info) {
505
56
    auto local_state = LocalStateType::create_unique(this, state);
506
56
    RETURN_IF_ERROR(local_state->init(state, info));
507
56
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
508
56
    return Status::OK();
509
56
}
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_20RecCTESinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_26RecCTEAnchorSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
510
511
template <typename LocalStateType>
512
74.9k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
513
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
514
0
                                 LocalExchangeSharedState>) {
515
0
        return nullptr;
516
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
517
0
                                        MultiCastSharedState>) {
518
0
        throw Exception(Status::FatalError("should not reach here!"));
519
74.9k
    } else {
520
74.9k
        auto ss = LocalStateType::SharedStateType::create_shared();
521
74.9k
        ss->id = operator_id();
522
74.9k
        for (auto& dest : dests_id()) {
523
74.9k
            ss->related_op_ids.insert(dest);
524
74.9k
        }
525
74.9k
        return ss;
526
74.9k
    }
527
74.9k
}
_ZNK5doris17DataSinkOperatorXINS_27HashJoinBuildSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
512
72.0k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
513
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
514
                                 LocalExchangeSharedState>) {
515
        return nullptr;
516
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
517
                                        MultiCastSharedState>) {
518
        throw Exception(Status::FatalError("should not reach here!"));
519
72.0k
    } else {
520
72.0k
        auto ss = LocalStateType::SharedStateType::create_shared();
521
72.0k
        ss->id = operator_id();
522
72.0k
        for (auto& dest : dests_id()) {
523
72.0k
            ss->related_op_ids.insert(dest);
524
72.0k
        }
525
72.0k
        return ss;
526
72.0k
    }
527
72.0k
}
_ZNK5doris17DataSinkOperatorXINS_20ResultSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
512
556
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
513
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
514
                                 LocalExchangeSharedState>) {
515
        return nullptr;
516
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
517
                                        MultiCastSharedState>) {
518
        throw Exception(Status::FatalError("should not reach here!"));
519
556
    } else {
520
556
        auto ss = LocalStateType::SharedStateType::create_shared();
521
556
        ss->id = operator_id();
522
556
        for (auto& dest : dests_id()) {
523
556
            ss->related_op_ids.insert(dest);
524
556
        }
525
556
        return ss;
526
556
    }
527
556
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_23JdbcTableSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_27MemoryScratchSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_24ResultFileSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_23OlapTableSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
512
16
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
513
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
514
                                 LocalExchangeSharedState>) {
515
        return nullptr;
516
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
517
                                        MultiCastSharedState>) {
518
        throw Exception(Status::FatalError("should not reach here!"));
519
16
    } else {
520
16
        auto ss = LocalStateType::SharedStateType::create_shared();
521
16
        ss->id = operator_id();
522
16
        for (auto& dest : dests_id()) {
523
16
            ss->related_op_ids.insert(dest);
524
16
        }
525
16
        return ss;
526
16
    }
527
16
}
_ZNK5doris17DataSinkOperatorXINS_25OlapTableSinkV2LocalStateEE19create_shared_stateEv
Line
Count
Source
512
8
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
513
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
514
                                 LocalExchangeSharedState>) {
515
        return nullptr;
516
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
517
                                        MultiCastSharedState>) {
518
        throw Exception(Status::FatalError("should not reach here!"));
519
8
    } else {
520
8
        auto ss = LocalStateType::SharedStateType::create_shared();
521
8
        ss->id = operator_id();
522
8
        for (auto& dest : dests_id()) {
523
8
            ss->related_op_ids.insert(dest);
524
8
        }
525
8
        return ss;
526
8
    }
527
8
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_23HiveTableSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22TVFTableSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_26IcebergTableSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_25PaimonTableSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_31SpillIcebergTableSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_27IcebergDeleteSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_26IcebergMergeSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_21MCTableSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_22AnalyticSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
512
16
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
513
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
514
                                 LocalExchangeSharedState>) {
515
        return nullptr;
516
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
517
                                        MultiCastSharedState>) {
518
        throw Exception(Status::FatalError("should not reach here!"));
519
16
    } else {
520
16
        auto ss = LocalStateType::SharedStateType::create_shared();
521
16
        ss->id = operator_id();
522
16
        for (auto& dest : dests_id()) {
523
16
            ss->related_op_ids.insert(dest);
524
16
        }
525
16
        return ss;
526
16
    }
527
16
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_23BlackholeSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_18SortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
512
141
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
513
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
514
                                 LocalExchangeSharedState>) {
515
        return nullptr;
516
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
517
                                        MultiCastSharedState>) {
518
        throw Exception(Status::FatalError("should not reach here!"));
519
141
    } else {
520
141
        auto ss = LocalStateType::SharedStateType::create_shared();
521
141
        ss->id = operator_id();
522
141
        for (auto& dest : dests_id()) {
523
141
            ss->related_op_ids.insert(dest);
524
141
        }
525
141
        return ss;
526
141
    }
527
141
}
_ZNK5doris17DataSinkOperatorXINS_23SpillSortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
512
24
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
513
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
514
                                 LocalExchangeSharedState>) {
515
        return nullptr;
516
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
517
                                        MultiCastSharedState>) {
518
        throw Exception(Status::FatalError("should not reach here!"));
519
24
    } else {
520
24
        auto ss = LocalStateType::SharedStateType::create_shared();
521
24
        ss->id = operator_id();
522
24
        for (auto& dest : dests_id()) {
523
24
            ss->related_op_ids.insert(dest);
524
24
        }
525
24
        return ss;
526
24
    }
527
24
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_27LocalExchangeSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_17AggSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
512
597
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
513
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
514
                                 LocalExchangeSharedState>) {
515
        return nullptr;
516
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
517
                                        MultiCastSharedState>) {
518
        throw Exception(Status::FatalError("should not reach here!"));
519
597
    } else {
520
597
        auto ss = LocalStateType::SharedStateType::create_shared();
521
597
        ss->id = operator_id();
522
597
        for (auto& dest : dests_id()) {
523
597
            ss->related_op_ids.insert(dest);
524
597
        }
525
597
        return ss;
526
597
    }
527
597
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_25BucketedAggSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_28PartitionedAggSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
512
97
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
513
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
514
                                 LocalExchangeSharedState>) {
515
        return nullptr;
516
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
517
                                        MultiCastSharedState>) {
518
        throw Exception(Status::FatalError("should not reach here!"));
519
97
    } else {
520
97
        auto ss = LocalStateType::SharedStateType::create_shared();
521
97
        ss->id = operator_id();
522
97
        for (auto& dest : dests_id()) {
523
97
            ss->related_op_ids.insert(dest);
524
97
        }
525
97
        return ss;
526
97
    }
527
97
}
_ZNK5doris17DataSinkOperatorXINS_22ExchangeSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
512
1.07k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
513
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
514
                                 LocalExchangeSharedState>) {
515
        return nullptr;
516
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
517
                                        MultiCastSharedState>) {
518
        throw Exception(Status::FatalError("should not reach here!"));
519
1.07k
    } else {
520
1.07k
        auto ss = LocalStateType::SharedStateType::create_shared();
521
1.07k
        ss->id = operator_id();
522
1.07k
        for (auto& dest : dests_id()) {
523
1.07k
            ss->related_op_ids.insert(dest);
524
1.07k
        }
525
1.07k
        return ss;
526
1.07k
    }
527
1.07k
}
_ZNK5doris17DataSinkOperatorXINS_33NestedLoopJoinBuildSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
512
193
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
513
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
514
                                 LocalExchangeSharedState>) {
515
        return nullptr;
516
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
517
                                        MultiCastSharedState>) {
518
        throw Exception(Status::FatalError("should not reach here!"));
519
193
    } else {
520
193
        auto ss = LocalStateType::SharedStateType::create_shared();
521
193
        ss->id = operator_id();
522
193
        for (auto& dest : dests_id()) {
523
193
            ss->related_op_ids.insert(dest);
524
193
        }
525
193
        return ss;
526
193
    }
527
193
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_19UnionSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_33MultiCastDataStreamSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_27PartitionSortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
512
102
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
513
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
514
                                 LocalExchangeSharedState>) {
515
        return nullptr;
516
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
517
                                        MultiCastSharedState>) {
518
        throw Exception(Status::FatalError("should not reach here!"));
519
102
    } else {
520
102
        auto ss = LocalStateType::SharedStateType::create_shared();
521
102
        ss->id = operator_id();
522
102
        for (auto& dest : dests_id()) {
523
102
            ss->related_op_ids.insert(dest);
524
102
        }
525
102
        return ss;
526
102
    }
527
102
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb1EEEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb0EEEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb1EEEE19create_shared_stateEv
Line
Count
Source
512
7
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
513
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
514
                                 LocalExchangeSharedState>) {
515
        return nullptr;
516
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
517
                                        MultiCastSharedState>) {
518
        throw Exception(Status::FatalError("should not reach here!"));
519
7
    } else {
520
7
        auto ss = LocalStateType::SharedStateType::create_shared();
521
7
        ss->id = operator_id();
522
7
        for (auto& dest : dests_id()) {
523
7
            ss->related_op_ids.insert(dest);
524
7
        }
525
7
        return ss;
526
7
    }
527
7
}
_ZNK5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb0EEEE19create_shared_stateEv
Line
Count
Source
512
6
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
513
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
514
                                 LocalExchangeSharedState>) {
515
        return nullptr;
516
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
517
                                        MultiCastSharedState>) {
518
        throw Exception(Status::FatalError("should not reach here!"));
519
6
    } else {
520
6
        auto ss = LocalStateType::SharedStateType::create_shared();
521
6
        ss->id = operator_id();
522
6
        for (auto& dest : dests_id()) {
523
6
            ss->related_op_ids.insert(dest);
524
6
        }
525
6
        return ss;
526
6
    }
527
6
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_33PartitionedHashJoinSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_30GroupCommitBlockSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_19CacheSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_18DictSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
512
56
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
513
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
514
                                 LocalExchangeSharedState>) {
515
        return nullptr;
516
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
517
                                        MultiCastSharedState>) {
518
        throw Exception(Status::FatalError("should not reach here!"));
519
56
    } else {
520
56
        auto ss = LocalStateType::SharedStateType::create_shared();
521
56
        ss->id = operator_id();
522
56
        for (auto& dest : dests_id()) {
523
56
            ss->related_op_ids.insert(dest);
524
56
        }
525
56
        return ss;
526
56
    }
527
56
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_20RecCTESinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_26RecCTEAnchorSinkLocalStateEE19create_shared_stateEv
528
529
template <typename LocalStateType>
530
27.1k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
531
27.1k
    auto local_state = LocalStateType::create_unique(state, this);
532
27.1k
    RETURN_IF_ERROR(local_state->init(state, info));
533
27.1k
    state->emplace_local_state(operator_id(), std::move(local_state));
534
27.1k
    return Status::OK();
535
27.1k
}
_ZN5doris9OperatorXINS_23HashJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
530
24.0k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
531
24.0k
    auto local_state = LocalStateType::create_unique(state, this);
532
24.0k
    RETURN_IF_ERROR(local_state->init(state, info));
533
24.0k
    state->emplace_local_state(operator_id(), std::move(local_state));
534
24.0k
    return Status::OK();
535
24.0k
}
_ZN5doris9OperatorXINS_18OlapScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
530
736
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
531
736
    auto local_state = LocalStateType::create_unique(state, this);
532
736
    RETURN_IF_ERROR(local_state->init(state, info));
533
736
    state->emplace_local_state(operator_id(), std::move(local_state));
534
736
    return Status::OK();
535
736
}
Unexecuted instantiation: _ZN5doris9OperatorXINS_21GroupCommitLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Unexecuted instantiation: _ZN5doris9OperatorXINS_18JDBCScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris9OperatorXINS_18FileScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
530
6
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
531
6
    auto local_state = LocalStateType::create_unique(state, this);
532
6
    RETURN_IF_ERROR(local_state->init(state, info));
533
6
    state->emplace_local_state(operator_id(), std::move(local_state));
534
6
    return Status::OK();
535
6
}
Unexecuted instantiation: _ZN5doris9OperatorXINS_18AnalyticLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris9OperatorXINS_14SortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
530
15
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
531
15
    auto local_state = LocalStateType::create_unique(state, this);
532
15
    RETURN_IF_ERROR(local_state->init(state, info));
533
15
    state->emplace_local_state(operator_id(), std::move(local_state));
534
15
    return Status::OK();
535
15
}
_ZN5doris9OperatorXINS_19SpillSortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
530
15
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
531
15
    auto local_state = LocalStateType::create_unique(state, this);
532
15
    RETURN_IF_ERROR(local_state->init(state, info));
533
15
    state->emplace_local_state(operator_id(), std::move(local_state));
534
15
    return Status::OK();
535
15
}
_ZN5doris9OperatorXINS_24LocalMergeSortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
530
110
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
531
110
    auto local_state = LocalStateType::create_unique(state, this);
532
110
    RETURN_IF_ERROR(local_state->init(state, info));
533
110
    state->emplace_local_state(operator_id(), std::move(local_state));
534
110
    return Status::OK();
535
110
}
_ZN5doris9OperatorXINS_13AggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
530
558
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
531
558
    auto local_state = LocalStateType::create_unique(state, this);
532
558
    RETURN_IF_ERROR(local_state->init(state, info));
533
558
    state->emplace_local_state(operator_id(), std::move(local_state));
534
558
    return Status::OK();
535
558
}
Unexecuted instantiation: _ZN5doris9OperatorXINS_21BucketedAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris9OperatorXINS_24PartitionedAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
530
88
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
531
88
    auto local_state = LocalStateType::create_unique(state, this);
532
88
    RETURN_IF_ERROR(local_state->init(state, info));
533
88
    state->emplace_local_state(operator_id(), std::move(local_state));
534
88
    return Status::OK();
535
88
}
_ZN5doris9OperatorXINS_23TableFunctionLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
530
5
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
531
5
    auto local_state = LocalStateType::create_unique(state, this);
532
5
    RETURN_IF_ERROR(local_state->init(state, info));
533
5
    state->emplace_local_state(operator_id(), std::move(local_state));
534
5
    return Status::OK();
535
5
}
_ZN5doris9OperatorXINS_18ExchangeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
530
829
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
531
829
    auto local_state = LocalStateType::create_unique(state, this);
532
829
    RETURN_IF_ERROR(local_state->init(state, info));
533
829
    state->emplace_local_state(operator_id(), std::move(local_state));
534
829
    return Status::OK();
535
829
}
Unexecuted instantiation: _ZN5doris9OperatorXINS_16RepeatLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris9OperatorXINS_29NestedLoopJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
530
192
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
531
192
    auto local_state = LocalStateType::create_unique(state, this);
532
192
    RETURN_IF_ERROR(local_state->init(state, info));
533
192
    state->emplace_local_state(operator_id(), std::move(local_state));
534
192
    return Status::OK();
535
192
}
_ZN5doris9OperatorXINS_23AssertNumRowsLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
530
3
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
531
3
    auto local_state = LocalStateType::create_unique(state, this);
532
3
    RETURN_IF_ERROR(local_state->init(state, info));
533
3
    state->emplace_local_state(operator_id(), std::move(local_state));
534
3
    return Status::OK();
535
3
}
_ZN5doris9OperatorXINS_18EmptySetLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
530
1
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
531
1
    auto local_state = LocalStateType::create_unique(state, this);
532
1
    RETURN_IF_ERROR(local_state->init(state, info));
533
1
    state->emplace_local_state(operator_id(), std::move(local_state));
534
1
    return Status::OK();
535
1
}
_ZN5doris9OperatorXINS_21UnionSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
530
8
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
531
8
    auto local_state = LocalStateType::create_unique(state, this);
532
8
    RETURN_IF_ERROR(local_state->init(state, info));
533
8
    state->emplace_local_state(operator_id(), std::move(local_state));
534
8
    return Status::OK();
535
8
}
_ZN5doris9OperatorXINS_35MultiCastDataStreamSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
530
288
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
531
288
    auto local_state = LocalStateType::create_unique(state, this);
532
288
    RETURN_IF_ERROR(local_state->init(state, info));
533
288
    state->emplace_local_state(operator_id(), std::move(local_state));
534
288
    return Status::OK();
535
288
}
Unexecuted instantiation: _ZN5doris9OperatorXINS_29PartitionSortSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Unexecuted instantiation: _ZN5doris9OperatorXINS_19SetSourceLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Unexecuted instantiation: _ZN5doris9OperatorXINS_19SetSourceLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris9OperatorXINS_17DataGenLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
530
4
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
531
4
    auto local_state = LocalStateType::create_unique(state, this);
532
4
    RETURN_IF_ERROR(local_state->init(state, info));
533
4
    state->emplace_local_state(operator_id(), std::move(local_state));
534
4
    return Status::OK();
535
4
}
Unexecuted instantiation: _ZN5doris9OperatorXINS_20SchemaScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Unexecuted instantiation: _ZN5doris9OperatorXINS_18MetaScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris9OperatorXINS_29LocalExchangeSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
530
150
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
531
150
    auto local_state = LocalStateType::create_unique(state, this);
532
150
    RETURN_IF_ERROR(local_state->init(state, info));
533
150
    state->emplace_local_state(operator_id(), std::move(local_state));
534
150
    return Status::OK();
535
150
}
Unexecuted instantiation: _ZN5doris9OperatorXINS_34PartitionedHashJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Unexecuted instantiation: _ZN5doris9OperatorXINS_21CacheSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Unexecuted instantiation: _ZN5doris9OperatorXINS_22RecCTESourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Unexecuted instantiation: _ZN5doris9OperatorXINS_20RecCTEScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Unexecuted instantiation: _ZN5doris9OperatorXINS_25MaterializationLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris9OperatorXINS_16SelectLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
530
102
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
531
102
    auto local_state = LocalStateType::create_unique(state, this);
532
102
    RETURN_IF_ERROR(local_state->init(state, info));
533
102
    state->emplace_local_state(operator_id(), std::move(local_state));
534
102
    return Status::OK();
535
102
}
Unexecuted instantiation: _ZN5doris9OperatorXINS_22StreamingAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Unexecuted instantiation: _ZN5doris9OperatorXINS_30DistinctStreamingAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
536
537
PipelineXSinkLocalStateBase::PipelineXSinkLocalStateBase(DataSinkOperatorXBase* parent,
538
                                                         RuntimeState* state)
539
75.1k
        : _parent(parent), _state(state) {}
540
541
PipelineXLocalStateBase::PipelineXLocalStateBase(RuntimeState* state, OperatorXBase* parent)
542
27.6k
        : _num_rows_returned(0),
543
27.6k
          _rows_returned_counter(nullptr),
544
27.6k
          _parent(parent),
545
27.6k
          _state(state),
546
27.6k
          _budget(state->batch_size(), state->preferred_block_size_bytes()) {}
547
548
template <typename SharedStateArg>
549
27.3k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
550
27.3k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
551
27.3k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
552
27.3k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
553
27.3k
    _operator_profile->set_metadata(_parent->node_id());
554
    // indent is false so that source operator will have same
555
    // indentation_level with its parent operator.
556
27.3k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
557
27.3k
    _operator_profile->add_child(_common_profile.get(), true);
558
27.3k
    _operator_profile->add_child(_custom_profile.get(), true);
559
27.3k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
560
27.3k
    if constexpr (!is_fake_shared) {
561
25.6k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
562
150
            _shared_state = info.shared_state_map.at(_parent->operator_id())
563
150
                                    .first.get()
564
150
                                    ->template cast<SharedStateArg>();
565
566
150
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
567
150
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
568
150
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
569
25.4k
        } else if (info.shared_state) {
570
25.4k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
571
0
                DCHECK(false);
572
0
            }
573
            // For UnionSourceOperator without children, there is no shared state.
574
25.4k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
575
576
25.4k
            _dependency = _shared_state->create_source_dependency(
577
25.4k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
578
25.4k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
579
25.4k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
580
25.4k
        } else {
581
9
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
582
0
                DCHECK(false);
583
0
            }
584
9
        }
585
25.6k
    }
586
587
27.3k
    if (must_set_shared_state() && _shared_state == nullptr) {
588
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
589
0
    }
590
591
27.3k
    _rows_returned_counter =
592
27.3k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
593
27.3k
    _blocks_returned_counter =
594
27.3k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
595
27.3k
    _output_block_bytes_counter =
596
27.3k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
597
27.3k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
598
27.3k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
599
27.3k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
600
27.3k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
601
27.3k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
602
27.3k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
603
27.3k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
604
27.3k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
605
27.3k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
606
27.3k
    _memory_used_counter =
607
27.3k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
608
27.3k
    _common_profile->add_info_string("IsColocate",
609
27.3k
                                     std::to_string(_parent->is_colocated_operator()));
610
27.3k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
611
27.3k
    _common_profile->add_info_string("FollowedByShuffledOperator",
612
27.3k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
613
27.3k
    return Status::OK();
614
27.3k
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
549
24.0k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
550
24.0k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
551
24.0k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
552
24.0k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
553
24.0k
    _operator_profile->set_metadata(_parent->node_id());
554
    // indent is false so that source operator will have same
555
    // indentation_level with its parent operator.
556
24.0k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
557
24.0k
    _operator_profile->add_child(_common_profile.get(), true);
558
24.0k
    _operator_profile->add_child(_custom_profile.get(), true);
559
24.0k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
560
24.0k
    if constexpr (!is_fake_shared) {
561
24.0k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
562
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
563
0
                                    .first.get()
564
0
                                    ->template cast<SharedStateArg>();
565
566
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
567
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
568
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
569
24.0k
        } else if (info.shared_state) {
570
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
571
                DCHECK(false);
572
            }
573
            // For UnionSourceOperator without children, there is no shared state.
574
24.0k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
575
576
24.0k
            _dependency = _shared_state->create_source_dependency(
577
24.0k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
578
24.0k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
579
24.0k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
580
24.0k
        } else {
581
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
582
                DCHECK(false);
583
            }
584
0
        }
585
24.0k
    }
586
587
24.0k
    if (must_set_shared_state() && _shared_state == nullptr) {
588
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
589
0
    }
590
591
24.0k
    _rows_returned_counter =
592
24.0k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
593
24.0k
    _blocks_returned_counter =
594
24.0k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
595
24.0k
    _output_block_bytes_counter =
596
24.0k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
597
24.0k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
598
24.0k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
599
24.0k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
600
24.0k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
601
24.0k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
602
24.0k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
603
24.0k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
604
24.0k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
605
24.0k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
606
24.0k
    _memory_used_counter =
607
24.0k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
608
24.0k
    _common_profile->add_info_string("IsColocate",
609
24.0k
                                     std::to_string(_parent->is_colocated_operator()));
610
24.0k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
611
24.0k
    _common_profile->add_info_string("FollowedByShuffledOperator",
612
24.0k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
613
24.0k
    return Status::OK();
614
24.0k
}
_ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
549
1
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
550
1
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
551
1
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
552
1
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
553
1
    _operator_profile->set_metadata(_parent->node_id());
554
    // indent is false so that source operator will have same
555
    // indentation_level with its parent operator.
556
1
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
557
1
    _operator_profile->add_child(_common_profile.get(), true);
558
1
    _operator_profile->add_child(_custom_profile.get(), true);
559
1
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
560
1
    if constexpr (!is_fake_shared) {
561
1
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
562
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
563
0
                                    .first.get()
564
0
                                    ->template cast<SharedStateArg>();
565
566
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
567
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
568
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
569
1
        } else if (info.shared_state) {
570
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
571
                DCHECK(false);
572
            }
573
            // For UnionSourceOperator without children, there is no shared state.
574
1
            _shared_state = info.shared_state->template cast<SharedStateArg>();
575
576
1
            _dependency = _shared_state->create_source_dependency(
577
1
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
578
1
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
579
1
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
580
1
        } else {
581
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
582
                DCHECK(false);
583
            }
584
0
        }
585
1
    }
586
587
1
    if (must_set_shared_state() && _shared_state == nullptr) {
588
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
589
0
    }
590
591
1
    _rows_returned_counter =
592
1
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
593
1
    _blocks_returned_counter =
594
1
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
595
1
    _output_block_bytes_counter =
596
1
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
597
1
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
598
1
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
599
1
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
600
1
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
601
1
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
602
1
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
603
1
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
604
1
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
605
1
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
606
1
    _memory_used_counter =
607
1
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
608
1
    _common_profile->add_info_string("IsColocate",
609
1
                                     std::to_string(_parent->is_colocated_operator()));
610
1
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
611
1
    _common_profile->add_info_string("FollowedByShuffledOperator",
612
1
                                     std::to_string(_parent->followed_by_shuffled_operator()));
613
1
    return Status::OK();
614
1
}
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
549
137
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
550
137
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
551
137
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
552
137
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
553
137
    _operator_profile->set_metadata(_parent->node_id());
554
    // indent is false so that source operator will have same
555
    // indentation_level with its parent operator.
556
137
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
557
137
    _operator_profile->add_child(_common_profile.get(), true);
558
137
    _operator_profile->add_child(_custom_profile.get(), true);
559
137
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
560
137
    if constexpr (!is_fake_shared) {
561
137
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
562
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
563
0
                                    .first.get()
564
0
                                    ->template cast<SharedStateArg>();
565
566
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
567
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
568
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
569
137
        } else if (info.shared_state) {
570
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
571
                DCHECK(false);
572
            }
573
            // For UnionSourceOperator without children, there is no shared state.
574
137
            _shared_state = info.shared_state->template cast<SharedStateArg>();
575
576
137
            _dependency = _shared_state->create_source_dependency(
577
137
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
578
137
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
579
137
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
580
137
        } else {
581
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
582
                DCHECK(false);
583
            }
584
0
        }
585
137
    }
586
587
137
    if (must_set_shared_state() && _shared_state == nullptr) {
588
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
589
0
    }
590
591
137
    _rows_returned_counter =
592
137
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
593
137
    _blocks_returned_counter =
594
137
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
595
137
    _output_block_bytes_counter =
596
137
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
597
137
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
598
137
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
599
137
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
600
137
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
601
137
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
602
137
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
603
137
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
604
137
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
605
137
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
606
137
    _memory_used_counter =
607
137
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
608
137
    _common_profile->add_info_string("IsColocate",
609
137
                                     std::to_string(_parent->is_colocated_operator()));
610
137
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
611
137
    _common_profile->add_info_string("FollowedByShuffledOperator",
612
137
                                     std::to_string(_parent->followed_by_shuffled_operator()));
613
137
    return Status::OK();
614
137
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
549
15
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
550
15
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
551
15
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
552
15
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
553
15
    _operator_profile->set_metadata(_parent->node_id());
554
    // indent is false so that source operator will have same
555
    // indentation_level with its parent operator.
556
15
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
557
15
    _operator_profile->add_child(_common_profile.get(), true);
558
15
    _operator_profile->add_child(_custom_profile.get(), true);
559
15
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
560
15
    if constexpr (!is_fake_shared) {
561
15
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
562
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
563
0
                                    .first.get()
564
0
                                    ->template cast<SharedStateArg>();
565
566
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
567
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
568
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
569
15
        } else if (info.shared_state) {
570
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
571
                DCHECK(false);
572
            }
573
            // For UnionSourceOperator without children, there is no shared state.
574
15
            _shared_state = info.shared_state->template cast<SharedStateArg>();
575
576
15
            _dependency = _shared_state->create_source_dependency(
577
15
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
578
15
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
579
15
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
580
15
        } else {
581
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
582
                DCHECK(false);
583
            }
584
0
        }
585
15
    }
586
587
15
    if (must_set_shared_state() && _shared_state == nullptr) {
588
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
589
0
    }
590
591
15
    _rows_returned_counter =
592
15
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
593
15
    _blocks_returned_counter =
594
15
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
595
15
    _output_block_bytes_counter =
596
15
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
597
15
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
598
15
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
599
15
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
600
15
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
601
15
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
602
15
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
603
15
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
604
15
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
605
15
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
606
15
    _memory_used_counter =
607
15
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
608
15
    _common_profile->add_info_string("IsColocate",
609
15
                                     std::to_string(_parent->is_colocated_operator()));
610
15
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
611
15
    _common_profile->add_info_string("FollowedByShuffledOperator",
612
15
                                     std::to_string(_parent->followed_by_shuffled_operator()));
613
15
    return Status::OK();
614
15
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
549
192
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
550
192
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
551
192
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
552
192
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
553
192
    _operator_profile->set_metadata(_parent->node_id());
554
    // indent is false so that source operator will have same
555
    // indentation_level with its parent operator.
556
192
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
557
192
    _operator_profile->add_child(_common_profile.get(), true);
558
192
    _operator_profile->add_child(_custom_profile.get(), true);
559
192
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
560
192
    if constexpr (!is_fake_shared) {
561
192
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
562
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
563
0
                                    .first.get()
564
0
                                    ->template cast<SharedStateArg>();
565
566
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
567
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
568
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
569
192
        } else if (info.shared_state) {
570
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
571
                DCHECK(false);
572
            }
573
            // For UnionSourceOperator without children, there is no shared state.
574
192
            _shared_state = info.shared_state->template cast<SharedStateArg>();
575
576
192
            _dependency = _shared_state->create_source_dependency(
577
192
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
578
192
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
579
192
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
580
192
        } else {
581
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
582
                DCHECK(false);
583
            }
584
0
        }
585
192
    }
586
587
192
    if (must_set_shared_state() && _shared_state == nullptr) {
588
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
589
0
    }
590
591
192
    _rows_returned_counter =
592
192
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
593
192
    _blocks_returned_counter =
594
192
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
595
192
    _output_block_bytes_counter =
596
192
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
597
192
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
598
192
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
599
192
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
600
192
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
601
192
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
602
192
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
603
192
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
604
192
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
605
192
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
606
192
    _memory_used_counter =
607
192
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
608
192
    _common_profile->add_info_string("IsColocate",
609
192
                                     std::to_string(_parent->is_colocated_operator()));
610
192
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
611
192
    _common_profile->add_info_string("FollowedByShuffledOperator",
612
192
                                     std::to_string(_parent->followed_by_shuffled_operator()));
613
192
    return Status::OK();
614
192
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
549
16
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
550
16
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
551
16
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
552
16
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
553
16
    _operator_profile->set_metadata(_parent->node_id());
554
    // indent is false so that source operator will have same
555
    // indentation_level with its parent operator.
556
16
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
557
16
    _operator_profile->add_child(_common_profile.get(), true);
558
16
    _operator_profile->add_child(_custom_profile.get(), true);
559
16
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
560
16
    if constexpr (!is_fake_shared) {
561
16
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
562
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
563
0
                                    .first.get()
564
0
                                    ->template cast<SharedStateArg>();
565
566
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
567
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
568
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
569
16
        } else if (info.shared_state) {
570
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
571
                DCHECK(false);
572
            }
573
            // For UnionSourceOperator without children, there is no shared state.
574
16
            _shared_state = info.shared_state->template cast<SharedStateArg>();
575
576
16
            _dependency = _shared_state->create_source_dependency(
577
16
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
578
16
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
579
16
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
580
16
        } else {
581
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
582
                DCHECK(false);
583
            }
584
0
        }
585
16
    }
586
587
16
    if (must_set_shared_state() && _shared_state == nullptr) {
588
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
589
0
    }
590
591
16
    _rows_returned_counter =
592
16
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
593
16
    _blocks_returned_counter =
594
16
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
595
16
    _output_block_bytes_counter =
596
16
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
597
16
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
598
16
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
599
16
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
600
16
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
601
16
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
602
16
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
603
16
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
604
16
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
605
16
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
606
16
    _memory_used_counter =
607
16
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
608
16
    _common_profile->add_info_string("IsColocate",
609
16
                                     std::to_string(_parent->is_colocated_operator()));
610
16
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
611
16
    _common_profile->add_info_string("FollowedByShuffledOperator",
612
16
                                     std::to_string(_parent->followed_by_shuffled_operator()));
613
16
    return Status::OK();
614
16
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
549
587
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
550
587
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
551
587
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
552
587
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
553
587
    _operator_profile->set_metadata(_parent->node_id());
554
    // indent is false so that source operator will have same
555
    // indentation_level with its parent operator.
556
587
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
557
587
    _operator_profile->add_child(_common_profile.get(), true);
558
587
    _operator_profile->add_child(_custom_profile.get(), true);
559
587
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
560
587
    if constexpr (!is_fake_shared) {
561
587
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
562
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
563
0
                                    .first.get()
564
0
                                    ->template cast<SharedStateArg>();
565
566
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
567
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
568
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
569
587
        } else if (info.shared_state) {
570
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
571
                DCHECK(false);
572
            }
573
            // For UnionSourceOperator without children, there is no shared state.
574
587
            _shared_state = info.shared_state->template cast<SharedStateArg>();
575
576
587
            _dependency = _shared_state->create_source_dependency(
577
587
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
578
587
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
579
587
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
580
587
        } else {
581
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
582
                DCHECK(false);
583
            }
584
0
        }
585
587
    }
586
587
587
    if (must_set_shared_state() && _shared_state == nullptr) {
588
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
589
0
    }
590
591
587
    _rows_returned_counter =
592
587
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
593
587
    _blocks_returned_counter =
594
587
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
595
587
    _output_block_bytes_counter =
596
587
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
597
587
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
598
587
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
599
587
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
600
587
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
601
587
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
602
587
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
603
587
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
604
587
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
605
587
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
606
587
    _memory_used_counter =
607
587
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
608
587
    _common_profile->add_info_string("IsColocate",
609
587
                                     std::to_string(_parent->is_colocated_operator()));
610
587
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
611
587
    _common_profile->add_info_string("FollowedByShuffledOperator",
612
587
                                     std::to_string(_parent->followed_by_shuffled_operator()));
613
587
    return Status::OK();
614
587
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
549
88
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
550
88
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
551
88
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
552
88
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
553
88
    _operator_profile->set_metadata(_parent->node_id());
554
    // indent is false so that source operator will have same
555
    // indentation_level with its parent operator.
556
88
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
557
88
    _operator_profile->add_child(_common_profile.get(), true);
558
88
    _operator_profile->add_child(_custom_profile.get(), true);
559
88
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
560
88
    if constexpr (!is_fake_shared) {
561
88
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
562
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
563
0
                                    .first.get()
564
0
                                    ->template cast<SharedStateArg>();
565
566
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
567
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
568
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
569
88
        } else if (info.shared_state) {
570
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
571
                DCHECK(false);
572
            }
573
            // For UnionSourceOperator without children, there is no shared state.
574
88
            _shared_state = info.shared_state->template cast<SharedStateArg>();
575
576
88
            _dependency = _shared_state->create_source_dependency(
577
88
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
578
88
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
579
88
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
580
88
        } else {
581
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
582
                DCHECK(false);
583
            }
584
0
        }
585
88
    }
586
587
88
    if (must_set_shared_state() && _shared_state == nullptr) {
588
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
589
0
    }
590
591
88
    _rows_returned_counter =
592
88
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
593
88
    _blocks_returned_counter =
594
88
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
595
88
    _output_block_bytes_counter =
596
88
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
597
88
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
598
88
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
599
88
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
600
88
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
601
88
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
602
88
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
603
88
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
604
88
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
605
88
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
606
88
    _memory_used_counter =
607
88
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
608
88
    _common_profile->add_info_string("IsColocate",
609
88
                                     std::to_string(_parent->is_colocated_operator()));
610
88
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
611
88
    _common_profile->add_info_string("FollowedByShuffledOperator",
612
88
                                     std::to_string(_parent->followed_by_shuffled_operator()));
613
88
    return Status::OK();
614
88
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
549
1.74k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
550
1.74k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
551
1.74k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
552
1.74k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
553
1.74k
    _operator_profile->set_metadata(_parent->node_id());
554
    // indent is false so that source operator will have same
555
    // indentation_level with its parent operator.
556
1.74k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
557
1.74k
    _operator_profile->add_child(_common_profile.get(), true);
558
1.74k
    _operator_profile->add_child(_custom_profile.get(), true);
559
1.74k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
560
    if constexpr (!is_fake_shared) {
561
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
562
            _shared_state = info.shared_state_map.at(_parent->operator_id())
563
                                    .first.get()
564
                                    ->template cast<SharedStateArg>();
565
566
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
567
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
568
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
569
        } else if (info.shared_state) {
570
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
571
                DCHECK(false);
572
            }
573
            // For UnionSourceOperator without children, there is no shared state.
574
            _shared_state = info.shared_state->template cast<SharedStateArg>();
575
576
            _dependency = _shared_state->create_source_dependency(
577
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
578
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
579
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
580
        } else {
581
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
582
                DCHECK(false);
583
            }
584
        }
585
    }
586
587
1.74k
    if (must_set_shared_state() && _shared_state == nullptr) {
588
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
589
0
    }
590
591
1.74k
    _rows_returned_counter =
592
1.74k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
593
1.74k
    _blocks_returned_counter =
594
1.74k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
595
1.74k
    _output_block_bytes_counter =
596
1.74k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
597
1.74k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
598
1.74k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
599
1.74k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
600
1.74k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
601
1.74k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
602
1.74k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
603
1.74k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
604
1.74k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
605
1.74k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
606
1.74k
    _memory_used_counter =
607
1.74k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
608
1.74k
    _common_profile->add_info_string("IsColocate",
609
1.74k
                                     std::to_string(_parent->is_colocated_operator()));
610
1.74k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
611
1.74k
    _common_profile->add_info_string("FollowedByShuffledOperator",
612
1.74k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
613
1.74k
    return Status::OK();
614
1.74k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
549
10
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
550
10
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
551
10
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
552
10
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
553
10
    _operator_profile->set_metadata(_parent->node_id());
554
    // indent is false so that source operator will have same
555
    // indentation_level with its parent operator.
556
10
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
557
10
    _operator_profile->add_child(_common_profile.get(), true);
558
10
    _operator_profile->add_child(_custom_profile.get(), true);
559
10
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
560
10
    if constexpr (!is_fake_shared) {
561
10
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
562
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
563
0
                                    .first.get()
564
0
                                    ->template cast<SharedStateArg>();
565
566
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
567
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
568
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
569
10
        } else if (info.shared_state) {
570
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
571
                DCHECK(false);
572
            }
573
            // For UnionSourceOperator without children, there is no shared state.
574
1
            _shared_state = info.shared_state->template cast<SharedStateArg>();
575
576
1
            _dependency = _shared_state->create_source_dependency(
577
1
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
578
1
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
579
1
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
580
9
        } else {
581
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
582
                DCHECK(false);
583
            }
584
9
        }
585
10
    }
586
587
10
    if (must_set_shared_state() && _shared_state == nullptr) {
588
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
589
0
    }
590
591
10
    _rows_returned_counter =
592
10
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
593
10
    _blocks_returned_counter =
594
10
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
595
10
    _output_block_bytes_counter =
596
10
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
597
10
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
598
10
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
599
10
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
600
10
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
601
10
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
602
10
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
603
10
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
604
10
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
605
10
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
606
10
    _memory_used_counter =
607
10
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
608
10
    _common_profile->add_info_string("IsColocate",
609
10
                                     std::to_string(_parent->is_colocated_operator()));
610
10
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
611
10
    _common_profile->add_info_string("FollowedByShuffledOperator",
612
10
                                     std::to_string(_parent->followed_by_shuffled_operator()));
613
10
    return Status::OK();
614
10
}
_ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
549
12
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
550
12
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
551
12
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
552
12
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
553
12
    _operator_profile->set_metadata(_parent->node_id());
554
    // indent is false so that source operator will have same
555
    // indentation_level with its parent operator.
556
12
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
557
12
    _operator_profile->add_child(_common_profile.get(), true);
558
12
    _operator_profile->add_child(_custom_profile.get(), true);
559
12
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
560
12
    if constexpr (!is_fake_shared) {
561
12
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
562
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
563
0
                                    .first.get()
564
0
                                    ->template cast<SharedStateArg>();
565
566
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
567
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
568
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
569
12
        } else if (info.shared_state) {
570
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
571
                DCHECK(false);
572
            }
573
            // For UnionSourceOperator without children, there is no shared state.
574
12
            _shared_state = info.shared_state->template cast<SharedStateArg>();
575
576
12
            _dependency = _shared_state->create_source_dependency(
577
12
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
578
12
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
579
12
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
580
12
        } else {
581
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
582
                DCHECK(false);
583
            }
584
0
        }
585
12
    }
586
587
12
    if (must_set_shared_state() && _shared_state == nullptr) {
588
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
589
0
    }
590
591
12
    _rows_returned_counter =
592
12
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
593
12
    _blocks_returned_counter =
594
12
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
595
12
    _output_block_bytes_counter =
596
12
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
597
12
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
598
12
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
599
12
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
600
12
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
601
12
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
602
12
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
603
12
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
604
12
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
605
12
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
606
12
    _memory_used_counter =
607
12
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
608
12
    _common_profile->add_info_string("IsColocate",
609
12
                                     std::to_string(_parent->is_colocated_operator()));
610
12
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
611
12
    _common_profile->add_info_string("FollowedByShuffledOperator",
612
12
                                     std::to_string(_parent->followed_by_shuffled_operator()));
613
12
    return Status::OK();
614
12
}
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
549
288
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
550
288
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
551
288
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
552
288
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
553
288
    _operator_profile->set_metadata(_parent->node_id());
554
    // indent is false so that source operator will have same
555
    // indentation_level with its parent operator.
556
288
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
557
288
    _operator_profile->add_child(_common_profile.get(), true);
558
288
    _operator_profile->add_child(_custom_profile.get(), true);
559
288
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
560
288
    if constexpr (!is_fake_shared) {
561
288
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
562
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
563
0
                                    .first.get()
564
0
                                    ->template cast<SharedStateArg>();
565
566
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
567
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
568
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
569
288
        } else if (info.shared_state) {
570
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
571
                DCHECK(false);
572
            }
573
            // For UnionSourceOperator without children, there is no shared state.
574
288
            _shared_state = info.shared_state->template cast<SharedStateArg>();
575
576
288
            _dependency = _shared_state->create_source_dependency(
577
288
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
578
288
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
579
288
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
580
288
        } else {
581
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
582
                DCHECK(false);
583
            }
584
0
        }
585
288
    }
586
587
288
    if (must_set_shared_state() && _shared_state == nullptr) {
588
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
589
0
    }
590
591
288
    _rows_returned_counter =
592
288
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
593
288
    _blocks_returned_counter =
594
288
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
595
288
    _output_block_bytes_counter =
596
288
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
597
288
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
598
288
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
599
288
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
600
288
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
601
288
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
602
288
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
603
288
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
604
288
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
605
288
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
606
288
    _memory_used_counter =
607
288
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
608
288
    _common_profile->add_info_string("IsColocate",
609
288
                                     std::to_string(_parent->is_colocated_operator()));
610
288
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
611
288
    _common_profile->add_info_string("FollowedByShuffledOperator",
612
288
                                     std::to_string(_parent->followed_by_shuffled_operator()));
613
288
    return Status::OK();
614
288
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
549
102
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
550
102
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
551
102
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
552
102
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
553
102
    _operator_profile->set_metadata(_parent->node_id());
554
    // indent is false so that source operator will have same
555
    // indentation_level with its parent operator.
556
102
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
557
102
    _operator_profile->add_child(_common_profile.get(), true);
558
102
    _operator_profile->add_child(_custom_profile.get(), true);
559
102
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
560
102
    if constexpr (!is_fake_shared) {
561
102
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
562
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
563
0
                                    .first.get()
564
0
                                    ->template cast<SharedStateArg>();
565
566
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
567
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
568
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
569
102
        } else if (info.shared_state) {
570
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
571
                DCHECK(false);
572
            }
573
            // For UnionSourceOperator without children, there is no shared state.
574
102
            _shared_state = info.shared_state->template cast<SharedStateArg>();
575
576
102
            _dependency = _shared_state->create_source_dependency(
577
102
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
578
102
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
579
102
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
580
102
        } else {
581
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
582
                DCHECK(false);
583
            }
584
0
        }
585
102
    }
586
587
102
    if (must_set_shared_state() && _shared_state == nullptr) {
588
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
589
0
    }
590
591
102
    _rows_returned_counter =
592
102
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
593
102
    _blocks_returned_counter =
594
102
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
595
102
    _output_block_bytes_counter =
596
102
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
597
102
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
598
102
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
599
102
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
600
102
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
601
102
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
602
102
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
603
102
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
604
102
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
605
102
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
606
102
    _memory_used_counter =
607
102
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
608
102
    _common_profile->add_info_string("IsColocate",
609
102
                                     std::to_string(_parent->is_colocated_operator()));
610
102
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
611
102
    _common_profile->add_info_string("FollowedByShuffledOperator",
612
102
                                     std::to_string(_parent->followed_by_shuffled_operator()));
613
102
    return Status::OK();
614
102
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
549
13
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
550
13
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
551
13
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
552
13
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
553
13
    _operator_profile->set_metadata(_parent->node_id());
554
    // indent is false so that source operator will have same
555
    // indentation_level with its parent operator.
556
13
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
557
13
    _operator_profile->add_child(_common_profile.get(), true);
558
13
    _operator_profile->add_child(_custom_profile.get(), true);
559
13
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
560
13
    if constexpr (!is_fake_shared) {
561
13
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
562
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
563
0
                                    .first.get()
564
0
                                    ->template cast<SharedStateArg>();
565
566
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
567
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
568
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
569
13
        } else if (info.shared_state) {
570
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
571
                DCHECK(false);
572
            }
573
            // For UnionSourceOperator without children, there is no shared state.
574
13
            _shared_state = info.shared_state->template cast<SharedStateArg>();
575
576
13
            _dependency = _shared_state->create_source_dependency(
577
13
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
578
13
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
579
13
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
580
13
        } else {
581
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
582
                DCHECK(false);
583
            }
584
0
        }
585
13
    }
586
587
13
    if (must_set_shared_state() && _shared_state == nullptr) {
588
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
589
0
    }
590
591
13
    _rows_returned_counter =
592
13
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
593
13
    _blocks_returned_counter =
594
13
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
595
13
    _output_block_bytes_counter =
596
13
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
597
13
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
598
13
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
599
13
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
600
13
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
601
13
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
602
13
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
603
13
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
604
13
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
605
13
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
606
13
    _memory_used_counter =
607
13
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
608
13
    _common_profile->add_info_string("IsColocate",
609
13
                                     std::to_string(_parent->is_colocated_operator()));
610
13
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
611
13
    _common_profile->add_info_string("FollowedByShuffledOperator",
612
13
                                     std::to_string(_parent->followed_by_shuffled_operator()));
613
13
    return Status::OK();
614
13
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
549
150
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
550
150
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
551
150
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
552
150
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
553
150
    _operator_profile->set_metadata(_parent->node_id());
554
    // indent is false so that source operator will have same
555
    // indentation_level with its parent operator.
556
150
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
557
150
    _operator_profile->add_child(_common_profile.get(), true);
558
150
    _operator_profile->add_child(_custom_profile.get(), true);
559
150
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
560
150
    if constexpr (!is_fake_shared) {
561
150
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
562
150
            _shared_state = info.shared_state_map.at(_parent->operator_id())
563
150
                                    .first.get()
564
150
                                    ->template cast<SharedStateArg>();
565
566
150
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
567
150
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
568
150
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
569
150
        } else if (info.shared_state) {
570
0
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
571
0
                DCHECK(false);
572
0
            }
573
            // For UnionSourceOperator without children, there is no shared state.
574
0
            _shared_state = info.shared_state->template cast<SharedStateArg>();
575
576
0
            _dependency = _shared_state->create_source_dependency(
577
0
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
578
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
579
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
580
0
        } else {
581
0
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
582
0
                DCHECK(false);
583
0
            }
584
0
        }
585
150
    }
586
587
150
    if (must_set_shared_state() && _shared_state == nullptr) {
588
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
589
0
    }
590
591
150
    _rows_returned_counter =
592
150
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
593
150
    _blocks_returned_counter =
594
150
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
595
150
    _output_block_bytes_counter =
596
150
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
597
150
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
598
150
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
599
150
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
600
150
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
601
150
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
602
150
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
603
150
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
604
150
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
605
150
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
606
150
    _memory_used_counter =
607
150
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
608
150
    _common_profile->add_info_string("IsColocate",
609
150
                                     std::to_string(_parent->is_colocated_operator()));
610
150
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
611
150
    _common_profile->add_info_string("FollowedByShuffledOperator",
612
150
                                     std::to_string(_parent->followed_by_shuffled_operator()));
613
150
    return Status::OK();
614
150
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
615
616
template <typename SharedStateArg>
617
27.3k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
618
27.3k
    _conjuncts.resize(_parent->_conjuncts.size());
619
28.6k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
620
1.27k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
621
1.27k
    }
622
27.3k
    if (_parent->has_projection()) {
623
25.4k
        const auto& projection = *_parent->_projection;
624
25.4k
        _projections.resize(projection.projections.size());
625
100k
        for (size_t i = 0; i < _projections.size(); i++) {
626
74.9k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
627
74.9k
        }
628
25.4k
        _intermediate_projections.resize(projection.intermediate_projections.size());
629
25.5k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
630
80
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
631
480
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
632
400
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
633
400
                        state, _intermediate_projections[i][j]));
634
400
            }
635
80
        }
636
25.4k
    }
637
27.3k
    return Status::OK();
638
27.3k
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
617
24.0k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
618
24.0k
    _conjuncts.resize(_parent->_conjuncts.size());
619
24.0k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
620
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
621
0
    }
622
24.0k
    if (_parent->has_projection()) {
623
24.0k
        const auto& projection = *_parent->_projection;
624
24.0k
        _projections.resize(projection.projections.size());
625
89.9k
        for (size_t i = 0; i < _projections.size(); i++) {
626
65.9k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
627
65.9k
        }
628
24.0k
        _intermediate_projections.resize(projection.intermediate_projections.size());
629
24.0k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
630
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
631
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
632
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
633
0
                        state, _intermediate_projections[i][j]));
634
0
            }
635
0
        }
636
24.0k
    }
637
24.0k
    return Status::OK();
638
24.0k
}
_ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
617
3
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
618
3
    _conjuncts.resize(_parent->_conjuncts.size());
619
3
    for (size_t i = 0; i < _conjuncts.size(); i++) {
620
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
621
0
    }
622
3
    if (_parent->has_projection()) {
623
0
        const auto& projection = *_parent->_projection;
624
0
        _projections.resize(projection.projections.size());
625
0
        for (size_t i = 0; i < _projections.size(); i++) {
626
0
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
627
0
        }
628
0
        _intermediate_projections.resize(projection.intermediate_projections.size());
629
0
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
630
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
631
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
632
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
633
0
                        state, _intermediate_projections[i][j]));
634
0
            }
635
0
        }
636
0
    }
637
3
    return Status::OK();
638
3
}
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
617
134
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
618
134
    _conjuncts.resize(_parent->_conjuncts.size());
619
134
    for (size_t i = 0; i < _conjuncts.size(); i++) {
620
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
621
0
    }
622
134
    if (_parent->has_projection()) {
623
0
        const auto& projection = *_parent->_projection;
624
0
        _projections.resize(projection.projections.size());
625
0
        for (size_t i = 0; i < _projections.size(); i++) {
626
0
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
627
0
        }
628
0
        _intermediate_projections.resize(projection.intermediate_projections.size());
629
0
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
630
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
631
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
632
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
633
0
                        state, _intermediate_projections[i][j]));
634
0
            }
635
0
        }
636
0
    }
637
134
    return Status::OK();
638
134
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
617
15
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
618
15
    _conjuncts.resize(_parent->_conjuncts.size());
619
15
    for (size_t i = 0; i < _conjuncts.size(); i++) {
620
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
621
0
    }
622
15
    if (_parent->has_projection()) {
623
0
        const auto& projection = *_parent->_projection;
624
0
        _projections.resize(projection.projections.size());
625
0
        for (size_t i = 0; i < _projections.size(); i++) {
626
0
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
627
0
        }
628
0
        _intermediate_projections.resize(projection.intermediate_projections.size());
629
0
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
630
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
631
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
632
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
633
0
                        state, _intermediate_projections[i][j]));
634
0
            }
635
0
        }
636
0
    }
637
15
    return Status::OK();
638
15
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
617
192
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
618
192
    _conjuncts.resize(_parent->_conjuncts.size());
619
192
    for (size_t i = 0; i < _conjuncts.size(); i++) {
620
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
621
0
    }
622
192
    if (_parent->has_projection()) {
623
192
        const auto& projection = *_parent->_projection;
624
192
        _projections.resize(projection.projections.size());
625
1.72k
        for (size_t i = 0; i < _projections.size(); i++) {
626
1.53k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
627
1.53k
        }
628
192
        _intermediate_projections.resize(projection.intermediate_projections.size());
629
192
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
630
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
631
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
632
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
633
0
                        state, _intermediate_projections[i][j]));
634
0
            }
635
0
        }
636
192
    }
637
192
    return Status::OK();
638
192
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
617
16
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
618
16
    _conjuncts.resize(_parent->_conjuncts.size());
619
16
    for (size_t i = 0; i < _conjuncts.size(); i++) {
620
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
621
0
    }
622
16
    if (_parent->has_projection()) {
623
0
        const auto& projection = *_parent->_projection;
624
0
        _projections.resize(projection.projections.size());
625
0
        for (size_t i = 0; i < _projections.size(); i++) {
626
0
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
627
0
        }
628
0
        _intermediate_projections.resize(projection.intermediate_projections.size());
629
0
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
630
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
631
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
632
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
633
0
                        state, _intermediate_projections[i][j]));
634
0
            }
635
0
        }
636
0
    }
637
16
    return Status::OK();
638
16
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
617
587
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
618
587
    _conjuncts.resize(_parent->_conjuncts.size());
619
587
    for (size_t i = 0; i < _conjuncts.size(); i++) {
620
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
621
0
    }
622
587
    if (_parent->has_projection()) {
623
384
        const auto& projection = *_parent->_projection;
624
384
        _projections.resize(projection.projections.size());
625
2.20k
        for (size_t i = 0; i < _projections.size(); i++) {
626
1.82k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
627
1.82k
        }
628
384
        _intermediate_projections.resize(projection.intermediate_projections.size());
629
384
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
630
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
631
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
632
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
633
0
                        state, _intermediate_projections[i][j]));
634
0
            }
635
0
        }
636
384
    }
637
587
    return Status::OK();
638
587
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE4openEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
617
92
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
618
92
    _conjuncts.resize(_parent->_conjuncts.size());
619
92
    for (size_t i = 0; i < _conjuncts.size(); i++) {
620
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
621
0
    }
622
92
    if (_parent->has_projection()) {
623
78
        const auto& projection = *_parent->_projection;
624
78
        _projections.resize(projection.projections.size());
625
234
        for (size_t i = 0; i < _projections.size(); i++) {
626
156
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
627
156
        }
628
78
        _intermediate_projections.resize(projection.intermediate_projections.size());
629
78
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
630
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
631
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
632
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
633
0
                        state, _intermediate_projections[i][j]));
634
0
            }
635
0
        }
636
78
    }
637
92
    return Status::OK();
638
92
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
617
1.70k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
618
1.70k
    _conjuncts.resize(_parent->_conjuncts.size());
619
2.87k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
620
1.16k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
621
1.16k
    }
622
1.70k
    if (_parent->has_projection()) {
623
756
        const auto& projection = *_parent->_projection;
624
756
        _projections.resize(projection.projections.size());
625
6.13k
        for (size_t i = 0; i < _projections.size(); i++) {
626
5.38k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
627
5.38k
        }
628
756
        _intermediate_projections.resize(projection.intermediate_projections.size());
629
836
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
630
80
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
631
480
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
632
400
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
633
400
                        state, _intermediate_projections[i][j]));
634
400
            }
635
80
        }
636
756
    }
637
1.70k
    return Status::OK();
638
1.70k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
617
10
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
618
10
    _conjuncts.resize(_parent->_conjuncts.size());
619
10
    for (size_t i = 0; i < _conjuncts.size(); i++) {
620
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
621
0
    }
622
10
    if (_parent->has_projection()) {
623
8
        const auto& projection = *_parent->_projection;
624
8
        _projections.resize(projection.projections.size());
625
144
        for (size_t i = 0; i < _projections.size(); i++) {
626
136
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
627
136
        }
628
8
        _intermediate_projections.resize(projection.intermediate_projections.size());
629
8
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
630
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
631
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
632
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
633
0
                        state, _intermediate_projections[i][j]));
634
0
            }
635
0
        }
636
8
    }
637
10
    return Status::OK();
638
10
}
_ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
617
11
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
618
11
    _conjuncts.resize(_parent->_conjuncts.size());
619
11
    for (size_t i = 0; i < _conjuncts.size(); i++) {
620
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
621
0
    }
622
11
    if (_parent->has_projection()) {
623
0
        const auto& projection = *_parent->_projection;
624
0
        _projections.resize(projection.projections.size());
625
0
        for (size_t i = 0; i < _projections.size(); i++) {
626
0
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
627
0
        }
628
0
        _intermediate_projections.resize(projection.intermediate_projections.size());
629
0
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
630
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
631
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
632
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
633
0
                        state, _intermediate_projections[i][j]));
634
0
            }
635
0
        }
636
0
    }
637
11
    return Status::OK();
638
11
}
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
617
288
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
618
288
    _conjuncts.resize(_parent->_conjuncts.size());
619
396
    for (size_t i = 0; i < _conjuncts.size(); i++) {
620
108
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
621
108
    }
622
288
    if (_parent->has_projection()) {
623
0
        const auto& projection = *_parent->_projection;
624
0
        _projections.resize(projection.projections.size());
625
0
        for (size_t i = 0; i < _projections.size(); i++) {
626
0
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
627
0
        }
628
0
        _intermediate_projections.resize(projection.intermediate_projections.size());
629
0
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
630
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
631
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
632
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
633
0
                        state, _intermediate_projections[i][j]));
634
0
            }
635
0
        }
636
0
    }
637
288
    return Status::OK();
638
288
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
617
102
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
618
102
    _conjuncts.resize(_parent->_conjuncts.size());
619
102
    for (size_t i = 0; i < _conjuncts.size(); i++) {
620
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
621
0
    }
622
102
    if (_parent->has_projection()) {
623
0
        const auto& projection = *_parent->_projection;
624
0
        _projections.resize(projection.projections.size());
625
0
        for (size_t i = 0; i < _projections.size(); i++) {
626
0
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
627
0
        }
628
0
        _intermediate_projections.resize(projection.intermediate_projections.size());
629
0
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
630
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
631
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
632
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
633
0
                        state, _intermediate_projections[i][j]));
634
0
            }
635
0
        }
636
0
    }
637
102
    return Status::OK();
638
102
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
617
13
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
618
13
    _conjuncts.resize(_parent->_conjuncts.size());
619
13
    for (size_t i = 0; i < _conjuncts.size(); i++) {
620
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
621
0
    }
622
13
    if (_parent->has_projection()) {
623
0
        const auto& projection = *_parent->_projection;
624
0
        _projections.resize(projection.projections.size());
625
0
        for (size_t i = 0; i < _projections.size(); i++) {
626
0
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
627
0
        }
628
0
        _intermediate_projections.resize(projection.intermediate_projections.size());
629
0
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
630
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
631
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
632
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
633
0
                        state, _intermediate_projections[i][j]));
634
0
            }
635
0
        }
636
0
    }
637
13
    return Status::OK();
638
13
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
617
148
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
618
148
    _conjuncts.resize(_parent->_conjuncts.size());
619
148
    for (size_t i = 0; i < _conjuncts.size(); i++) {
620
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
621
0
    }
622
148
    if (_parent->has_projection()) {
623
0
        const auto& projection = *_parent->_projection;
624
0
        _projections.resize(projection.projections.size());
625
0
        for (size_t i = 0; i < _projections.size(); i++) {
626
0
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
627
0
        }
628
0
        _intermediate_projections.resize(projection.intermediate_projections.size());
629
0
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
630
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
631
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
632
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
633
0
                        state, _intermediate_projections[i][j]));
634
0
            }
635
0
        }
636
0
    }
637
148
    return Status::OK();
638
148
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE4openEPNS_12RuntimeStateE
639
640
template <typename SharedStateArg>
641
156
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
642
156
    if (_terminated) {
643
0
        return Status::OK();
644
0
    }
645
156
    _terminated = true;
646
156
    return Status::OK();
647
156
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
641
156
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
642
156
    if (_terminated) {
643
0
        return Status::OK();
644
0
    }
645
156
    _terminated = true;
646
156
    return Status::OK();
647
156
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE9terminateEPNS_12RuntimeStateE
648
649
template <typename SharedStateArg>
650
27.2k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
651
27.2k
    if (_closed) {
652
213
        return Status::OK();
653
213
    }
654
27.0k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
655
25.3k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
656
25.3k
    }
657
27.0k
    _closed = true;
658
27.0k
    return Status::OK();
659
27.2k
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
650
24.0k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
651
24.0k
    if (_closed) {
652
0
        return Status::OK();
653
0
    }
654
24.0k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
655
24.0k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
656
24.0k
    }
657
24.0k
    _closed = true;
658
24.0k
    return Status::OK();
659
24.0k
}
_ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
650
4
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
651
4
    if (_closed) {
652
0
        return Status::OK();
653
0
    }
654
4
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
655
4
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
656
4
    }
657
4
    _closed = true;
658
4
    return Status::OK();
659
4
}
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
650
220
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
651
220
    if (_closed) {
652
110
        return Status::OK();
653
110
    }
654
110
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
655
110
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
656
110
    }
657
110
    _closed = true;
658
110
    return Status::OK();
659
220
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
650
15
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
651
15
    if (_closed) {
652
0
        return Status::OK();
653
0
    }
654
15
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
655
15
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
656
15
    }
657
15
    _closed = true;
658
15
    return Status::OK();
659
15
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
650
192
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
651
192
    if (_closed) {
652
0
        return Status::OK();
653
0
    }
654
192
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
655
192
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
656
192
    }
657
192
    _closed = true;
658
192
    return Status::OK();
659
192
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
650
1
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
651
1
    if (_closed) {
652
0
        return Status::OK();
653
0
    }
654
1
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
655
1
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
656
1
    }
657
1
    _closed = true;
658
1
    return Status::OK();
659
1
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
650
470
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
651
470
    if (_closed) {
652
0
        return Status::OK();
653
0
    }
654
470
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
655
470
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
656
470
    }
657
470
    _closed = true;
658
470
    return Status::OK();
659
470
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE5closeEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
650
87
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
651
87
    if (_closed) {
652
0
        return Status::OK();
653
0
    }
654
87
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
655
87
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
656
87
    }
657
87
    _closed = true;
658
87
    return Status::OK();
659
87
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
650
1.80k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
651
1.80k
    if (_closed) {
652
103
        return Status::OK();
653
103
    }
654
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
655
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
656
    }
657
1.69k
    _closed = true;
658
1.69k
    return Status::OK();
659
1.80k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
650
8
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
651
8
    if (_closed) {
652
0
        return Status::OK();
653
0
    }
654
8
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
655
8
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
656
8
    }
657
8
    _closed = true;
658
8
    return Status::OK();
659
8
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE5closeEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
650
286
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
651
286
    if (_closed) {
652
0
        return Status::OK();
653
0
    }
654
286
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
655
286
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
656
286
    }
657
286
    _closed = true;
658
286
    return Status::OK();
659
286
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE5closeEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE5closeEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
650
150
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
651
150
    if (_closed) {
652
0
        return Status::OK();
653
0
    }
654
150
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
655
150
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
656
150
    }
657
150
    _closed = true;
658
150
    return Status::OK();
659
150
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE5closeEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE5closeEPNS_12RuntimeStateE
660
661
template <typename SharedState>
662
75.1k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
663
    // create profile
664
75.1k
    _operator_profile =
665
75.1k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
666
75.1k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
667
75.1k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
668
669
    // indentation is true
670
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
671
    // So we should set the indentation to true.
672
75.1k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
673
75.1k
    _operator_profile->add_child(_common_profile, true);
674
75.1k
    _operator_profile->add_child(_custom_profile, true);
675
676
75.1k
    _operator_profile->set_metadata(_parent->node_id());
677
75.1k
    _wait_for_finish_dependency_timer =
678
75.1k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
679
75.1k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
680
75.1k
    if constexpr (!is_fake_shared) {
681
74.0k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
682
74.0k
            info.shared_state_map.end()) {
683
18
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
684
18
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
685
18
            }
686
18
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
687
18
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
688
18
                                                  ? 0
689
18
                                                  : info.task_idx]
690
18
                                  .get();
691
18
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
692
74.0k
        } else {
693
74.0k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
694
0
                DCHECK(false);
695
0
            }
696
74.0k
            _shared_state = info.shared_state->template cast<SharedState>();
697
74.0k
            _dependency = _shared_state->create_sink_dependency(
698
74.0k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
699
74.0k
        }
700
74.0k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
701
74.0k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
702
74.0k
    }
703
704
75.1k
    if (must_set_shared_state() && _shared_state == nullptr) {
705
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
706
0
    }
707
708
75.1k
    _rows_input_counter =
709
75.1k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
710
75.1k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
711
75.1k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
712
75.1k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
713
75.1k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
714
75.1k
    _memory_used_counter =
715
75.1k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
716
75.1k
    _common_profile->add_info_string("IsColocate",
717
75.1k
                                     std::to_string(_parent->is_colocated_operator()));
718
75.1k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
719
75.1k
    _common_profile->add_info_string("FollowedByShuffledOperator",
720
75.1k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
721
75.1k
    return Status::OK();
722
75.1k
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
662
72.0k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
663
    // create profile
664
72.0k
    _operator_profile =
665
72.0k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
666
72.0k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
667
72.0k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
668
669
    // indentation is true
670
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
671
    // So we should set the indentation to true.
672
72.0k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
673
72.0k
    _operator_profile->add_child(_common_profile, true);
674
72.0k
    _operator_profile->add_child(_custom_profile, true);
675
676
72.0k
    _operator_profile->set_metadata(_parent->node_id());
677
72.0k
    _wait_for_finish_dependency_timer =
678
72.0k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
679
72.0k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
680
72.0k
    if constexpr (!is_fake_shared) {
681
72.0k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
682
72.0k
            info.shared_state_map.end()) {
683
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
684
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
685
            }
686
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
687
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
688
0
                                                  ? 0
689
0
                                                  : info.task_idx]
690
0
                                  .get();
691
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
692
72.0k
        } else {
693
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
694
                DCHECK(false);
695
            }
696
72.0k
            _shared_state = info.shared_state->template cast<SharedState>();
697
72.0k
            _dependency = _shared_state->create_sink_dependency(
698
72.0k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
699
72.0k
        }
700
72.0k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
701
72.0k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
702
72.0k
    }
703
704
72.0k
    if (must_set_shared_state() && _shared_state == nullptr) {
705
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
706
0
    }
707
708
72.0k
    _rows_input_counter =
709
72.0k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
710
72.0k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
711
72.0k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
712
72.0k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
713
72.0k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
714
72.0k
    _memory_used_counter =
715
72.0k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
716
72.0k
    _common_profile->add_info_string("IsColocate",
717
72.0k
                                     std::to_string(_parent->is_colocated_operator()));
718
72.0k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
719
72.0k
    _common_profile->add_info_string("FollowedByShuffledOperator",
720
72.0k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
721
72.0k
    return Status::OK();
722
72.0k
}
_ZN5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
662
2
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
663
    // create profile
664
2
    _operator_profile =
665
2
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
666
2
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
667
2
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
668
669
    // indentation is true
670
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
671
    // So we should set the indentation to true.
672
2
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
673
2
    _operator_profile->add_child(_common_profile, true);
674
2
    _operator_profile->add_child(_custom_profile, true);
675
676
2
    _operator_profile->set_metadata(_parent->node_id());
677
2
    _wait_for_finish_dependency_timer =
678
2
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
679
2
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
680
2
    if constexpr (!is_fake_shared) {
681
2
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
682
2
            info.shared_state_map.end()) {
683
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
684
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
685
            }
686
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
687
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
688
0
                                                  ? 0
689
0
                                                  : info.task_idx]
690
0
                                  .get();
691
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
692
2
        } else {
693
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
694
                DCHECK(false);
695
            }
696
2
            _shared_state = info.shared_state->template cast<SharedState>();
697
2
            _dependency = _shared_state->create_sink_dependency(
698
2
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
699
2
        }
700
2
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
701
2
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
702
2
    }
703
704
2
    if (must_set_shared_state() && _shared_state == nullptr) {
705
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
706
0
    }
707
708
2
    _rows_input_counter =
709
2
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
710
2
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
711
2
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
712
2
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
713
2
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
714
2
    _memory_used_counter =
715
2
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
716
2
    _common_profile->add_info_string("IsColocate",
717
2
                                     std::to_string(_parent->is_colocated_operator()));
718
2
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
719
2
    _common_profile->add_info_string("FollowedByShuffledOperator",
720
2
                                     std::to_string(_parent->followed_by_shuffled_operator()));
721
2
    return Status::OK();
722
2
}
_ZN5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
662
141
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
663
    // create profile
664
141
    _operator_profile =
665
141
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
666
141
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
667
141
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
668
669
    // indentation is true
670
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
671
    // So we should set the indentation to true.
672
141
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
673
141
    _operator_profile->add_child(_common_profile, true);
674
141
    _operator_profile->add_child(_custom_profile, true);
675
676
141
    _operator_profile->set_metadata(_parent->node_id());
677
141
    _wait_for_finish_dependency_timer =
678
141
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
679
141
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
680
141
    if constexpr (!is_fake_shared) {
681
141
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
682
141
            info.shared_state_map.end()) {
683
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
684
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
685
            }
686
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
687
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
688
0
                                                  ? 0
689
0
                                                  : info.task_idx]
690
0
                                  .get();
691
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
692
141
        } else {
693
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
694
                DCHECK(false);
695
            }
696
141
            _shared_state = info.shared_state->template cast<SharedState>();
697
141
            _dependency = _shared_state->create_sink_dependency(
698
141
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
699
141
        }
700
141
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
701
141
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
702
141
    }
703
704
141
    if (must_set_shared_state() && _shared_state == nullptr) {
705
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
706
0
    }
707
708
141
    _rows_input_counter =
709
141
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
710
141
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
711
141
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
712
141
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
713
141
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
714
141
    _memory_used_counter =
715
141
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
716
141
    _common_profile->add_info_string("IsColocate",
717
141
                                     std::to_string(_parent->is_colocated_operator()));
718
141
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
719
141
    _common_profile->add_info_string("FollowedByShuffledOperator",
720
141
                                     std::to_string(_parent->followed_by_shuffled_operator()));
721
141
    return Status::OK();
722
141
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
662
22
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
663
    // create profile
664
22
    _operator_profile =
665
22
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
666
22
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
667
22
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
668
669
    // indentation is true
670
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
671
    // So we should set the indentation to true.
672
22
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
673
22
    _operator_profile->add_child(_common_profile, true);
674
22
    _operator_profile->add_child(_custom_profile, true);
675
676
22
    _operator_profile->set_metadata(_parent->node_id());
677
22
    _wait_for_finish_dependency_timer =
678
22
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
679
22
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
680
22
    if constexpr (!is_fake_shared) {
681
22
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
682
22
            info.shared_state_map.end()) {
683
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
684
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
685
            }
686
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
687
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
688
0
                                                  ? 0
689
0
                                                  : info.task_idx]
690
0
                                  .get();
691
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
692
22
        } else {
693
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
694
                DCHECK(false);
695
            }
696
22
            _shared_state = info.shared_state->template cast<SharedState>();
697
22
            _dependency = _shared_state->create_sink_dependency(
698
22
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
699
22
        }
700
22
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
701
22
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
702
22
    }
703
704
22
    if (must_set_shared_state() && _shared_state == nullptr) {
705
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
706
0
    }
707
708
22
    _rows_input_counter =
709
22
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
710
22
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
711
22
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
712
22
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
713
22
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
714
22
    _memory_used_counter =
715
22
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
716
22
    _common_profile->add_info_string("IsColocate",
717
22
                                     std::to_string(_parent->is_colocated_operator()));
718
22
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
719
22
    _common_profile->add_info_string("FollowedByShuffledOperator",
720
22
                                     std::to_string(_parent->followed_by_shuffled_operator()));
721
22
    return Status::OK();
722
22
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
662
193
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
663
    // create profile
664
193
    _operator_profile =
665
193
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
666
193
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
667
193
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
668
669
    // indentation is true
670
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
671
    // So we should set the indentation to true.
672
193
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
673
193
    _operator_profile->add_child(_common_profile, true);
674
193
    _operator_profile->add_child(_custom_profile, true);
675
676
193
    _operator_profile->set_metadata(_parent->node_id());
677
193
    _wait_for_finish_dependency_timer =
678
193
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
679
193
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
680
193
    if constexpr (!is_fake_shared) {
681
193
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
682
193
            info.shared_state_map.end()) {
683
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
684
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
685
            }
686
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
687
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
688
0
                                                  ? 0
689
0
                                                  : info.task_idx]
690
0
                                  .get();
691
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
692
193
        } else {
693
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
694
                DCHECK(false);
695
            }
696
193
            _shared_state = info.shared_state->template cast<SharedState>();
697
193
            _dependency = _shared_state->create_sink_dependency(
698
193
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
699
193
        }
700
193
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
701
193
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
702
193
    }
703
704
193
    if (must_set_shared_state() && _shared_state == nullptr) {
705
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
706
0
    }
707
708
193
    _rows_input_counter =
709
193
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
710
193
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
711
193
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
712
193
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
713
193
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
714
193
    _memory_used_counter =
715
193
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
716
193
    _common_profile->add_info_string("IsColocate",
717
193
                                     std::to_string(_parent->is_colocated_operator()));
718
193
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
719
193
    _common_profile->add_info_string("FollowedByShuffledOperator",
720
193
                                     std::to_string(_parent->followed_by_shuffled_operator()));
721
193
    return Status::OK();
722
193
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
662
16
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
663
    // create profile
664
16
    _operator_profile =
665
16
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
666
16
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
667
16
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
668
669
    // indentation is true
670
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
671
    // So we should set the indentation to true.
672
16
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
673
16
    _operator_profile->add_child(_common_profile, true);
674
16
    _operator_profile->add_child(_custom_profile, true);
675
676
16
    _operator_profile->set_metadata(_parent->node_id());
677
16
    _wait_for_finish_dependency_timer =
678
16
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
679
16
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
680
16
    if constexpr (!is_fake_shared) {
681
16
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
682
16
            info.shared_state_map.end()) {
683
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
684
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
685
            }
686
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
687
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
688
0
                                                  ? 0
689
0
                                                  : info.task_idx]
690
0
                                  .get();
691
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
692
16
        } else {
693
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
694
                DCHECK(false);
695
            }
696
16
            _shared_state = info.shared_state->template cast<SharedState>();
697
16
            _dependency = _shared_state->create_sink_dependency(
698
16
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
699
16
        }
700
16
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
701
16
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
702
16
    }
703
704
16
    if (must_set_shared_state() && _shared_state == nullptr) {
705
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
706
0
    }
707
708
16
    _rows_input_counter =
709
16
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
710
16
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
711
16
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
712
16
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
713
16
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
714
16
    _memory_used_counter =
715
16
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
716
16
    _common_profile->add_info_string("IsColocate",
717
16
                                     std::to_string(_parent->is_colocated_operator()));
718
16
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
719
16
    _common_profile->add_info_string("FollowedByShuffledOperator",
720
16
                                     std::to_string(_parent->followed_by_shuffled_operator()));
721
16
    return Status::OK();
722
16
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
662
597
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
663
    // create profile
664
597
    _operator_profile =
665
597
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
666
597
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
667
597
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
668
669
    // indentation is true
670
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
671
    // So we should set the indentation to true.
672
597
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
673
597
    _operator_profile->add_child(_common_profile, true);
674
597
    _operator_profile->add_child(_custom_profile, true);
675
676
597
    _operator_profile->set_metadata(_parent->node_id());
677
597
    _wait_for_finish_dependency_timer =
678
597
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
679
597
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
680
597
    if constexpr (!is_fake_shared) {
681
597
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
682
597
            info.shared_state_map.end()) {
683
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
684
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
685
            }
686
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
687
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
688
0
                                                  ? 0
689
0
                                                  : info.task_idx]
690
0
                                  .get();
691
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
692
597
        } else {
693
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
694
                DCHECK(false);
695
            }
696
597
            _shared_state = info.shared_state->template cast<SharedState>();
697
597
            _dependency = _shared_state->create_sink_dependency(
698
597
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
699
597
        }
700
597
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
701
597
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
702
597
    }
703
704
597
    if (must_set_shared_state() && _shared_state == nullptr) {
705
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
706
0
    }
707
708
597
    _rows_input_counter =
709
597
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
710
597
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
711
597
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
712
597
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
713
597
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
714
597
    _memory_used_counter =
715
597
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
716
597
    _common_profile->add_info_string("IsColocate",
717
597
                                     std::to_string(_parent->is_colocated_operator()));
718
597
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
719
597
    _common_profile->add_info_string("FollowedByShuffledOperator",
720
597
                                     std::to_string(_parent->followed_by_shuffled_operator()));
721
597
    return Status::OK();
722
597
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
662
98
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
663
    // create profile
664
98
    _operator_profile =
665
98
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
666
98
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
667
98
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
668
669
    // indentation is true
670
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
671
    // So we should set the indentation to true.
672
98
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
673
98
    _operator_profile->add_child(_common_profile, true);
674
98
    _operator_profile->add_child(_custom_profile, true);
675
676
98
    _operator_profile->set_metadata(_parent->node_id());
677
98
    _wait_for_finish_dependency_timer =
678
98
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
679
98
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
680
98
    if constexpr (!is_fake_shared) {
681
98
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
682
98
            info.shared_state_map.end()) {
683
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
684
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
685
            }
686
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
687
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
688
0
                                                  ? 0
689
0
                                                  : info.task_idx]
690
0
                                  .get();
691
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
692
98
        } else {
693
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
694
                DCHECK(false);
695
            }
696
98
            _shared_state = info.shared_state->template cast<SharedState>();
697
98
            _dependency = _shared_state->create_sink_dependency(
698
98
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
699
98
        }
700
98
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
701
98
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
702
98
    }
703
704
98
    if (must_set_shared_state() && _shared_state == nullptr) {
705
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
706
0
    }
707
708
98
    _rows_input_counter =
709
98
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
710
98
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
711
98
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
712
98
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
713
98
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
714
98
    _memory_used_counter =
715
98
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
716
98
    _common_profile->add_info_string("IsColocate",
717
98
                                     std::to_string(_parent->is_colocated_operator()));
718
98
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
719
98
    _common_profile->add_info_string("FollowedByShuffledOperator",
720
98
                                     std::to_string(_parent->followed_by_shuffled_operator()));
721
98
    return Status::OK();
722
98
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
662
1.08k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
663
    // create profile
664
1.08k
    _operator_profile =
665
1.08k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
666
1.08k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
667
1.08k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
668
669
    // indentation is true
670
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
671
    // So we should set the indentation to true.
672
1.08k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
673
1.08k
    _operator_profile->add_child(_common_profile, true);
674
1.08k
    _operator_profile->add_child(_custom_profile, true);
675
676
1.08k
    _operator_profile->set_metadata(_parent->node_id());
677
1.08k
    _wait_for_finish_dependency_timer =
678
1.08k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
679
1.08k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
680
    if constexpr (!is_fake_shared) {
681
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
682
            info.shared_state_map.end()) {
683
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
684
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
685
            }
686
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
687
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
688
                                                  ? 0
689
                                                  : info.task_idx]
690
                                  .get();
691
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
692
        } else {
693
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
694
                DCHECK(false);
695
            }
696
            _shared_state = info.shared_state->template cast<SharedState>();
697
            _dependency = _shared_state->create_sink_dependency(
698
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
699
        }
700
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
701
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
702
    }
703
704
1.08k
    if (must_set_shared_state() && _shared_state == nullptr) {
705
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
706
0
    }
707
708
1.08k
    _rows_input_counter =
709
1.08k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
710
1.08k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
711
1.08k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
712
1.08k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
713
1.08k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
714
1.08k
    _memory_used_counter =
715
1.08k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
716
1.08k
    _common_profile->add_info_string("IsColocate",
717
1.08k
                                     std::to_string(_parent->is_colocated_operator()));
718
1.08k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
719
1.08k
    _common_profile->add_info_string("FollowedByShuffledOperator",
720
1.08k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
721
1.08k
    return Status::OK();
722
1.08k
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
662
3
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
663
    // create profile
664
3
    _operator_profile =
665
3
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
666
3
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
667
3
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
668
669
    // indentation is true
670
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
671
    // So we should set the indentation to true.
672
3
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
673
3
    _operator_profile->add_child(_common_profile, true);
674
3
    _operator_profile->add_child(_custom_profile, true);
675
676
3
    _operator_profile->set_metadata(_parent->node_id());
677
3
    _wait_for_finish_dependency_timer =
678
3
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
679
3
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
680
3
    if constexpr (!is_fake_shared) {
681
3
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
682
3
            info.shared_state_map.end()) {
683
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
684
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
685
            }
686
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
687
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
688
0
                                                  ? 0
689
0
                                                  : info.task_idx]
690
0
                                  .get();
691
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
692
3
        } else {
693
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
694
                DCHECK(false);
695
            }
696
3
            _shared_state = info.shared_state->template cast<SharedState>();
697
3
            _dependency = _shared_state->create_sink_dependency(
698
3
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
699
3
        }
700
3
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
701
3
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
702
3
    }
703
704
3
    if (must_set_shared_state() && _shared_state == nullptr) {
705
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
706
0
    }
707
708
3
    _rows_input_counter =
709
3
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
710
3
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
711
3
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
712
3
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
713
3
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
714
3
    _memory_used_counter =
715
3
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
716
3
    _common_profile->add_info_string("IsColocate",
717
3
                                     std::to_string(_parent->is_colocated_operator()));
718
3
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
719
3
    _common_profile->add_info_string("FollowedByShuffledOperator",
720
3
                                     std::to_string(_parent->followed_by_shuffled_operator()));
721
3
    return Status::OK();
722
3
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
662
102
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
663
    // create profile
664
102
    _operator_profile =
665
102
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
666
102
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
667
102
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
668
669
    // indentation is true
670
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
671
    // So we should set the indentation to true.
672
102
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
673
102
    _operator_profile->add_child(_common_profile, true);
674
102
    _operator_profile->add_child(_custom_profile, true);
675
676
102
    _operator_profile->set_metadata(_parent->node_id());
677
102
    _wait_for_finish_dependency_timer =
678
102
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
679
102
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
680
102
    if constexpr (!is_fake_shared) {
681
102
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
682
102
            info.shared_state_map.end()) {
683
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
684
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
685
            }
686
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
687
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
688
0
                                                  ? 0
689
0
                                                  : info.task_idx]
690
0
                                  .get();
691
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
692
102
        } else {
693
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
694
                DCHECK(false);
695
            }
696
102
            _shared_state = info.shared_state->template cast<SharedState>();
697
102
            _dependency = _shared_state->create_sink_dependency(
698
102
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
699
102
        }
700
102
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
701
102
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
702
102
    }
703
704
102
    if (must_set_shared_state() && _shared_state == nullptr) {
705
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
706
0
    }
707
708
102
    _rows_input_counter =
709
102
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
710
102
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
711
102
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
712
102
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
713
102
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
714
102
    _memory_used_counter =
715
102
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
716
102
    _common_profile->add_info_string("IsColocate",
717
102
                                     std::to_string(_parent->is_colocated_operator()));
718
102
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
719
102
    _common_profile->add_info_string("FollowedByShuffledOperator",
720
102
                                     std::to_string(_parent->followed_by_shuffled_operator()));
721
102
    return Status::OK();
722
102
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
662
96
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
663
    // create profile
664
96
    _operator_profile =
665
96
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
666
96
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
667
96
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
668
669
    // indentation is true
670
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
671
    // So we should set the indentation to true.
672
96
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
673
96
    _operator_profile->add_child(_common_profile, true);
674
96
    _operator_profile->add_child(_custom_profile, true);
675
676
96
    _operator_profile->set_metadata(_parent->node_id());
677
96
    _wait_for_finish_dependency_timer =
678
96
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
679
96
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
680
96
    if constexpr (!is_fake_shared) {
681
96
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
682
96
            info.shared_state_map.end()) {
683
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
684
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
685
            }
686
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
687
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
688
0
                                                  ? 0
689
0
                                                  : info.task_idx]
690
0
                                  .get();
691
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
692
96
        } else {
693
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
694
                DCHECK(false);
695
            }
696
96
            _shared_state = info.shared_state->template cast<SharedState>();
697
96
            _dependency = _shared_state->create_sink_dependency(
698
96
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
699
96
        }
700
96
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
701
96
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
702
96
    }
703
704
96
    if (must_set_shared_state() && _shared_state == nullptr) {
705
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
706
0
    }
707
708
96
    _rows_input_counter =
709
96
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
710
96
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
711
96
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
712
96
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
713
96
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
714
96
    _memory_used_counter =
715
96
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
716
96
    _common_profile->add_info_string("IsColocate",
717
96
                                     std::to_string(_parent->is_colocated_operator()));
718
96
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
719
96
    _common_profile->add_info_string("FollowedByShuffledOperator",
720
96
                                     std::to_string(_parent->followed_by_shuffled_operator()));
721
96
    return Status::OK();
722
96
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
662
29
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
663
    // create profile
664
29
    _operator_profile =
665
29
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
666
29
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
667
29
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
668
669
    // indentation is true
670
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
671
    // So we should set the indentation to true.
672
29
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
673
29
    _operator_profile->add_child(_common_profile, true);
674
29
    _operator_profile->add_child(_custom_profile, true);
675
676
29
    _operator_profile->set_metadata(_parent->node_id());
677
29
    _wait_for_finish_dependency_timer =
678
29
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
679
29
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
680
29
    if constexpr (!is_fake_shared) {
681
29
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
682
29
            info.shared_state_map.end()) {
683
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
684
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
685
            }
686
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
687
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
688
0
                                                  ? 0
689
0
                                                  : info.task_idx]
690
0
                                  .get();
691
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
692
29
        } else {
693
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
694
                DCHECK(false);
695
            }
696
29
            _shared_state = info.shared_state->template cast<SharedState>();
697
29
            _dependency = _shared_state->create_sink_dependency(
698
29
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
699
29
        }
700
29
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
701
29
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
702
29
    }
703
704
29
    if (must_set_shared_state() && _shared_state == nullptr) {
705
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
706
0
    }
707
708
29
    _rows_input_counter =
709
29
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
710
29
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
711
29
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
712
29
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
713
29
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
714
29
    _memory_used_counter =
715
29
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
716
29
    _common_profile->add_info_string("IsColocate",
717
29
                                     std::to_string(_parent->is_colocated_operator()));
718
29
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
719
29
    _common_profile->add_info_string("FollowedByShuffledOperator",
720
29
                                     std::to_string(_parent->followed_by_shuffled_operator()));
721
29
    return Status::OK();
722
29
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
662
18
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
663
    // create profile
664
18
    _operator_profile =
665
18
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
666
18
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
667
18
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
668
669
    // indentation is true
670
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
671
    // So we should set the indentation to true.
672
18
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
673
18
    _operator_profile->add_child(_common_profile, true);
674
18
    _operator_profile->add_child(_custom_profile, true);
675
676
18
    _operator_profile->set_metadata(_parent->node_id());
677
18
    _wait_for_finish_dependency_timer =
678
18
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
679
18
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
680
18
    if constexpr (!is_fake_shared) {
681
18
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
682
18
            info.shared_state_map.end()) {
683
18
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
684
18
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
685
18
            }
686
18
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
687
18
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
688
18
                                                  ? 0
689
18
                                                  : info.task_idx]
690
18
                                  .get();
691
18
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
692
18
        } else {
693
0
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
694
0
                DCHECK(false);
695
0
            }
696
0
            _shared_state = info.shared_state->template cast<SharedState>();
697
0
            _dependency = _shared_state->create_sink_dependency(
698
0
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
699
0
        }
700
18
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
701
18
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
702
18
    }
703
704
18
    if (must_set_shared_state() && _shared_state == nullptr) {
705
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
706
0
    }
707
708
18
    _rows_input_counter =
709
18
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
710
18
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
711
18
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
712
18
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
713
18
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
714
18
    _memory_used_counter =
715
18
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
716
18
    _common_profile->add_info_string("IsColocate",
717
18
                                     std::to_string(_parent->is_colocated_operator()));
718
18
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
719
18
    _common_profile->add_info_string("FollowedByShuffledOperator",
720
18
                                     std::to_string(_parent->followed_by_shuffled_operator()));
721
18
    return Status::OK();
722
18
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
662
656
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
663
    // create profile
664
656
    _operator_profile =
665
656
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
666
656
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
667
656
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
668
669
    // indentation is true
670
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
671
    // So we should set the indentation to true.
672
656
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
673
656
    _operator_profile->add_child(_common_profile, true);
674
656
    _operator_profile->add_child(_custom_profile, true);
675
676
656
    _operator_profile->set_metadata(_parent->node_id());
677
656
    _wait_for_finish_dependency_timer =
678
656
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
679
656
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
680
656
    if constexpr (!is_fake_shared) {
681
656
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
682
656
            info.shared_state_map.end()) {
683
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
684
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
685
            }
686
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
687
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
688
0
                                                  ? 0
689
0
                                                  : info.task_idx]
690
0
                                  .get();
691
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
692
656
        } else {
693
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
694
                DCHECK(false);
695
            }
696
656
            _shared_state = info.shared_state->template cast<SharedState>();
697
656
            _dependency = _shared_state->create_sink_dependency(
698
656
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
699
656
        }
700
656
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
701
656
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
702
656
    }
703
704
656
    if (must_set_shared_state() && _shared_state == nullptr) {
705
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
706
0
    }
707
708
656
    _rows_input_counter =
709
656
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
710
656
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
711
656
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
712
656
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
713
656
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
714
656
    _memory_used_counter =
715
656
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
716
656
    _common_profile->add_info_string("IsColocate",
717
656
                                     std::to_string(_parent->is_colocated_operator()));
718
656
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
719
656
    _common_profile->add_info_string("FollowedByShuffledOperator",
720
656
                                     std::to_string(_parent->followed_by_shuffled_operator()));
721
656
    return Status::OK();
722
656
}
_ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
662
11
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
663
    // create profile
664
11
    _operator_profile =
665
11
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
666
11
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
667
11
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
668
669
    // indentation is true
670
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
671
    // So we should set the indentation to true.
672
11
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
673
11
    _operator_profile->add_child(_common_profile, true);
674
11
    _operator_profile->add_child(_custom_profile, true);
675
676
11
    _operator_profile->set_metadata(_parent->node_id());
677
11
    _wait_for_finish_dependency_timer =
678
11
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
679
11
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
680
11
    if constexpr (!is_fake_shared) {
681
11
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
682
11
            info.shared_state_map.end()) {
683
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
684
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
685
            }
686
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
687
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
688
0
                                                  ? 0
689
0
                                                  : info.task_idx]
690
0
                                  .get();
691
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
692
11
        } else {
693
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
694
                DCHECK(false);
695
            }
696
11
            _shared_state = info.shared_state->template cast<SharedState>();
697
11
            _dependency = _shared_state->create_sink_dependency(
698
11
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
699
11
        }
700
11
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
701
11
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
702
11
    }
703
704
11
    if (must_set_shared_state() && _shared_state == nullptr) {
705
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
706
0
    }
707
708
11
    _rows_input_counter =
709
11
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
710
11
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
711
11
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
712
11
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
713
11
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
714
11
    _memory_used_counter =
715
11
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
716
11
    _common_profile->add_info_string("IsColocate",
717
11
                                     std::to_string(_parent->is_colocated_operator()));
718
11
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
719
11
    _common_profile->add_info_string("FollowedByShuffledOperator",
720
11
                                     std::to_string(_parent->followed_by_shuffled_operator()));
721
11
    return Status::OK();
722
11
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
723
724
template <typename SharedState>
725
74.7k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
726
74.7k
    if (_closed) {
727
2
        return Status::OK();
728
2
    }
729
74.7k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
730
73.6k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
731
73.6k
    }
732
74.7k
    _closed = true;
733
74.7k
    return Status::OK();
734
74.7k
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
725
72.0k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
726
72.0k
    if (_closed) {
727
0
        return Status::OK();
728
0
    }
729
72.0k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
730
72.0k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
731
72.0k
    }
732
72.0k
    _closed = true;
733
72.0k
    return Status::OK();
734
72.0k
}
_ZN5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
725
1
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
726
1
    if (_closed) {
727
0
        return Status::OK();
728
0
    }
729
1
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
730
1
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
731
1
    }
732
1
    _closed = true;
733
1
    return Status::OK();
734
1
}
_ZN5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
725
110
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
726
110
    if (_closed) {
727
0
        return Status::OK();
728
0
    }
729
110
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
730
110
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
731
110
    }
732
110
    _closed = true;
733
110
    return Status::OK();
734
110
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
725
13
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
726
13
    if (_closed) {
727
2
        return Status::OK();
728
2
    }
729
11
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
730
11
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
731
11
    }
732
11
    _closed = true;
733
11
    return Status::OK();
734
13
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
725
193
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
726
193
    if (_closed) {
727
0
        return Status::OK();
728
0
    }
729
193
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
730
193
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
731
193
    }
732
193
    _closed = true;
733
193
    return Status::OK();
734
193
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
725
1
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
726
1
    if (_closed) {
727
0
        return Status::OK();
728
0
    }
729
1
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
730
1
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
731
1
    }
732
1
    _closed = true;
733
1
    return Status::OK();
734
1
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
725
470
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
726
470
    if (_closed) {
727
0
        return Status::OK();
728
0
    }
729
470
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
730
470
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
731
470
    }
732
470
    _closed = true;
733
470
    return Status::OK();
734
470
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
725
87
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
726
87
    if (_closed) {
727
0
        return Status::OK();
728
0
    }
729
87
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
730
87
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
731
87
    }
732
87
    _closed = true;
733
87
    return Status::OK();
734
87
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
725
1.07k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
726
1.07k
    if (_closed) {
727
0
        return Status::OK();
728
0
    }
729
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
730
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
731
    }
732
1.07k
    _closed = true;
733
1.07k
    return Status::OK();
734
1.07k
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
725
96
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
726
96
    if (_closed) {
727
0
        return Status::OK();
728
0
    }
729
96
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
730
96
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
731
96
    }
732
96
    _closed = true;
733
96
    return Status::OK();
734
96
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
725
18
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
726
18
    if (_closed) {
727
0
        return Status::OK();
728
0
    }
729
18
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
730
18
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
731
18
    }
732
18
    _closed = true;
733
18
    return Status::OK();
734
18
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
725
640
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
726
640
    if (_closed) {
727
0
        return Status::OK();
728
0
    }
729
640
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
730
640
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
731
640
    }
732
640
    _closed = true;
733
640
    return Status::OK();
734
640
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
735
736
template <typename LocalStateType>
737
Status StreamingOperatorX<LocalStateType>::get_block_impl(RuntimeState* state, Block* block,
738
3.93k
                                                          bool* eos) {
739
3.93k
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
740
3.93k
    return pull(state, block, eos);
741
3.93k
}
_ZN5doris18StreamingOperatorXINS_23AssertNumRowsLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
738
4
                                                          bool* eos) {
739
4
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
740
4
    return pull(state, block, eos);
741
4
}
_ZN5doris18StreamingOperatorXINS_16SelectLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
738
3.93k
                                                          bool* eos) {
739
3.93k
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
740
3.93k
    return pull(state, block, eos);
741
3.93k
}
742
743
template <typename LocalStateType>
744
Status StatefulOperatorX<LocalStateType>::get_block_impl(RuntimeState* state, Block* block,
745
408
                                                         bool* eos) {
746
408
    auto& local_state = get_local_state(state);
747
408
    if (need_more_input_data(state)) {
748
402
        local_state._child_block->clear_column_data(
749
402
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
750
402
                        .num_materialized_slots());
751
402
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
752
402
                state, local_state._child_block.get(), &local_state._child_eos));
753
402
        *eos = local_state._child_eos;
754
402
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
755
98
            return Status::OK();
756
98
        }
757
304
        {
758
304
            SCOPED_TIMER(local_state.exec_time_counter());
759
304
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
760
304
        }
761
304
    }
762
763
310
    if (!need_more_input_data(state)) {
764
310
        SCOPED_TIMER(local_state.exec_time_counter());
765
310
        bool new_eos = false;
766
310
        RETURN_IF_ERROR(pull(state, block, &new_eos));
767
310
        if (new_eos) {
768
227
            *eos = true;
769
227
        } else if (!need_more_input_data(state)) {
770
0
            *eos = false;
771
0
        }
772
310
    }
773
310
    return Status::OK();
774
310
}
_ZN5doris17StatefulOperatorXINS_23HashJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
745
60
                                                         bool* eos) {
746
60
    auto& local_state = get_local_state(state);
747
60
    if (need_more_input_data(state)) {
748
54
        local_state._child_block->clear_column_data(
749
54
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
750
54
                        .num_materialized_slots());
751
54
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
752
54
                state, local_state._child_block.get(), &local_state._child_eos));
753
54
        *eos = local_state._child_eos;
754
54
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
755
2
            return Status::OK();
756
2
        }
757
52
        {
758
52
            SCOPED_TIMER(local_state.exec_time_counter());
759
52
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
760
52
        }
761
52
    }
762
763
58
    if (!need_more_input_data(state)) {
764
58
        SCOPED_TIMER(local_state.exec_time_counter());
765
58
        bool new_eos = false;
766
58
        RETURN_IF_ERROR(pull(state, block, &new_eos));
767
58
        if (new_eos) {
768
33
            *eos = true;
769
33
        } else if (!need_more_input_data(state)) {
770
0
            *eos = false;
771
0
        }
772
58
    }
773
58
    return Status::OK();
774
58
}
Unexecuted instantiation: _ZN5doris17StatefulOperatorXINS_34PartitionedHashJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Unexecuted instantiation: _ZN5doris17StatefulOperatorXINS_16RepeatLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Unexecuted instantiation: _ZN5doris17StatefulOperatorXINS_25MaterializationLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Unexecuted instantiation: _ZN5doris17StatefulOperatorXINS_22StreamingAggLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
_ZN5doris17StatefulOperatorXINS_30DistinctStreamingAggLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
745
2
                                                         bool* eos) {
746
2
    auto& local_state = get_local_state(state);
747
2
    if (need_more_input_data(state)) {
748
2
        local_state._child_block->clear_column_data(
749
2
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
750
2
                        .num_materialized_slots());
751
2
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
752
2
                state, local_state._child_block.get(), &local_state._child_eos));
753
2
        *eos = local_state._child_eos;
754
2
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
755
0
            return Status::OK();
756
0
        }
757
2
        {
758
2
            SCOPED_TIMER(local_state.exec_time_counter());
759
2
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
760
2
        }
761
2
    }
762
763
2
    if (!need_more_input_data(state)) {
764
2
        SCOPED_TIMER(local_state.exec_time_counter());
765
2
        bool new_eos = false;
766
2
        RETURN_IF_ERROR(pull(state, block, &new_eos));
767
2
        if (new_eos) {
768
2
            *eos = true;
769
2
        } else if (!need_more_input_data(state)) {
770
0
            *eos = false;
771
0
        }
772
2
    }
773
2
    return Status::OK();
774
2
}
_ZN5doris17StatefulOperatorXINS_29NestedLoopJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
745
346
                                                         bool* eos) {
746
346
    auto& local_state = get_local_state(state);
747
346
    if (need_more_input_data(state)) {
748
346
        local_state._child_block->clear_column_data(
749
346
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
750
346
                        .num_materialized_slots());
751
346
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
752
346
                state, local_state._child_block.get(), &local_state._child_eos));
753
346
        *eos = local_state._child_eos;
754
346
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
755
96
            return Status::OK();
756
96
        }
757
250
        {
758
250
            SCOPED_TIMER(local_state.exec_time_counter());
759
250
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
760
250
        }
761
250
    }
762
763
250
    if (!need_more_input_data(state)) {
764
250
        SCOPED_TIMER(local_state.exec_time_counter());
765
250
        bool new_eos = false;
766
250
        RETURN_IF_ERROR(pull(state, block, &new_eos));
767
250
        if (new_eos) {
768
192
            *eos = true;
769
192
        } else if (!need_more_input_data(state)) {
770
0
            *eos = false;
771
0
        }
772
250
    }
773
250
    return Status::OK();
774
250
}
Unexecuted instantiation: _ZN5doris17StatefulOperatorXINS_23TableFunctionLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
775
776
template <typename Writer, typename Parent>
777
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
778
24
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
779
24
    RETURN_IF_ERROR(Base::init(state, info));
780
24
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
781
24
                                                         "AsyncWriterDependency", true);
782
24
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
783
24
                             _finish_dependency));
784
785
24
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
786
24
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
787
24
    return Status::OK();
788
24
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
778
16
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
779
16
    RETURN_IF_ERROR(Base::init(state, info));
780
16
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
781
16
                                                         "AsyncWriterDependency", true);
782
16
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
783
16
                             _finish_dependency));
784
785
16
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
786
16
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
787
16
    return Status::OK();
788
16
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
778
8
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
779
8
    RETURN_IF_ERROR(Base::init(state, info));
780
8
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
781
8
                                                         "AsyncWriterDependency", true);
782
8
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
783
8
                             _finish_dependency));
784
785
8
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
786
8
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
787
8
    return Status::OK();
788
8
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_18VIcebergDeleteSinkENS_26IcebergDeleteSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_17VIcebergMergeSinkENS_25IcebergMergeSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
789
790
template <typename Writer, typename Parent>
791
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
792
24
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
793
24
    RETURN_IF_ERROR(Base::open(state));
794
24
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
795
240
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
796
216
        RETURN_IF_ERROR(
797
216
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
798
216
    }
799
24
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
800
24
    return Status::OK();
801
24
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4openEPNS_12RuntimeStateE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
792
16
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
793
16
    RETURN_IF_ERROR(Base::open(state));
794
16
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
795
96
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
796
80
        RETURN_IF_ERROR(
797
80
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
798
80
    }
799
16
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
800
16
    return Status::OK();
801
16
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
792
8
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
793
8
    RETURN_IF_ERROR(Base::open(state));
794
8
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
795
144
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
796
136
        RETURN_IF_ERROR(
797
136
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
798
136
    }
799
8
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
800
8
    return Status::OK();
801
8
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_18VIcebergDeleteSinkENS_26IcebergDeleteSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_17VIcebergMergeSinkENS_25IcebergMergeSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE4openEPNS_12RuntimeStateE
802
803
template <typename Writer, typename Parent>
804
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
805
82
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
806
82
    return _writer->sink(block, eos);
807
82
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
805
74
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
806
74
    return _writer->sink(block, eos);
807
74
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
805
8
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
806
8
    return _writer->sink(block, eos);
807
8
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_18VIcebergDeleteSinkENS_26IcebergDeleteSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_17VIcebergMergeSinkENS_25IcebergMergeSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
808
809
template <typename Writer, typename Parent>
810
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
811
24
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
812
24
    if (_closed) {
813
0
        return Status::OK();
814
0
    }
815
24
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
816
24
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
817
    // if the init failed, the _writer may be nullptr. so here need check
818
24
    if (_writer) {
819
24
        Status st = _writer->get_writer_status();
820
24
        if (exec_status.ok()) {
821
24
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
822
24
                                                       : Status::Cancelled("force close"));
823
24
        } else {
824
0
            _writer->force_close(exec_status);
825
0
        }
826
        // If there is an error in process_block thread, then we should get the writer
827
        // status before call force_close. For example, the thread may failed in commit
828
        // transaction.
829
24
        RETURN_IF_ERROR(st);
830
24
    }
831
24
    return Base::close(state, exec_status);
832
24
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
811
16
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
812
16
    if (_closed) {
813
0
        return Status::OK();
814
0
    }
815
16
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
816
16
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
817
    // if the init failed, the _writer may be nullptr. so here need check
818
16
    if (_writer) {
819
16
        Status st = _writer->get_writer_status();
820
16
        if (exec_status.ok()) {
821
16
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
822
16
                                                       : Status::Cancelled("force close"));
823
16
        } else {
824
0
            _writer->force_close(exec_status);
825
0
        }
826
        // If there is an error in process_block thread, then we should get the writer
827
        // status before call force_close. For example, the thread may failed in commit
828
        // transaction.
829
16
        RETURN_IF_ERROR(st);
830
16
    }
831
16
    return Base::close(state, exec_status);
832
16
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
811
8
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
812
8
    if (_closed) {
813
0
        return Status::OK();
814
0
    }
815
8
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
816
8
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
817
    // if the init failed, the _writer may be nullptr. so here need check
818
8
    if (_writer) {
819
8
        Status st = _writer->get_writer_status();
820
8
        if (exec_status.ok()) {
821
8
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
822
8
                                                       : Status::Cancelled("force close"));
823
8
        } else {
824
0
            _writer->force_close(exec_status);
825
0
        }
826
        // If there is an error in process_block thread, then we should get the writer
827
        // status before call force_close. For example, the thread may failed in commit
828
        // transaction.
829
8
        RETURN_IF_ERROR(st);
830
8
    }
831
8
    return Base::close(state, exec_status);
832
8
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_18VIcebergDeleteSinkENS_26IcebergDeleteSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_17VIcebergMergeSinkENS_25IcebergMergeSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
833
834
// An instantiation added outside the macros below needs the matching
835
// 'extern template' declaration in the operator's header (enforced by
836
// build-support/check-extern-template-pairing.py). Instantiations expanded
837
// through DECLARE_OPERATOR are invisible to that check -- macro bodies are
838
// skipped -- so their extern pairing has to be kept in sync by hand.
839
#define DECLARE_OPERATOR(LOCAL_STATE) template class DataSinkOperatorX<LOCAL_STATE>;
840
DECLARE_OPERATOR(HashJoinBuildSinkLocalState)
841
DECLARE_OPERATOR(ResultSinkLocalState)
842
DECLARE_OPERATOR(JdbcTableSinkLocalState)
843
DECLARE_OPERATOR(MemoryScratchSinkLocalState)
844
DECLARE_OPERATOR(ResultFileSinkLocalState)
845
DECLARE_OPERATOR(OlapTableSinkLocalState)
846
DECLARE_OPERATOR(OlapTableSinkV2LocalState)
847
DECLARE_OPERATOR(HiveTableSinkLocalState)
848
DECLARE_OPERATOR(TVFTableSinkLocalState)
849
DECLARE_OPERATOR(IcebergTableSinkLocalState)
850
DECLARE_OPERATOR(PaimonTableSinkLocalState)
851
DECLARE_OPERATOR(SpillIcebergTableSinkLocalState)
852
DECLARE_OPERATOR(IcebergDeleteSinkLocalState)
853
DECLARE_OPERATOR(IcebergMergeSinkLocalState)
854
DECLARE_OPERATOR(MCTableSinkLocalState)
855
DECLARE_OPERATOR(AnalyticSinkLocalState)
856
DECLARE_OPERATOR(BlackholeSinkLocalState)
857
DECLARE_OPERATOR(SortSinkLocalState)
858
DECLARE_OPERATOR(SpillSortSinkLocalState)
859
DECLARE_OPERATOR(LocalExchangeSinkLocalState)
860
DECLARE_OPERATOR(AggSinkLocalState)
861
DECLARE_OPERATOR(BucketedAggSinkLocalState)
862
DECLARE_OPERATOR(PartitionedAggSinkLocalState)
863
DECLARE_OPERATOR(ExchangeSinkLocalState)
864
DECLARE_OPERATOR(NestedLoopJoinBuildSinkLocalState)
865
DECLARE_OPERATOR(UnionSinkLocalState)
866
DECLARE_OPERATOR(MultiCastDataStreamSinkLocalState)
867
DECLARE_OPERATOR(PartitionSortSinkLocalState)
868
DECLARE_OPERATOR(SetProbeSinkLocalState<true>)
869
DECLARE_OPERATOR(SetProbeSinkLocalState<false>)
870
DECLARE_OPERATOR(SetSinkLocalState<true>)
871
DECLARE_OPERATOR(SetSinkLocalState<false>)
872
DECLARE_OPERATOR(PartitionedHashJoinSinkLocalState)
873
DECLARE_OPERATOR(GroupCommitBlockSinkLocalState)
874
DECLARE_OPERATOR(CacheSinkLocalState)
875
DECLARE_OPERATOR(DictSinkLocalState)
876
DECLARE_OPERATOR(RecCTESinkLocalState)
877
DECLARE_OPERATOR(RecCTEAnchorSinkLocalState)
878
879
#undef DECLARE_OPERATOR
880
881
#define DECLARE_OPERATOR(LOCAL_STATE) template class OperatorX<LOCAL_STATE>;
882
DECLARE_OPERATOR(HashJoinProbeLocalState)
883
DECLARE_OPERATOR(OlapScanLocalState)
884
DECLARE_OPERATOR(GroupCommitLocalState)
885
DECLARE_OPERATOR(JDBCScanLocalState)
886
DECLARE_OPERATOR(FileScanLocalState)
887
DECLARE_OPERATOR(AnalyticLocalState)
888
DECLARE_OPERATOR(SortLocalState)
889
DECLARE_OPERATOR(SpillSortLocalState)
890
DECLARE_OPERATOR(LocalMergeSortLocalState)
891
DECLARE_OPERATOR(AggLocalState)
892
DECLARE_OPERATOR(BucketedAggLocalState)
893
DECLARE_OPERATOR(PartitionedAggLocalState)
894
DECLARE_OPERATOR(TableFunctionLocalState)
895
DECLARE_OPERATOR(ExchangeLocalState)
896
DECLARE_OPERATOR(RepeatLocalState)
897
DECLARE_OPERATOR(NestedLoopJoinProbeLocalState)
898
DECLARE_OPERATOR(AssertNumRowsLocalState)
899
DECLARE_OPERATOR(EmptySetLocalState)
900
DECLARE_OPERATOR(UnionSourceLocalState)
901
DECLARE_OPERATOR(MultiCastDataStreamSourceLocalState)
902
DECLARE_OPERATOR(PartitionSortSourceLocalState)
903
DECLARE_OPERATOR(SetSourceLocalState<true>)
904
DECLARE_OPERATOR(SetSourceLocalState<false>)
905
DECLARE_OPERATOR(DataGenLocalState)
906
DECLARE_OPERATOR(SchemaScanLocalState)
907
DECLARE_OPERATOR(MetaScanLocalState)
908
DECLARE_OPERATOR(LocalExchangeSourceLocalState)
909
DECLARE_OPERATOR(PartitionedHashJoinProbeLocalState)
910
DECLARE_OPERATOR(CacheSourceLocalState)
911
DECLARE_OPERATOR(RecCTESourceLocalState)
912
DECLARE_OPERATOR(RecCTEScanLocalState)
913
914
#ifdef BE_TEST
915
DECLARE_OPERATOR(MockLocalState)
916
DECLARE_OPERATOR(MockScanLocalState)
917
#endif
918
#undef DECLARE_OPERATOR
919
920
template class StreamingOperatorX<AssertNumRowsLocalState>;
921
template class StreamingOperatorX<SelectLocalState>;
922
923
template class StatefulOperatorX<HashJoinProbeLocalState>;
924
template class StatefulOperatorX<PartitionedHashJoinProbeLocalState>;
925
template class StatefulOperatorX<RepeatLocalState>;
926
template class StatefulOperatorX<MaterializationLocalState>;
927
template class StatefulOperatorX<StreamingAggLocalState>;
928
template class StatefulOperatorX<DistinctStreamingAggLocalState>;
929
template class StatefulOperatorX<NestedLoopJoinProbeLocalState>;
930
template class StatefulOperatorX<TableFunctionLocalState>;
931
932
template class PipelineXSinkLocalState<HashJoinSharedState>;
933
template class PipelineXSinkLocalState<PartitionedHashJoinSharedState>;
934
template class PipelineXSinkLocalState<SortSharedState>;
935
template class PipelineXSinkLocalState<SpillSortSharedState>;
936
template class PipelineXSinkLocalState<NestedLoopJoinSharedState>;
937
template class PipelineXSinkLocalState<AnalyticSharedState>;
938
template class PipelineXSinkLocalState<AggSharedState>;
939
template class PipelineXSinkLocalState<BucketedAggSharedState>;
940
template class PipelineXSinkLocalState<PartitionedAggSharedState>;
941
template class PipelineXSinkLocalState<FakeSharedState>;
942
template class PipelineXSinkLocalState<UnionSharedState>;
943
template class PipelineXSinkLocalState<PartitionSortNodeSharedState>;
944
template class PipelineXSinkLocalState<MultiCastSharedState>;
945
template class PipelineXSinkLocalState<SetSharedState>;
946
template class PipelineXSinkLocalState<LocalExchangeSharedState>;
947
template class PipelineXSinkLocalState<BasicSharedState>;
948
template class PipelineXSinkLocalState<DataQueueSharedState>;
949
template class PipelineXSinkLocalState<RecCTESharedState>;
950
951
template class PipelineXLocalState<HashJoinSharedState>;
952
template class PipelineXLocalState<PartitionedHashJoinSharedState>;
953
template class PipelineXLocalState<SortSharedState>;
954
template class PipelineXLocalState<SpillSortSharedState>;
955
template class PipelineXLocalState<NestedLoopJoinSharedState>;
956
template class PipelineXLocalState<AnalyticSharedState>;
957
template class PipelineXLocalState<AggSharedState>;
958
template class PipelineXLocalState<BucketedAggSharedState>;
959
template class PipelineXLocalState<PartitionedAggSharedState>;
960
template class PipelineXLocalState<FakeSharedState>;
961
template class PipelineXLocalState<UnionSharedState>;
962
template class PipelineXLocalState<DataQueueSharedState>;
963
template class PipelineXLocalState<MultiCastSharedState>;
964
template class PipelineXLocalState<PartitionSortNodeSharedState>;
965
template class PipelineXLocalState<SetSharedState>;
966
template class PipelineXLocalState<LocalExchangeSharedState>;
967
template class PipelineXLocalState<BasicSharedState>;
968
template class PipelineXLocalState<RecCTESharedState>;
969
970
template class AsyncWriterSink<doris::VFileResultWriter, ResultFileSinkOperatorX>;
971
template class AsyncWriterSink<doris::VJdbcTableWriter, JdbcTableSinkOperatorX>;
972
template class AsyncWriterSink<doris::VTabletWriter, OlapTableSinkOperatorX>;
973
template class AsyncWriterSink<doris::VTabletWriterV2, OlapTableSinkV2OperatorX>;
974
template class AsyncWriterSink<doris::VHiveTableWriter, HiveTableSinkOperatorX>;
975
template class AsyncWriterSink<doris::VIcebergTableWriter, IcebergTableSinkOperatorX>;
976
template class AsyncWriterSink<doris::VIcebergTableWriter, SpillIcebergTableSinkOperatorX>;
977
template class AsyncWriterSink<doris::VIcebergDeleteSink, IcebergDeleteSinkOperatorX>;
978
template class AsyncWriterSink<doris::VIcebergMergeSink, IcebergMergeSinkOperatorX>;
979
template class AsyncWriterSink<doris::VMCTableWriter, MCTableSinkOperatorX>;
980
template class AsyncWriterSink<doris::VTVFTableWriter, TVFTableSinkOperatorX>;
981
982
#ifdef BE_TEST
983
template class OperatorX<DummyOperatorLocalState>;
984
template class DataSinkOperatorX<DummySinkLocalState>;
985
#endif
986
987
} // namespace doris