Coverage Report

Created: 2026-06-10 12:49

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