Coverage Report

Created: 2026-10-09 07:21

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