Coverage Report

Created: 2026-07-11 14:18

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