Coverage Report

Created: 2026-04-08 13:21

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