Coverage Report

Created: 2026-07-09 16:22

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