Coverage Report

Created: 2026-09-16 07:21

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