Coverage Report

Created: 2026-08-18 12:47

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