Coverage Report

Created: 2026-09-09 15:29

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.74M
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
1.74M
    if (_parent->nereids_id() == -1) {
122
896k
        return fmt::format("(id={})", _parent->node_id());
123
896k
    } else {
124
844k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
844k
    }
126
1.74M
}
_ZNK5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
71.1k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
71.1k
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
71.1k
    } else {
124
71.1k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
71.1k
    }
126
71.1k
}
_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
193k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
193k
    if (_parent->nereids_id() == -1) {
122
12
        return fmt::format("(id={})", _parent->node_id());
123
193k
    } else {
124
193k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
193k
    }
126
193k
}
_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
7.01k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
7.01k
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
7.01k
    } else {
124
7.01k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
7.01k
    }
126
7.01k
}
_ZNK5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
8.29k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
8.29k
    if (_parent->nereids_id() == -1) {
122
12
        return fmt::format("(id={})", _parent->node_id());
123
8.28k
    } else {
124
8.28k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
8.28k
    }
126
8.29k
}
_ZNK5doris19PipelineXLocalStateINS_14AggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
85.8k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
85.8k
    if (_parent->nereids_id() == -1) {
122
29
        return fmt::format("(id={})", _parent->node_id());
123
85.8k
    } else {
124
85.8k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
85.8k
    }
126
85.8k
}
_ZNK5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
100k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
100k
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
100k
    } else {
124
100k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
100k
    }
126
100k
}
_ZNK5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
58
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
58
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
58
    } else {
124
58
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
58
    }
126
58
}
_ZNK5doris19PipelineXLocalStateINS_15FakeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
583k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
583k
    if (_parent->nereids_id() == -1) {
122
263k
        return fmt::format("(id={})", _parent->node_id());
123
320k
    } else {
124
320k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
320k
    }
126
583k
}
_ZNK5doris19PipelineXLocalStateINS_16UnionSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
53.7k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
53.7k
    if (_parent->nereids_id() == -1) {
122
2
        return fmt::format("(id={})", _parent->node_id());
123
53.7k
    } else {
124
53.7k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
53.7k
    }
126
53.7k
}
_ZNK5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
26
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
26
    if (_parent->nereids_id() == -1) {
122
26
        return fmt::format("(id={})", _parent->node_id());
123
26
    } else {
124
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
0
    }
126
26
}
_ZNK5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
6.09k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
6.09k
    if (_parent->nereids_id() == -1) {
122
6.09k
        return fmt::format("(id={})", _parent->node_id());
123
18.4E
    } else {
124
18.4E
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
18.4E
    }
126
6.09k
}
_ZNK5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
519
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
519
    if (_parent->nereids_id() == -1) {
122
102
        return fmt::format("(id={})", _parent->node_id());
123
417
    } else {
124
417
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
417
    }
126
519
}
_ZNK5doris19PipelineXLocalStateINS_14SetSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
4.82k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
4.82k
    if (_parent->nereids_id() == -1) {
122
13
        return fmt::format("(id={})", _parent->node_id());
123
4.81k
    } else {
124
4.81k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
4.81k
    }
126
4.82k
}
_ZNK5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
625k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
626k
    if (_parent->nereids_id() == -1) {
122
626k
        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
625k
}
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_16BasicSharedStateEE11name_suffixB5cxx11Ev
_ZNK5doris19PipelineXLocalStateINS_17RecCTESharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
164
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
164
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
164
    } else {
124
164
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
164
    }
126
164
}
127
128
template <typename SharedStateArg>
129
1.18M
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
1.18M
    if (_parent->nereids_id() == -1) {
131
663k
        return fmt::format("(id={})", _parent->node_id());
132
663k
    } else {
133
524k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
524k
    }
135
1.18M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
119k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
119k
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
119k
    } else {
133
119k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
119k
    }
135
119k
}
_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
194k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
194k
    if (_parent->nereids_id() == -1) {
131
9
        return fmt::format("(id={})", _parent->node_id());
132
194k
    } else {
133
194k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
194k
    }
135
194k
}
_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
7.02k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
7.02k
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
7.02k
    } else {
133
7.02k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
7.02k
    }
135
7.02k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
8.35k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
8.35k
    if (_parent->nereids_id() == -1) {
131
12
        return fmt::format("(id={})", _parent->node_id());
132
8.34k
    } else {
133
8.34k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
8.34k
    }
135
8.35k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
86.4k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
86.4k
    if (_parent->nereids_id() == -1) {
131
29
        return fmt::format("(id={})", _parent->node_id());
132
86.3k
    } else {
133
86.3k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
86.3k
    }
135
86.4k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
99.4k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
99.4k
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
99.4k
    } else {
133
99.4k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
99.4k
    }
135
99.4k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
68
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
68
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
68
    } else {
133
68
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
68
    }
135
68
}
_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
9.27k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
9.27k
    if (_parent->nereids_id() == -1) {
131
3
        return fmt::format("(id={})", _parent->node_id());
132
9.27k
    } else {
133
9.27k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
9.27k
    }
135
9.27k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
518
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
518
    if (_parent->nereids_id() == -1) {
131
102
        return fmt::format("(id={})", _parent->node_id());
132
416
    } else {
133
416
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
416
    }
135
518
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE11name_suffixB5cxx11Ev
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
12.3k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
12.4k
    if (_parent->nereids_id() == -1) {
131
12.4k
        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.3k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
215k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
215k
    if (_parent->nereids_id() == -1) {
131
215k
        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
215k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
434k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
435k
    if (_parent->nereids_id() == -1) {
131
435k
        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
434k
}
_ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
25
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
25
    if (_parent->nereids_id() == -1) {
131
25
        return fmt::format("(id={})", _parent->node_id());
132
25
    } else {
133
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
0
    }
135
25
}
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
328
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
328
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
328
    } else {
133
328
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
328
    }
135
328
}
136
137
template <typename SharedStateArg>
138
30.3k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
30.3k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
30.3k
    _terminated = true;
143
30.3k
    return Status::OK();
144
30.3k
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
24.0k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
24.0k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
24.0k
    _terminated = true;
143
24.0k
    return Status::OK();
144
24.0k
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
2.50k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
2.50k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
2.50k
    _terminated = true;
143
2.50k
    return Status::OK();
144
2.50k
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
1
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
1
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
1
    _terminated = true;
143
1
    return Status::OK();
144
1
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
7
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
7
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
7
    _terminated = true;
143
7
    return Status::OK();
144
7
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
1.84k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
1.84k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
1.84k
    _terminated = true;
143
1.84k
    return Status::OK();
144
1.84k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
642
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
642
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
642
    _terminated = true;
143
642
    return Status::OK();
144
642
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
600
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
600
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
600
    _terminated = true;
143
600
    return Status::OK();
144
600
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
167
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
167
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
167
    _terminated = true;
143
167
    return Status::OK();
144
167
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
5
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
5
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
5
    _terminated = true;
143
5
    return Status::OK();
144
5
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
166
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
166
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
166
    _terminated = true;
143
166
    return Status::OK();
144
166
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
16
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
16
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
16
    _terminated = true;
143
16
    return Status::OK();
144
16
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
170
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
170
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
170
    _terminated = true;
143
170
    return Status::OK();
144
170
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
123
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
123
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
123
    _terminated = true;
143
123
    return Status::OK();
144
123
}
145
146
294k
DataDistribution OperatorBase::required_data_distribution(RuntimeState* /*state*/) const {
147
294k
    return _child && _child->is_serial_operator() && !is_source()
148
294k
                   ? DataDistribution(TLocalPartitionType::PASSTHROUGH)
149
294k
                   : DataDistribution(TLocalPartitionType::NOOP);
150
294k
}
151
152
25.0k
bool OperatorBase::child_breaks_local_key_distribution(RuntimeState* state) const {
153
25.0k
    if (!_child) {
154
24.0k
        return false;
155
24.0k
    }
156
983
    if (_child->is_serial_operator()) {
157
90
        return true;
158
90
    }
159
893
    const auto child_distribution = _child->required_data_distribution(state);
160
893
    return child_distribution.need_local_exchange() &&
161
893
           !is_shuffled_exchange(child_distribution.distribution_type);
162
983
}
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.2k
std::string OperatorXBase::debug_string(int indentation_level) const {
179
20.2k
    fmt::memory_buffer debug_string_buffer;
180
20.2k
    fmt::format_to(debug_string_buffer, "{}{}: id={}, parallel_tasks={}, _is_serial_operator={}",
181
20.2k
                   std::string(indentation_level * 2, ' '), _op_name, node_id(), _parallel_tasks,
182
20.2k
                   _is_serial_operator);
183
20.2k
    return fmt::to_string(debug_string_buffer);
184
20.2k
}
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
623k
Status OperatorXBase::init(const TPlanNode& tnode, RuntimeState* state) {
191
623k
    std::string node_name = print_plan_node_type(tnode.node_type);
192
623k
    _nereids_id = tnode.nereids_id;
193
623k
    if (!tnode.intermediate_output_tuple_id_list.empty()) {
194
3.78k
        if (!has_projection()) {
195
0
            return Status::InternalError("no final output tuple id");
196
0
        }
197
3.78k
        if (tnode.intermediate_output_tuple_id_list.size() !=
198
3.78k
            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.78k
    }
206
623k
    auto substr = node_name.substr(0, node_name.find("_NODE"));
207
623k
    _op_name = substr + "_OPERATOR";
208
209
623k
    if (tnode.__isset.vconjunct) {
210
0
        return Status::InternalError("vconjunct is not supported yet");
211
623k
    } else if (tnode.__isset.conjuncts) {
212
264k
        for (const auto& conjunct : tnode.conjuncts) {
213
264k
            VExprContextSPtr context;
214
264k
            RETURN_IF_ERROR(VExpr::create_expr_tree(conjunct, context));
215
264k
            _conjuncts.emplace_back(context);
216
264k
        }
217
92.6k
    }
218
219
    // create the projections expr
220
623k
    if (tnode.__isset.projections) {
221
247k
        RETURN_IF_ERROR(VExpr::create_expr_trees(tnode.projections, _projection->projections));
222
247k
    }
223
623k
    if (!tnode.intermediate_projections_list.empty()) {
224
3.78k
        DCHECK(has_projection()) << "no final projections";
225
3.78k
        _projection->intermediate_projections.reserve(tnode.intermediate_projections_list.size());
226
6.16k
        for (const auto& tnode_projections : tnode.intermediate_projections_list) {
227
6.16k
            VExprContextSPtrs projections;
228
6.16k
            RETURN_IF_ERROR(VExpr::create_expr_trees(tnode_projections, projections));
229
6.16k
            _projection->intermediate_projections.push_back(projections);
230
6.16k
        }
231
3.78k
    }
232
623k
    return Status::OK();
233
623k
}
234
235
650k
Status OperatorXBase::prepare(RuntimeState* state) {
236
650k
    for (auto& conjunct : _conjuncts) {
237
264k
        RETURN_IF_ERROR(conjunct->prepare(state, operator_row_desc_before_projection()));
238
264k
    }
239
650k
    if (state->enable_adjust_conjunct_order_by_cost()) {
240
600k
        std::ranges::stable_sort(_conjuncts, [](const auto& a, const auto& b) {
241
336k
            return a->execute_cost() < b->execute_cost();
242
336k
        });
243
600k
    };
244
245
650k
    if (has_projection()) {
246
247k
        auto& projection = *_projection;
247
253k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
248
6.16k
            const auto& input_row_desc =
249
6.16k
                    i == 0 ? operator_row_desc_before_projection()
250
6.16k
                           : projection.intermediate_output_row_descriptors[i - 1];
251
6.16k
            RETURN_IF_ERROR(
252
6.16k
                    VExpr::prepare(projection.intermediate_projections[i], state, input_row_desc));
253
6.16k
        }
254
247k
        const auto& final_projection_input_row_desc =
255
247k
                projection.intermediate_output_row_descriptors.empty()
256
247k
                        ? operator_row_desc_before_projection()
257
247k
                        : projection.intermediate_output_row_descriptors.back();
258
247k
        RETURN_IF_ERROR(
259
247k
                VExpr::prepare(projection.projections, state, final_projection_input_row_desc));
260
247k
        RETURN_IF_ERROR(VExpr::check_expr_output_type(projection.projections,
261
247k
                                                      projection.output_row_descriptor));
262
247k
    }
263
264
650k
    for (auto& conjunct : _conjuncts) {
265
264k
        RETURN_IF_ERROR(conjunct->open(state));
266
264k
    }
267
650k
    if (has_projection()) {
268
247k
        RETURN_IF_ERROR(VExpr::open(_projection->projections, state));
269
247k
        for (auto& projections : _projection->intermediate_projections) {
270
6.16k
            RETURN_IF_ERROR(VExpr::open(projections, state));
271
6.16k
        }
272
247k
    }
273
650k
    if (_child && !is_source()) {
274
95.7k
        RETURN_IF_ERROR(_child->prepare(state));
275
95.7k
    }
276
277
650k
    if (VExpr::contains_blockable_function(_conjuncts) ||
278
650k
        (has_projection() && VExpr::contains_blockable_function(_projection->projections))) {
279
0
        _blockable = true;
280
0
    }
281
282
650k
    return Status::OK();
283
650k
}
284
285
6.91k
Status OperatorXBase::terminate(RuntimeState* state) {
286
6.91k
    if (_child && !is_source()) {
287
604
        RETURN_IF_ERROR(_child->terminate(state));
288
604
    }
289
6.91k
    auto result = state->get_local_state_result(operator_id());
290
6.91k
    if (!result) {
291
0
        return result.error();
292
0
    }
293
6.91k
    return result.value()->terminate(state);
294
6.91k
}
295
296
4.72M
Status OperatorXBase::close(RuntimeState* state) {
297
4.72M
    if (_child && !is_source()) {
298
785k
        RETURN_IF_ERROR(_child->close(state));
299
785k
    }
300
4.72M
    auto result = state->get_local_state_result(operator_id());
301
4.72M
    if (!result) {
302
0
        return result.error();
303
0
    }
304
4.72M
    return result.value()->close(state);
305
4.72M
}
306
307
280k
void PipelineXLocalStateBase::clear_origin_block() {
308
280k
    _origin_block.clear_column_data(
309
280k
            _parent->operator_row_desc_before_projection().num_materialized_slots());
310
280k
}
311
312
927k
Status PipelineXLocalStateBase::filter_block(const VExprContextSPtrs& expr_contexts, Block* block) {
313
927k
    RETURN_IF_ERROR(VExprContext::filter_block(expr_contexts, block, block->columns()));
314
315
927k
    _estimate_memory_usage += VExprContext::get_memory_usage(expr_contexts);
316
927k
    return Status::OK();
317
927k
}
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
280k
                                     Block* output_block) const {
326
280k
    auto* local_state = state->get_local_state(operator_id());
327
280k
    SCOPED_TIMER(local_state->exec_time_counter());
328
280k
    SCOPED_TIMER(local_state->_projection_timer);
329
280k
    const size_t rows = origin_block->rows();
330
280k
    if (rows == 0) {
331
152k
        return Status::OK();
332
152k
    }
333
128k
    SCOPED_PEAK_MEM(&local_state->_estimate_memory_usage);
334
335
128k
    {
336
128k
        Block input_block = *origin_block;
337
338
128k
        ColumnsWithTypeAndName new_columns;
339
128k
        for (const auto& projections : local_state->_intermediate_projections) {
340
3.12k
            if (projections.empty()) {
341
0
                return Status::InternalError("meet empty intermediate projection, node id: {}",
342
0
                                             node_id());
343
0
            }
344
3.12k
            new_columns.resize(projections.size());
345
61.7k
            for (int i = 0; i < projections.size(); i++) {
346
58.6k
                RETURN_IF_ERROR(projections[i]->execute(&input_block, new_columns[i]));
347
58.6k
                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
58.6k
            }
355
3.11k
            Block tmp_block {new_columns};
356
3.11k
            input_block.swap(tmp_block);
357
3.11k
        }
358
359
128k
        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
128k
        auto scoped_mutable_block = VectorizedUtils::build_scoped_mutable_mem_reuse_block(
367
128k
                output_block, _projection->output_row_descriptor);
368
128k
        auto& mutable_columns = scoped_mutable_block.mutable_columns();
369
128k
        DCHECK_EQ(mutable_columns.size(), local_state->_projections.size()) << debug_string();
370
128k
        Columns shared_columns(mutable_columns.size());
371
372
728k
        for (int i = 0; i < mutable_columns.size(); ++i) {
373
600k
            ColumnPtr column_ptr;
374
600k
            RETURN_IF_ERROR(local_state->_projections[i]->execute(&input_block, column_ptr));
375
600k
            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
600k
            column_ptr = column_ptr->convert_to_full_column_if_const();
382
600k
            if (is_column_nullable(*mutable_columns[i]) && !is_column_nullable(*column_ptr)) {
383
0
                column_ptr = make_nullable(column_ptr, false);
384
0
            }
385
600k
            if (column_ptr->is_exclusive()) {
386
223k
                mutable_columns[i] = IColumn::mutate(std::move(column_ptr));
387
377k
            } else {
388
377k
                shared_columns[i] = std::move(column_ptr);
389
377k
            }
390
600k
        }
391
392
128k
        scoped_mutable_block.restore();
393
728k
        for (int i = 0; i < shared_columns.size(); ++i) {
394
600k
            if (shared_columns[i]) {
395
377k
                output_block->replace_by_position(i, std::move(shared_columns[i]));
396
377k
            }
397
600k
        }
398
128k
    }
399
400
0
    origin_block->clear_column_data(
401
128k
            local_state->_parent->operator_row_desc_before_projection().num_materialized_slots());
402
128k
    DCHECK_EQ(output_block->rows(), rows);
403
404
128k
    return Status::OK();
405
128k
}
406
407
4.45M
Status OperatorXBase::get_block_after_projects(RuntimeState* state, Block* block, bool* eos) {
408
4.45M
    DBUG_EXECUTE_IF("Pipeline::return_empty_block", {
409
4.45M
        if (this->_op_name == "AGGREGATION_OPERATOR" || this->_op_name == "HASH_JOIN_OPERATOR" ||
410
4.45M
            this->_op_name == "PARTITIONED_AGGREGATION_OPERATOR" ||
411
4.45M
            this->_op_name == "PARTITIONED_HASH_JOIN_OPERATOR" ||
412
4.45M
            this->_op_name == "CROSS_JOIN_OPERATOR" || this->_op_name == "SORT_OPERATOR") {
413
4.45M
            if (_debug_point_count++ % 2 == 0) {
414
4.45M
                return Status::OK();
415
4.45M
            }
416
4.45M
        }
417
4.45M
    });
418
419
4.45M
    Status status;
420
4.45M
    auto* local_state = state->get_local_state(operator_id());
421
4.46M
    Defer defer([&]() {
422
4.46M
        if (status.ok()) {
423
4.46M
            local_state->update_output_block_counters(*block);
424
4.46M
        }
425
4.46M
    });
426
4.45M
    if (has_projection()) {
427
280k
        local_state->clear_origin_block();
428
280k
        status = get_block(state, &local_state->_origin_block, eos);
429
280k
        if (UNLIKELY(!status.ok())) {
430
25
            return status;
431
25
        }
432
280k
        status = do_projections(state, &local_state->_origin_block, block);
433
280k
        return status;
434
280k
    }
435
4.17M
    status = get_block(state, block, eos);
436
4.17M
    RETURN_IF_ERROR(block->check_type_and_column());
437
4.17M
    return status;
438
4.17M
}
439
440
2.84M
void PipelineXLocalStateBase::reached_limit(Block* block, bool* eos) {
441
2.84M
    if (_parent->_limit != -1 and _num_rows_returned + block->rows() >= _parent->_limit) {
442
4.08k
        block->set_num_rows(_parent->_limit - _num_rows_returned);
443
4.08k
        *eos = true;
444
4.08k
    }
445
446
2.84M
    DBUG_EXECUTE_IF("Pipeline::reached_limit_early", {
447
2.84M
        auto op_name = to_lower(_parent->_op_name);
448
2.84M
        auto arg_op_name = dp->param<std::string>("op_name");
449
2.84M
        arg_op_name = to_lower(arg_op_name);
450
451
2.84M
        if (op_name == arg_op_name) {
452
2.84M
            *eos = true;
453
2.84M
        }
454
2.84M
    });
455
456
2.84M
    if (auto rows = block->rows()) {
457
705k
        _num_rows_returned += rows;
458
705k
        _state->get_query_ctx()->resource_ctx()->io_context()->update_process_rows(rows);
459
705k
    }
460
2.84M
}
461
462
30.3k
Status DataSinkOperatorXBase::terminate(RuntimeState* state) {
463
30.3k
    auto result = state->get_sink_local_state_result();
464
30.3k
    if (!result) {
465
0
        return result.error();
466
0
    }
467
30.3k
    return result.value()->terminate(state);
468
30.3k
}
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
325k
Status DataSinkOperatorXBase::init(const TDataSink& tsink) {
483
325k
    std::string op_name = "UNKNOWN_SINK";
484
325k
    auto it = _TDataSinkType_VALUES_TO_NAMES.find(tsink.type);
485
486
326k
    if (it != _TDataSinkType_VALUES_TO_NAMES.end()) {
487
326k
        op_name = it->second;
488
326k
    }
489
325k
    _name = op_name + "_OPERATOR";
490
325k
    return Status::OK();
491
325k
}
492
493
275k
Status DataSinkOperatorXBase::init(const TPlanNode& tnode, RuntimeState* state) {
494
275k
    std::string op_name = print_plan_node_type(tnode.node_type);
495
275k
    _nereids_id = tnode.nereids_id;
496
275k
    auto substr = op_name.substr(0, op_name.find("_NODE"));
497
275k
    _name = substr + "_SINK_OPERATOR";
498
275k
    return Status::OK();
499
275k
}
500
501
template <typename LocalStateType>
502
Status DataSinkOperatorX<LocalStateType>::setup_local_state(RuntimeState* state,
503
1.67M
                                                            LocalSinkStateInfo& info) {
504
1.67M
    auto local_state = LocalStateType::create_unique(this, state);
505
1.67M
    RETURN_IF_ERROR(local_state->init(state, info));
506
1.67M
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
1.67M
    return Status::OK();
508
1.67M
}
_ZN5doris17DataSinkOperatorXINS_27HashJoinBuildSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
119k
                                                            LocalSinkStateInfo& info) {
504
119k
    auto local_state = LocalStateType::create_unique(this, state);
505
119k
    RETURN_IF_ERROR(local_state->init(state, info));
506
119k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
119k
    return Status::OK();
508
119k
}
_ZN5doris17DataSinkOperatorXINS_20ResultSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
391k
                                                            LocalSinkStateInfo& info) {
504
391k
    auto local_state = LocalStateType::create_unique(this, state);
505
391k
    RETURN_IF_ERROR(local_state->init(state, info));
506
391k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
391k
    return Status::OK();
508
391k
}
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
353
                                                            LocalSinkStateInfo& info) {
504
353
    auto local_state = LocalStateType::create_unique(this, state);
505
353
    RETURN_IF_ERROR(local_state->init(state, info));
506
353
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
353
    return Status::OK();
508
353
}
_ZN5doris17DataSinkOperatorXINS_23OlapTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
44.9k
                                                            LocalSinkStateInfo& info) {
504
44.9k
    auto local_state = LocalStateType::create_unique(this, state);
505
44.9k
    RETURN_IF_ERROR(local_state->init(state, info));
506
44.9k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
44.9k
    return Status::OK();
508
44.9k
}
_ZN5doris17DataSinkOperatorXINS_25OlapTableSinkV2LocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
7
                                                            LocalSinkStateInfo& info) {
504
7
    auto local_state = LocalStateType::create_unique(this, state);
505
7
    RETURN_IF_ERROR(local_state->init(state, info));
506
7
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
7
    return Status::OK();
508
7
}
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
8.36k
                                                            LocalSinkStateInfo& info) {
504
8.36k
    auto local_state = LocalStateType::create_unique(this, state);
505
8.36k
    RETURN_IF_ERROR(local_state->init(state, info));
506
8.36k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
8.36k
    return Status::OK();
508
8.36k
}
_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
194k
                                                            LocalSinkStateInfo& info) {
504
194k
    auto local_state = LocalStateType::create_unique(this, state);
505
194k
    RETURN_IF_ERROR(local_state->init(state, info));
506
194k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
194k
    return Status::OK();
508
194k
}
_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
215k
                                                            LocalSinkStateInfo& info) {
504
215k
    auto local_state = LocalStateType::create_unique(this, state);
505
215k
    RETURN_IF_ERROR(local_state->init(state, info));
506
215k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
215k
    return Status::OK();
508
215k
}
_ZN5doris17DataSinkOperatorXINS_17AggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
86.5k
                                                            LocalSinkStateInfo& info) {
504
86.5k
    auto local_state = LocalStateType::create_unique(this, state);
505
86.5k
    RETURN_IF_ERROR(local_state->init(state, info));
506
86.5k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
86.5k
    return Status::OK();
508
86.5k
}
_ZN5doris17DataSinkOperatorXINS_25BucketedAggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
99.2k
                                                            LocalSinkStateInfo& info) {
504
99.2k
    auto local_state = LocalStateType::create_unique(this, state);
505
99.2k
    RETURN_IF_ERROR(local_state->init(state, info));
506
99.2k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
99.2k
    return Status::OK();
508
99.2k
}
_ZN5doris17DataSinkOperatorXINS_28PartitionedAggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
68
                                                            LocalSinkStateInfo& info) {
504
68
    auto local_state = LocalStateType::create_unique(this, state);
505
68
    RETURN_IF_ERROR(local_state->init(state, info));
506
68
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
68
    return Status::OK();
508
68
}
_ZN5doris17DataSinkOperatorXINS_22ExchangeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
478k
                                                            LocalSinkStateInfo& info) {
504
478k
    auto local_state = LocalStateType::create_unique(this, state);
505
478k
    RETURN_IF_ERROR(local_state->init(state, info));
506
478k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
478k
    return Status::OK();
508
478k
}
_ZN5doris17DataSinkOperatorXINS_33NestedLoopJoinBuildSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
7.02k
                                                            LocalSinkStateInfo& info) {
504
7.02k
    auto local_state = LocalStateType::create_unique(this, state);
505
7.02k
    RETURN_IF_ERROR(local_state->init(state, info));
506
7.02k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
7.02k
    return Status::OK();
508
7.02k
}
_ZN5doris17DataSinkOperatorXINS_19UnionSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
9.26k
                                                            LocalSinkStateInfo& info) {
504
9.26k
    auto local_state = LocalStateType::create_unique(this, state);
505
9.26k
    RETURN_IF_ERROR(local_state->init(state, info));
506
9.26k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
9.26k
    return Status::OK();
508
9.26k
}
_ZN5doris17DataSinkOperatorXINS_33MultiCastDataStreamSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
2.56k
                                                            LocalSinkStateInfo& info) {
504
2.56k
    auto local_state = LocalStateType::create_unique(this, state);
505
2.56k
    RETURN_IF_ERROR(local_state->init(state, info));
506
2.56k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
2.56k
    return Status::OK();
508
2.56k
}
_ZN5doris17DataSinkOperatorXINS_27PartitionSortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
416
                                                            LocalSinkStateInfo& info) {
504
416
    auto local_state = LocalStateType::create_unique(this, state);
505
416
    RETURN_IF_ERROR(local_state->init(state, info));
506
416
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
416
    return Status::OK();
508
416
}
_ZN5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
4.72k
                                                            LocalSinkStateInfo& info) {
504
4.72k
    auto local_state = LocalStateType::create_unique(this, state);
505
4.72k
    RETURN_IF_ERROR(local_state->init(state, info));
506
4.72k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
4.72k
    return Status::OK();
508
4.72k
}
_ZN5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
2.54k
                                                            LocalSinkStateInfo& info) {
504
2.54k
    auto local_state = LocalStateType::create_unique(this, state);
505
2.54k
    RETURN_IF_ERROR(local_state->init(state, info));
506
2.54k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
2.54k
    return Status::OK();
508
2.54k
}
_ZN5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
2.56k
                                                            LocalSinkStateInfo& info) {
504
2.56k
    auto local_state = LocalStateType::create_unique(this, state);
505
2.56k
    RETURN_IF_ERROR(local_state->init(state, info));
506
2.56k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
2.56k
    return Status::OK();
508
2.56k
}
_ZN5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
2.46k
                                                            LocalSinkStateInfo& info) {
504
2.46k
    auto local_state = LocalStateType::create_unique(this, state);
505
2.46k
    RETURN_IF_ERROR(local_state->init(state, info));
506
2.46k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
2.46k
    return Status::OK();
508
2.46k
}
_ZN5doris17DataSinkOperatorXINS_33PartitionedHashJoinSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
1
                                                            LocalSinkStateInfo& info) {
504
1
    auto local_state = LocalStateType::create_unique(this, state);
505
1
    RETURN_IF_ERROR(local_state->init(state, info));
506
1
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
1
    return Status::OK();
508
1
}
_ZN5doris17DataSinkOperatorXINS_30GroupCommitBlockSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
568
                                                            LocalSinkStateInfo& info) {
504
568
    auto local_state = LocalStateType::create_unique(this, state);
505
568
    RETURN_IF_ERROR(local_state->init(state, info));
506
568
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
568
    return Status::OK();
508
568
}
_ZN5doris17DataSinkOperatorXINS_19CacheSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
14
                                                            LocalSinkStateInfo& info) {
504
14
    auto local_state = LocalStateType::create_unique(this, state);
505
14
    RETURN_IF_ERROR(local_state->init(state, info));
506
14
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
14
    return Status::OK();
508
14
}
_ZN5doris17DataSinkOperatorXINS_18DictSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
105
                                                            LocalSinkStateInfo& info) {
504
105
    auto local_state = LocalStateType::create_unique(this, state);
505
105
    RETURN_IF_ERROR(local_state->init(state, info));
506
105
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
105
    return Status::OK();
508
105
}
_ZN5doris17DataSinkOperatorXINS_20RecCTESinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
164
                                                            LocalSinkStateInfo& info) {
504
164
    auto local_state = LocalStateType::create_unique(this, state);
505
164
    RETURN_IF_ERROR(local_state->init(state, info));
506
164
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
164
    return Status::OK();
508
164
}
_ZN5doris17DataSinkOperatorXINS_26RecCTEAnchorSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
164
                                                            LocalSinkStateInfo& info) {
504
164
    auto local_state = LocalStateType::create_unique(this, state);
505
164
    RETURN_IF_ERROR(local_state->init(state, info));
506
164
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
164
    return Status::OK();
508
164
}
509
510
template <typename LocalStateType>
511
1.31M
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.31M
    } else {
519
1.31M
        auto ss = LocalStateType::SharedStateType::create_shared();
520
1.31M
        ss->id = operator_id();
521
1.31M
        for (auto& dest : dests_id()) {
522
1.30M
            ss->related_op_ids.insert(dest);
523
1.30M
        }
524
1.31M
        return ss;
525
1.31M
    }
526
1.31M
}
_ZNK5doris17DataSinkOperatorXINS_27HashJoinBuildSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
99.3k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
99.3k
    } else {
519
99.3k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
99.3k
        ss->id = operator_id();
521
99.3k
        for (auto& dest : dests_id()) {
522
99.0k
            ss->related_op_ids.insert(dest);
523
99.0k
        }
524
99.3k
        return ss;
525
99.3k
    }
526
99.3k
}
_ZNK5doris17DataSinkOperatorXINS_20ResultSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
391k
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
391k
    } else {
519
391k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
391k
        ss->id = operator_id();
521
391k
        for (auto& dest : dests_id()) {
522
389k
            ss->related_op_ids.insert(dest);
523
389k
        }
524
391k
        return ss;
525
391k
    }
526
391k
}
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
358
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
358
    } else {
519
358
        auto ss = LocalStateType::SharedStateType::create_shared();
520
358
        ss->id = operator_id();
521
358
        for (auto& dest : dests_id()) {
522
357
            ss->related_op_ids.insert(dest);
523
357
        }
524
358
        return ss;
525
358
    }
526
358
}
_ZNK5doris17DataSinkOperatorXINS_23OlapTableSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
44.9k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
44.9k
    } else {
519
44.9k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
44.9k
        ss->id = operator_id();
521
44.9k
        for (auto& dest : dests_id()) {
522
44.6k
            ss->related_op_ids.insert(dest);
523
44.6k
        }
524
44.9k
        return ss;
525
44.9k
    }
526
44.9k
}
_ZNK5doris17DataSinkOperatorXINS_25OlapTableSinkV2LocalStateEE19create_shared_stateEv
Line
Count
Source
511
7
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
7
    } else {
519
7
        auto ss = LocalStateType::SharedStateType::create_shared();
520
7
        ss->id = operator_id();
521
7
        for (auto& dest : dests_id()) {
522
7
            ss->related_op_ids.insert(dest);
523
7
        }
524
7
        return ss;
525
7
    }
526
7
}
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
8.40k
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
8.40k
    } else {
519
8.40k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
8.40k
        ss->id = operator_id();
521
8.42k
        for (auto& dest : dests_id()) {
522
8.42k
            ss->related_op_ids.insert(dest);
523
8.42k
        }
524
8.40k
        return ss;
525
8.40k
    }
526
8.40k
}
_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
195k
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
195k
    } else {
519
195k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
195k
        ss->id = operator_id();
521
195k
        for (auto& dest : dests_id()) {
522
194k
            ss->related_op_ids.insert(dest);
523
194k
        }
524
195k
        return ss;
525
195k
    }
526
195k
}
_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
86.7k
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
86.7k
    } else {
519
86.7k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
86.7k
        ss->id = operator_id();
521
86.8k
        for (auto& dest : dests_id()) {
522
86.8k
            ss->related_op_ids.insert(dest);
523
86.8k
        }
524
86.7k
        return ss;
525
86.7k
    }
526
86.7k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_25BucketedAggSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_28PartitionedAggSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
67
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
67
    } else {
519
67
        auto ss = LocalStateType::SharedStateType::create_shared();
520
67
        ss->id = operator_id();
521
67
        for (auto& dest : dests_id()) {
522
67
            ss->related_op_ids.insert(dest);
523
67
        }
524
67
        return ss;
525
67
    }
526
67
}
_ZNK5doris17DataSinkOperatorXINS_22ExchangeSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
478k
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
478k
    } else {
519
478k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
478k
        ss->id = operator_id();
521
478k
        for (auto& dest : dests_id()) {
522
471k
            ss->related_op_ids.insert(dest);
523
471k
        }
524
478k
        return ss;
525
478k
    }
526
478k
}
_ZNK5doris17DataSinkOperatorXINS_33NestedLoopJoinBuildSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
7.04k
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
7.04k
    } else {
519
7.04k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
7.04k
        ss->id = operator_id();
521
7.04k
        for (auto& dest : dests_id()) {
522
7.04k
            ss->related_op_ids.insert(dest);
523
7.04k
        }
524
7.04k
        return ss;
525
7.04k
    }
526
7.04k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_19UnionSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_33MultiCastDataStreamSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_27PartitionSortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
514
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
514
    } else {
519
514
        auto ss = LocalStateType::SharedStateType::create_shared();
520
514
        ss->id = operator_id();
521
518
        for (auto& dest : dests_id()) {
522
518
            ss->related_op_ids.insert(dest);
523
518
        }
524
514
        return ss;
525
514
    }
526
514
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb1EEEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb0EEEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb1EEEE19create_shared_stateEv
Line
Count
Source
511
2.55k
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.55k
    } else {
519
2.55k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
2.55k
        ss->id = operator_id();
521
2.55k
        for (auto& dest : dests_id()) {
522
2.55k
            ss->related_op_ids.insert(dest);
523
2.55k
        }
524
2.55k
        return ss;
525
2.55k
    }
526
2.55k
}
_ZNK5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb0EEEE19create_shared_stateEv
Line
Count
Source
511
2.47k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
2.47k
    } else {
519
2.47k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
2.47k
        ss->id = operator_id();
521
2.48k
        for (auto& dest : dests_id()) {
522
2.48k
            ss->related_op_ids.insert(dest);
523
2.48k
        }
524
2.47k
        return ss;
525
2.47k
    }
526
2.47k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_33PartitionedHashJoinSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_30GroupCommitBlockSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
568
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
568
    } else {
519
568
        auto ss = LocalStateType::SharedStateType::create_shared();
520
568
        ss->id = operator_id();
521
568
        for (auto& dest : dests_id()) {
522
564
            ss->related_op_ids.insert(dest);
523
564
        }
524
568
        return ss;
525
568
    }
526
568
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_19CacheSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_18DictSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
105
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
105
    } else {
519
105
        auto ss = LocalStateType::SharedStateType::create_shared();
520
105
        ss->id = operator_id();
521
105
        for (auto& dest : dests_id()) {
522
105
            ss->related_op_ids.insert(dest);
523
105
        }
524
105
        return ss;
525
105
    }
526
105
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_20RecCTESinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_26RecCTEAnchorSinkLocalStateEE19create_shared_stateEv
527
528
template <typename LocalStateType>
529
1.99M
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
1.99M
    auto local_state = LocalStateType::create_unique(state, this);
531
1.99M
    RETURN_IF_ERROR(local_state->init(state, info));
532
1.99M
    state->emplace_local_state(operator_id(), std::move(local_state));
533
1.99M
    return Status::OK();
534
1.99M
}
_ZN5doris9OperatorXINS_23HashJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
71.3k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
71.3k
    auto local_state = LocalStateType::create_unique(state, this);
531
71.3k
    RETURN_IF_ERROR(local_state->init(state, info));
532
71.3k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
71.3k
    return Status::OK();
534
71.3k
}
_ZN5doris9OperatorXINS_18OlapScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
238k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
238k
    auto local_state = LocalStateType::create_unique(state, this);
531
238k
    RETURN_IF_ERROR(local_state->init(state, info));
532
238k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
238k
    return Status::OK();
534
238k
}
_ZN5doris9OperatorXINS_21GroupCommitLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
148
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
148
    auto local_state = LocalStateType::create_unique(state, this);
531
148
    RETURN_IF_ERROR(local_state->init(state, info));
532
148
    state->emplace_local_state(operator_id(), std::move(local_state));
533
148
    return Status::OK();
534
148
}
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
8.34k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
8.34k
    auto local_state = LocalStateType::create_unique(state, this);
531
8.34k
    RETURN_IF_ERROR(local_state->init(state, info));
532
8.34k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
8.34k
    return Status::OK();
534
8.34k
}
_ZN5doris9OperatorXINS_14SortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
8.23k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
8.23k
    auto local_state = LocalStateType::create_unique(state, this);
531
8.23k
    RETURN_IF_ERROR(local_state->init(state, info));
532
8.23k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
8.23k
    return Status::OK();
534
8.23k
}
_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
186k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
186k
    auto local_state = LocalStateType::create_unique(state, this);
531
186k
    RETURN_IF_ERROR(local_state->init(state, info));
532
186k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
186k
    return Status::OK();
534
186k
}
_ZN5doris9OperatorXINS_13AggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
86.4k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
86.4k
    auto local_state = LocalStateType::create_unique(state, this);
531
86.4k
    RETURN_IF_ERROR(local_state->init(state, info));
532
86.4k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
86.4k
    return Status::OK();
534
86.4k
}
_ZN5doris9OperatorXINS_21BucketedAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
100k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
100k
    auto local_state = LocalStateType::create_unique(state, this);
531
100k
    RETURN_IF_ERROR(local_state->init(state, info));
532
100k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
100k
    return Status::OK();
534
100k
}
_ZN5doris9OperatorXINS_24PartitionedAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
58
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
58
    auto local_state = LocalStateType::create_unique(state, this);
531
58
    RETURN_IF_ERROR(local_state->init(state, info));
532
58
    state->emplace_local_state(operator_id(), std::move(local_state));
533
58
    return Status::OK();
534
58
}
_ZN5doris9OperatorXINS_23TableFunctionLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
4.07k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
4.07k
    auto local_state = LocalStateType::create_unique(state, this);
531
4.07k
    RETURN_IF_ERROR(local_state->init(state, info));
532
4.07k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
4.07k
    return Status::OK();
534
4.07k
}
_ZN5doris9OperatorXINS_18ExchangeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
264k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
264k
    auto local_state = LocalStateType::create_unique(state, this);
531
264k
    RETURN_IF_ERROR(local_state->init(state, info));
532
264k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
264k
    return Status::OK();
534
264k
}
_ZN5doris9OperatorXINS_16RepeatLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
1.44k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
1.44k
    auto local_state = LocalStateType::create_unique(state, this);
531
1.44k
    RETURN_IF_ERROR(local_state->init(state, info));
532
1.44k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
1.44k
    return Status::OK();
534
1.44k
}
_ZN5doris9OperatorXINS_29NestedLoopJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
7.03k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
7.03k
    auto local_state = LocalStateType::create_unique(state, this);
531
7.03k
    RETURN_IF_ERROR(local_state->init(state, info));
532
7.03k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
7.03k
    return Status::OK();
534
7.03k
}
_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
53.8k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
53.8k
    auto local_state = LocalStateType::create_unique(state, this);
531
53.8k
    RETURN_IF_ERROR(local_state->init(state, info));
532
53.8k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
53.8k
    return Status::OK();
534
53.8k
}
_ZN5doris9OperatorXINS_35MultiCastDataStreamSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
6.10k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
6.10k
    auto local_state = LocalStateType::create_unique(state, this);
531
6.10k
    RETURN_IF_ERROR(local_state->init(state, info));
532
6.10k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
6.10k
    return Status::OK();
534
6.10k
}
_ZN5doris9OperatorXINS_29PartitionSortSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
418
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
418
    auto local_state = LocalStateType::create_unique(state, this);
531
418
    RETURN_IF_ERROR(local_state->init(state, info));
532
418
    state->emplace_local_state(operator_id(), std::move(local_state));
533
418
    return Status::OK();
534
418
}
_ZN5doris9OperatorXINS_19SetSourceLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
2.54k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
2.54k
    auto local_state = LocalStateType::create_unique(state, this);
531
2.54k
    RETURN_IF_ERROR(local_state->init(state, info));
532
2.54k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
2.54k
    return Status::OK();
534
2.54k
}
_ZN5doris9OperatorXINS_19SetSourceLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
2.44k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
2.44k
    auto local_state = LocalStateType::create_unique(state, this);
531
2.44k
    RETURN_IF_ERROR(local_state->init(state, info));
532
2.44k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
2.44k
    return Status::OK();
534
2.44k
}
_ZN5doris9OperatorXINS_17DataGenLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
297
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
297
    auto local_state = LocalStateType::create_unique(state, this);
531
297
    RETURN_IF_ERROR(local_state->init(state, info));
532
297
    state->emplace_local_state(operator_id(), std::move(local_state));
533
297
    return Status::OK();
534
297
}
_ZN5doris9OperatorXINS_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
4.91k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
4.91k
    auto local_state = LocalStateType::create_unique(state, this);
531
4.91k
    RETURN_IF_ERROR(local_state->init(state, info));
532
4.91k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
4.91k
    return Status::OK();
534
4.91k
}
_ZN5doris9OperatorXINS_29LocalExchangeSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
632k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
632k
    auto local_state = LocalStateType::create_unique(state, this);
531
632k
    RETURN_IF_ERROR(local_state->init(state, info));
532
632k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
632k
    return Status::OK();
534
632k
}
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
164
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
164
    auto local_state = LocalStateType::create_unique(state, this);
531
164
    RETURN_IF_ERROR(local_state->init(state, info));
532
164
    state->emplace_local_state(operator_id(), std::move(local_state));
533
164
    return Status::OK();
534
164
}
_ZN5doris9OperatorXINS_20RecCTEScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
2.18k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
2.18k
    auto local_state = LocalStateType::create_unique(state, this);
531
2.18k
    RETURN_IF_ERROR(local_state->init(state, info));
532
2.18k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
2.18k
    return Status::OK();
534
2.18k
}
_ZN5doris9OperatorXINS_25MaterializationLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
787
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
787
    auto local_state = LocalStateType::create_unique(state, this);
531
787
    RETURN_IF_ERROR(local_state->init(state, info));
532
787
    state->emplace_local_state(operator_id(), std::move(local_state));
533
787
    return Status::OK();
534
787
}
_ZN5doris9OperatorXINS_16SelectLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
904
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
904
    auto local_state = LocalStateType::create_unique(state, this);
531
904
    RETURN_IF_ERROR(local_state->init(state, info));
532
904
    state->emplace_local_state(operator_id(), std::move(local_state));
533
904
    return Status::OK();
534
904
}
_ZN5doris9OperatorXINS_22StreamingAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
6.01k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
6.01k
    auto local_state = LocalStateType::create_unique(state, this);
531
6.01k
    RETURN_IF_ERROR(local_state->init(state, info));
532
6.01k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
6.01k
    return Status::OK();
534
6.01k
}
_ZN5doris9OperatorXINS_30DistinctStreamingAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
298k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
298k
    auto local_state = LocalStateType::create_unique(state, this);
531
298k
    RETURN_IF_ERROR(local_state->init(state, info));
532
298k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
298k
    return Status::OK();
534
298k
}
535
536
PipelineXSinkLocalStateBase::PipelineXSinkLocalStateBase(DataSinkOperatorXBase* parent,
537
                                                         RuntimeState* state)
538
1.66M
        : _parent(parent), _state(state) {}
539
540
PipelineXLocalStateBase::PipelineXLocalStateBase(RuntimeState* state, OperatorXBase* parent)
541
1.98M
        : _num_rows_returned(0),
542
1.98M
          _rows_returned_counter(nullptr),
543
1.98M
          _parent(parent),
544
1.98M
          _state(state),
545
1.98M
          _budget(state->batch_size(), state->preferred_block_size_bytes()) {}
546
547
template <typename SharedStateArg>
548
1.99M
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
1.99M
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
1.99M
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
1.99M
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
1.99M
    _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.99M
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
1.99M
    _operator_profile->add_child(_common_profile.get(), true);
557
1.99M
    _operator_profile->add_child(_custom_profile.get(), true);
558
1.99M
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
1.99M
    if constexpr (!is_fake_shared) {
560
1.17M
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
747k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
747k
                                    .first.get()
563
747k
                                    ->template cast<SharedStateArg>();
564
565
747k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
747k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
747k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
747k
        } else if (info.shared_state) {
569
356k
            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
356k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
356k
            _dependency = _shared_state->create_source_dependency(
576
356k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
356k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
356k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
356k
        } else {
580
66.8k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
8.22k
                DCHECK(false);
582
8.22k
            }
583
66.8k
        }
584
1.17M
    }
585
586
1.99M
    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.99M
    _rows_returned_counter =
591
1.99M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
1.99M
    _blocks_returned_counter =
593
1.99M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
1.99M
    _output_block_bytes_counter =
595
1.99M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
1.99M
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
1.99M
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
1.99M
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
1.99M
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
1.99M
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
1.99M
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
1.99M
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
1.99M
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
1.99M
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
1.99M
    _memory_used_counter =
606
1.99M
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
1.99M
    _common_profile->add_info_string("IsColocate",
608
1.99M
                                     std::to_string(_parent->is_colocated_operator()));
609
1.99M
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
1.99M
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
1.99M
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
1.99M
    return Status::OK();
613
1.99M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
71.3k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
71.3k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
71.3k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
71.3k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
71.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
71.3k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
71.3k
    _operator_profile->add_child(_common_profile.get(), true);
557
71.3k
    _operator_profile->add_child(_custom_profile.get(), true);
558
71.3k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
71.3k
    if constexpr (!is_fake_shared) {
560
71.3k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
19.8k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
19.8k
                                    .first.get()
563
19.8k
                                    ->template cast<SharedStateArg>();
564
565
19.8k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
19.8k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
19.8k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
51.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
50.9k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
50.9k
            _dependency = _shared_state->create_source_dependency(
576
50.9k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
50.9k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
50.9k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
50.9k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
507
        }
584
71.3k
    }
585
586
71.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
71.3k
    _rows_returned_counter =
591
71.3k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
71.3k
    _blocks_returned_counter =
593
71.3k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
71.3k
    _output_block_bytes_counter =
595
71.3k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
71.3k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
71.3k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
71.3k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
71.3k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
71.3k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
71.3k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
71.3k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
71.3k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
71.3k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
71.3k
    _memory_used_counter =
606
71.3k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
71.3k
    _common_profile->add_info_string("IsColocate",
608
71.3k
                                     std::to_string(_parent->is_colocated_operator()));
609
71.3k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
71.3k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
71.3k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
71.3k
    return Status::OK();
613
71.3k
}
_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
195k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
195k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
195k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
195k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
195k
    _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
195k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
195k
    _operator_profile->add_child(_common_profile.get(), true);
557
195k
    _operator_profile->add_child(_custom_profile.get(), true);
558
195k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
195k
    if constexpr (!is_fake_shared) {
560
195k
        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
195k
        } 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
189k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
189k
            _dependency = _shared_state->create_source_dependency(
576
189k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
189k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
189k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
189k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
5.85k
        }
584
195k
    }
585
586
195k
    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
195k
    _rows_returned_counter =
591
195k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
195k
    _blocks_returned_counter =
593
195k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
195k
    _output_block_bytes_counter =
595
195k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
195k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
195k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
195k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
195k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
195k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
195k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
195k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
195k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
195k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
195k
    _memory_used_counter =
606
195k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
195k
    _common_profile->add_info_string("IsColocate",
608
195k
                                     std::to_string(_parent->is_colocated_operator()));
609
195k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
195k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
195k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
195k
    return Status::OK();
613
195k
}
_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
7.05k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
7.05k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
7.05k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
7.05k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
7.05k
    _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
7.05k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
7.05k
    _operator_profile->add_child(_common_profile.get(), true);
557
7.05k
    _operator_profile->add_child(_custom_profile.get(), true);
558
7.05k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
7.05k
    if constexpr (!is_fake_shared) {
560
7.05k
        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
7.05k
        } 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.99k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
6.99k
            _dependency = _shared_state->create_source_dependency(
576
6.99k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
6.99k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
6.99k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
6.99k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
64
        }
584
7.05k
    }
585
586
7.05k
    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
7.05k
    _rows_returned_counter =
591
7.05k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
7.05k
    _blocks_returned_counter =
593
7.05k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
7.05k
    _output_block_bytes_counter =
595
7.05k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
7.05k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
7.05k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
7.05k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
7.05k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
7.05k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
7.05k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
7.05k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
7.05k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
7.05k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
7.05k
    _memory_used_counter =
606
7.05k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
7.05k
    _common_profile->add_info_string("IsColocate",
608
7.05k
                                     std::to_string(_parent->is_colocated_operator()));
609
7.05k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
7.05k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
7.05k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
7.05k
    return Status::OK();
613
7.05k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
8.42k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
8.42k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
8.42k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
8.42k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
8.42k
    _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
8.42k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
8.42k
    _operator_profile->add_child(_common_profile.get(), true);
557
8.42k
    _operator_profile->add_child(_custom_profile.get(), true);
558
8.42k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
8.42k
    if constexpr (!is_fake_shared) {
560
8.42k
        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
8.42k
        } 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
8.28k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
8.28k
            _dependency = _shared_state->create_source_dependency(
576
8.28k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
8.28k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
8.28k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
8.28k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
134
        }
584
8.42k
    }
585
586
8.42k
    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
8.42k
    _rows_returned_counter =
591
8.42k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
8.42k
    _blocks_returned_counter =
593
8.42k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
8.42k
    _output_block_bytes_counter =
595
8.42k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
8.42k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
8.42k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
8.42k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
8.42k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
8.42k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
8.42k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
8.42k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
8.42k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
8.42k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
8.42k
    _memory_used_counter =
606
8.42k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
8.42k
    _common_profile->add_info_string("IsColocate",
608
8.42k
                                     std::to_string(_parent->is_colocated_operator()));
609
8.42k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
8.42k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
8.42k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
8.42k
    return Status::OK();
613
8.42k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
86.8k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
86.8k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
86.8k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
86.8k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
86.8k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
86.8k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
86.8k
    _operator_profile->add_child(_common_profile.get(), true);
557
86.8k
    _operator_profile->add_child(_custom_profile.get(), true);
558
86.8k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
86.8k
    if constexpr (!is_fake_shared) {
560
86.8k
        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
86.8k
        } 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
84.7k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
84.7k
            _dependency = _shared_state->create_source_dependency(
576
84.7k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
84.7k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
84.7k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
84.7k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
2.01k
        }
584
86.8k
    }
585
586
86.8k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
86.8k
    _rows_returned_counter =
591
86.8k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
86.8k
    _blocks_returned_counter =
593
86.8k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
86.8k
    _output_block_bytes_counter =
595
86.8k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
86.8k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
86.8k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
86.8k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
86.8k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
86.8k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
86.8k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
86.8k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
86.8k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
86.8k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
86.8k
    _memory_used_counter =
606
86.8k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
86.8k
    _common_profile->add_info_string("IsColocate",
608
86.8k
                                     std::to_string(_parent->is_colocated_operator()));
609
86.8k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
86.8k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
86.8k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
86.8k
    return Status::OK();
613
86.8k
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
100k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
100k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
100k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
100k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
100k
    _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
100k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
100k
    _operator_profile->add_child(_common_profile.get(), true);
557
100k
    _operator_profile->add_child(_custom_profile.get(), true);
558
100k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
100k
    if constexpr (!is_fake_shared) {
560
100k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
100k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
100k
                                    .first.get()
563
100k
                                    ->template cast<SharedStateArg>();
564
565
100k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
100k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
100k
                    _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
100k
    }
585
586
100k
    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
100k
    _rows_returned_counter =
591
100k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
100k
    _blocks_returned_counter =
593
100k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
100k
    _output_block_bytes_counter =
595
100k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
100k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
100k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
100k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
100k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
100k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
100k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
100k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
100k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
100k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
100k
    _memory_used_counter =
606
100k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
100k
    _common_profile->add_info_string("IsColocate",
608
100k
                                     std::to_string(_parent->is_colocated_operator()));
609
100k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
100k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
100k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
100k
    return Status::OK();
613
100k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
58
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
58
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
58
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
58
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
58
    _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
58
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
58
    _operator_profile->add_child(_common_profile.get(), true);
557
58
    _operator_profile->add_child(_custom_profile.get(), true);
558
58
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
58
    if constexpr (!is_fake_shared) {
560
58
        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
58
        } 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
58
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
58
            _dependency = _shared_state->create_source_dependency(
576
58
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
58
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
58
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
58
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
0
        }
584
58
    }
585
586
58
    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
58
    _rows_returned_counter =
591
58
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
58
    _blocks_returned_counter =
593
58
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
58
    _output_block_bytes_counter =
595
58
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
58
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
58
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
58
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
58
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
58
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
58
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
58
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
58
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
58
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
58
    _memory_used_counter =
606
58
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
58
    _common_profile->add_info_string("IsColocate",
608
58
                                     std::to_string(_parent->is_colocated_operator()));
609
58
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
58
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
58
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
58
    return Status::OK();
613
58
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
825k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
825k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
825k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
825k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
825k
    _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
825k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
825k
    _operator_profile->add_child(_common_profile.get(), true);
557
825k
    _operator_profile->add_child(_custom_profile.get(), true);
558
825k
    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
825k
    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
825k
    _rows_returned_counter =
591
825k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
825k
    _blocks_returned_counter =
593
825k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
825k
    _output_block_bytes_counter =
595
825k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
825k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
825k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
825k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
825k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
825k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
825k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
825k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
825k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
825k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
825k
    _memory_used_counter =
606
825k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
825k
    _common_profile->add_info_string("IsColocate",
608
825k
                                     std::to_string(_parent->is_colocated_operator()));
609
825k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
825k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
825k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
825k
    return Status::OK();
613
825k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
53.7k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
53.7k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
53.7k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
53.7k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
53.7k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
53.7k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
53.7k
    _operator_profile->add_child(_common_profile.get(), true);
557
53.7k
    _operator_profile->add_child(_custom_profile.get(), true);
558
53.7k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
53.7k
    if constexpr (!is_fake_shared) {
560
53.7k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
53.7k
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
4.02k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
4.02k
            _dependency = _shared_state->create_source_dependency(
576
4.02k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
4.02k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
4.02k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
49.6k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
49.6k
        }
584
53.7k
    }
585
586
53.7k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
53.7k
    _rows_returned_counter =
591
53.7k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
53.7k
    _blocks_returned_counter =
593
53.7k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
53.7k
    _output_block_bytes_counter =
595
53.7k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
53.7k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
53.7k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
53.7k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
53.7k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
53.7k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
53.7k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
53.7k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
53.7k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
53.7k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
53.7k
    _memory_used_counter =
606
53.7k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
53.7k
    _common_profile->add_info_string("IsColocate",
608
53.7k
                                     std::to_string(_parent->is_colocated_operator()));
609
53.7k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
53.7k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
53.7k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
53.7k
    return Status::OK();
613
53.7k
}
_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
6.10k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
6.10k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
6.10k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
6.10k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
6.10k
    _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.10k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
6.10k
    _operator_profile->add_child(_common_profile.get(), true);
557
6.10k
    _operator_profile->add_child(_custom_profile.get(), true);
558
6.10k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
6.10k
    if constexpr (!is_fake_shared) {
560
6.10k
        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.10k
        } 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.08k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
6.08k
            _dependency = _shared_state->create_source_dependency(
576
6.08k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
6.08k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
6.08k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
6.08k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
26
        }
584
6.10k
    }
585
586
6.10k
    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.10k
    _rows_returned_counter =
591
6.10k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
6.10k
    _blocks_returned_counter =
593
6.10k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
6.10k
    _output_block_bytes_counter =
595
6.10k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
6.10k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
6.10k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
6.10k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
6.10k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
6.10k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
6.10k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
6.10k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
6.10k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
6.10k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
6.10k
    _memory_used_counter =
606
6.10k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
6.10k
    _common_profile->add_info_string("IsColocate",
608
6.10k
                                     std::to_string(_parent->is_colocated_operator()));
609
6.10k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
6.10k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
6.10k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
6.10k
    return Status::OK();
613
6.10k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
520
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
520
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
520
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
520
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
520
    _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
520
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
520
    _operator_profile->add_child(_common_profile.get(), true);
557
520
    _operator_profile->add_child(_custom_profile.get(), true);
558
520
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
520
    if constexpr (!is_fake_shared) {
560
520
        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
520
        } 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
519
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
519
            _dependency = _shared_state->create_source_dependency(
576
519
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
519
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
519
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
519
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
1
        }
584
520
    }
585
586
520
    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
520
    _rows_returned_counter =
591
520
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
520
    _blocks_returned_counter =
593
520
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
520
    _output_block_bytes_counter =
595
520
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
520
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
520
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
520
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
520
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
520
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
520
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
520
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
520
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
520
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
520
    _memory_used_counter =
606
520
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
520
    _common_profile->add_info_string("IsColocate",
608
520
                                     std::to_string(_parent->is_colocated_operator()));
609
520
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
520
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
520
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
520
    return Status::OK();
613
520
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
5.05k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
5.05k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
5.05k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
5.05k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
5.05k
    _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.05k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
5.05k
    _operator_profile->add_child(_common_profile.get(), true);
557
5.05k
    _operator_profile->add_child(_custom_profile.get(), true);
558
5.05k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
5.05k
    if constexpr (!is_fake_shared) {
560
5.05k
        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.05k
        } 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.64k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
4.64k
            _dependency = _shared_state->create_source_dependency(
576
4.64k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
4.64k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
4.64k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
4.64k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
414
        }
584
5.05k
    }
585
586
5.05k
    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.05k
    _rows_returned_counter =
591
5.05k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
5.05k
    _blocks_returned_counter =
593
5.05k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
5.05k
    _output_block_bytes_counter =
595
5.05k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
5.05k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
5.05k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
5.05k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
5.05k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
5.05k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
5.05k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
5.05k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
5.05k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
5.05k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
5.05k
    _memory_used_counter =
606
5.05k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
5.05k
    _common_profile->add_info_string("IsColocate",
608
5.05k
                                     std::to_string(_parent->is_colocated_operator()));
609
5.05k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
5.05k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
5.05k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
5.05k
    return Status::OK();
613
5.05k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
635k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
635k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
635k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
635k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
635k
    _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
635k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
635k
    _operator_profile->add_child(_common_profile.get(), true);
557
635k
    _operator_profile->add_child(_custom_profile.get(), true);
558
635k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
635k
    if constexpr (!is_fake_shared) {
560
635k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
627k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
627k
                                    .first.get()
563
627k
                                    ->template cast<SharedStateArg>();
564
565
627k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
627k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
627k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
627k
        } 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
8.22k
        } else {
580
8.22k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
8.22k
                DCHECK(false);
582
8.22k
            }
583
8.22k
        }
584
635k
    }
585
586
635k
    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
635k
    _rows_returned_counter =
591
635k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
635k
    _blocks_returned_counter =
593
635k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
635k
    _output_block_bytes_counter =
595
635k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
635k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
635k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
635k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
635k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
635k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
635k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
635k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
635k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
635k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
635k
    _memory_used_counter =
606
635k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
635k
    _common_profile->add_info_string("IsColocate",
608
635k
                                     std::to_string(_parent->is_colocated_operator()));
609
635k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
635k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
635k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
635k
    return Status::OK();
613
635k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
164
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
164
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
164
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
164
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
164
    _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
164
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
164
    _operator_profile->add_child(_common_profile.get(), true);
557
164
    _operator_profile->add_child(_custom_profile.get(), true);
558
164
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
164
    if constexpr (!is_fake_shared) {
560
164
        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
164
        } 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
164
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
164
            _dependency = _shared_state->create_source_dependency(
576
164
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
164
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
164
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
164
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
0
        }
584
164
    }
585
586
164
    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
164
    _rows_returned_counter =
591
164
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
164
    _blocks_returned_counter =
593
164
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
164
    _output_block_bytes_counter =
595
164
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
164
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
164
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
164
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
164
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
164
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
164
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
164
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
164
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
164
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
164
    _memory_used_counter =
606
164
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
164
    _common_profile->add_info_string("IsColocate",
608
164
                                     std::to_string(_parent->is_colocated_operator()));
609
164
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
164
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
164
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
164
    return Status::OK();
613
164
}
614
615
template <typename SharedStateArg>
616
2.00M
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
2.00M
    _conjuncts.resize(_parent->_conjuncts.size());
618
2.29M
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
292k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
292k
    }
621
2.00M
    if (_parent->has_projection()) {
622
366k
        const auto& projection = *_parent->_projection;
623
366k
        _projections.resize(projection.projections.size());
624
2.28M
        for (size_t i = 0; i < _projections.size(); i++) {
625
1.92M
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
1.92M
        }
627
366k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
379k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
12.8k
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
186k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
173k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
173k
                        state, _intermediate_projections[i][j]));
633
173k
            }
634
12.8k
        }
635
366k
    }
636
2.00M
    return Status::OK();
637
2.00M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
71.5k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
71.5k
    _conjuncts.resize(_parent->_conjuncts.size());
618
72.9k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
1.32k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
1.32k
    }
621
71.5k
    if (_parent->has_projection()) {
622
71.5k
        const auto& projection = *_parent->_projection;
623
71.5k
        _projections.resize(projection.projections.size());
624
391k
        for (size_t i = 0; i < _projections.size(); i++) {
625
319k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
319k
        }
627
71.5k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
77.3k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
5.79k
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
138k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
132k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
132k
                        state, _intermediate_projections[i][j]));
633
132k
            }
634
5.79k
        }
635
71.5k
    }
636
71.5k
    return Status::OK();
637
71.5k
}
_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
196k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
196k
    _conjuncts.resize(_parent->_conjuncts.size());
618
196k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
196k
    if (_parent->has_projection()) {
622
79
        const auto& projection = *_parent->_projection;
623
79
        _projections.resize(projection.projections.size());
624
401
        for (size_t i = 0; i < _projections.size(); i++) {
625
322
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
322
        }
627
79
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
79
        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
79
    }
636
196k
    return Status::OK();
637
196k
}
_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
7.06k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
7.06k
    _conjuncts.resize(_parent->_conjuncts.size());
618
7.17k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
107
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
107
    }
621
7.07k
    if (_parent->has_projection()) {
622
7.07k
        const auto& projection = *_parent->_projection;
623
7.07k
        _projections.resize(projection.projections.size());
624
31.7k
        for (size_t i = 0; i < _projections.size(); i++) {
625
24.6k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
24.6k
        }
627
7.07k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
7.09k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
21
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
170
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
149
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
149
                        state, _intermediate_projections[i][j]));
633
149
            }
634
21
        }
635
7.07k
    }
636
7.06k
    return Status::OK();
637
7.06k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
8.45k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
8.45k
    _conjuncts.resize(_parent->_conjuncts.size());
618
9.50k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
1.04k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
1.04k
    }
621
8.45k
    if (_parent->has_projection()) {
622
4.33k
        const auto& projection = *_parent->_projection;
623
4.33k
        _projections.resize(projection.projections.size());
624
18.6k
        for (size_t i = 0; i < _projections.size(); i++) {
625
14.2k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
14.2k
        }
627
4.33k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
4.43k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
95
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
726
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
631
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
631
                        state, _intermediate_projections[i][j]));
633
631
            }
634
95
        }
635
4.33k
    }
636
8.45k
    return Status::OK();
637
8.45k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
87.0k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
87.0k
    _conjuncts.resize(_parent->_conjuncts.size());
618
88.7k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
1.71k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
1.71k
    }
621
87.0k
    if (_parent->has_projection()) {
622
29.2k
        const auto& projection = *_parent->_projection;
623
29.2k
        _projections.resize(projection.projections.size());
624
268k
        for (size_t i = 0; i < _projections.size(); i++) {
625
239k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
239k
        }
627
29.2k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
29.4k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
184
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
1.10k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
922
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
922
                        state, _intermediate_projections[i][j]));
633
922
            }
634
184
        }
635
29.2k
    }
636
87.0k
    return Status::OK();
637
87.0k
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
100k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
100k
    _conjuncts.resize(_parent->_conjuncts.size());
618
100k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
33
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
33
    }
621
100k
    if (_parent->has_projection()) {
622
171
        const auto& projection = *_parent->_projection;
623
171
        _projections.resize(projection.projections.size());
624
620
        for (size_t i = 0; i < _projections.size(); i++) {
625
449
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
449
        }
627
171
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
172
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
1
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
4
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
3
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
3
                        state, _intermediate_projections[i][j]));
633
3
            }
634
1
        }
635
171
    }
636
100k
    return Status::OK();
637
100k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
62
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
62
    _conjuncts.resize(_parent->_conjuncts.size());
618
62
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
62
    if (_parent->has_projection()) {
622
43
        const auto& projection = *_parent->_projection;
623
43
        _projections.resize(projection.projections.size());
624
129
        for (size_t i = 0; i < _projections.size(); i++) {
625
86
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
86
        }
627
43
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
43
        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
43
    }
636
62
    return Status::OK();
637
62
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
829k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
829k
    _conjuncts.resize(_parent->_conjuncts.size());
618
1.11M
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
287k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
287k
    }
621
829k
    if (_parent->has_projection()) {
622
242k
        const auto& projection = *_parent->_projection;
623
242k
        _projections.resize(projection.projections.size());
624
1.46M
        for (size_t i = 0; i < _projections.size(); i++) {
625
1.22M
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
1.22M
        }
627
242k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
248k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
6.51k
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
40.5k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
34.0k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
34.0k
                        state, _intermediate_projections[i][j]));
633
34.0k
            }
634
6.51k
        }
635
242k
    }
636
829k
    return Status::OK();
637
829k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
54.0k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
54.0k
    _conjuncts.resize(_parent->_conjuncts.size());
618
54.0k
    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.0k
    if (_parent->has_projection()) {
622
11.5k
        const auto& projection = *_parent->_projection;
623
11.5k
        _projections.resize(projection.projections.size());
624
110k
        for (size_t i = 0; i < _projections.size(); i++) {
625
98.5k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
98.5k
        }
627
11.5k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
11.7k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
190
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
4.95k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
4.76k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
4.76k
                        state, _intermediate_projections[i][j]));
633
4.76k
            }
634
190
        }
635
11.5k
    }
636
54.0k
    return Status::OK();
637
54.0k
}
_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
6.10k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
6.10k
    _conjuncts.resize(_parent->_conjuncts.size());
618
6.64k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
536
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
536
    }
621
6.10k
    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
6.10k
    return Status::OK();
637
6.10k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
520
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
520
    _conjuncts.resize(_parent->_conjuncts.size());
618
520
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
520
    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
520
    return Status::OK();
637
520
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
5.13k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
5.13k
    _conjuncts.resize(_parent->_conjuncts.size());
618
5.13k
    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.13k
    if (_parent->has_projection()) {
622
60
        const auto& projection = *_parent->_projection;
623
60
        _projections.resize(projection.projections.size());
624
227
        for (size_t i = 0; i < _projections.size(); i++) {
625
167
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
167
        }
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.13k
    return Status::OK();
637
5.13k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
638k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
638k
    _conjuncts.resize(_parent->_conjuncts.size());
618
638k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
638k
    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
638k
    return Status::OK();
637
638k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE4openEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
164
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
164
    _conjuncts.resize(_parent->_conjuncts.size());
618
171
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
7
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
7
    }
621
164
    if (_parent->has_projection()) {
622
161
        const auto& projection = *_parent->_projection;
623
161
        _projections.resize(projection.projections.size());
624
480
        for (size_t i = 0; i < _projections.size(); i++) {
625
319
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
319
        }
627
161
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
164
        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
161
    }
636
164
    return Status::OK();
637
164
}
638
639
template <typename SharedStateArg>
640
6.92k
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
6.92k
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
6.92k
    _terminated = true;
645
6.92k
    return Status::OK();
646
6.92k
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
329
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
329
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
329
    _terminated = true;
645
329
    return Status::OK();
646
329
}
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
23
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
23
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
23
    _terminated = true;
645
23
    return Status::OK();
646
23
}
_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
79
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
79
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
79
    _terminated = true;
645
79
    return Status::OK();
646
79
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
5.37k
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
5.37k
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
5.37k
    _terminated = true;
645
5.37k
    return Status::OK();
646
5.37k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
23
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
23
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
23
    _terminated = true;
645
23
    return Status::OK();
646
23
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
218
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
218
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
218
    _terminated = true;
645
218
    return Status::OK();
646
218
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
809
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
809
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
809
    _terminated = true;
645
809
    return Status::OK();
646
809
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
34
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
34
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
34
    _terminated = true;
645
34
    return Status::OK();
646
34
}
647
648
template <typename SharedStateArg>
649
2.22M
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
2.22M
    if (_closed) {
651
225k
        return Status::OK();
652
225k
    }
653
2.00M
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
1.17M
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
1.17M
    }
656
2.00M
    _closed = true;
657
2.00M
    return Status::OK();
658
2.22M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
71.5k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
71.5k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
71.5k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
71.5k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
71.5k
    }
656
71.5k
    _closed = true;
657
71.5k
    return Status::OK();
658
71.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
390k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
390k
    if (_closed) {
651
195k
        return Status::OK();
652
195k
    }
653
194k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
194k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
194k
    }
656
194k
    _closed = true;
657
194k
    return Status::OK();
658
390k
}
_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
7.06k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
7.06k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
7.06k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
7.06k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
7.06k
    }
656
7.06k
    _closed = true;
657
7.06k
    return Status::OK();
658
7.06k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
17.0k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
17.0k
    if (_closed) {
651
8.59k
        return Status::OK();
652
8.59k
    }
653
8.42k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
8.42k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
8.42k
    }
656
8.42k
    _closed = true;
657
8.42k
    return Status::OK();
658
17.0k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
86.9k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
86.9k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
86.9k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
86.9k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
86.9k
    }
656
86.9k
    _closed = true;
657
86.9k
    return Status::OK();
658
86.9k
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
99.7k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
99.7k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
99.7k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
99.7k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
99.7k
    }
656
99.7k
    _closed = true;
657
99.7k
    return Status::OK();
658
99.7k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
57
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
57
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
57
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
57
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
57
    }
656
57
    _closed = true;
657
57
    return Status::OK();
658
57
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
845k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
845k
    if (_closed) {
651
14.8k
        return Status::OK();
652
14.8k
    }
653
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
    }
656
830k
    _closed = true;
657
830k
    return Status::OK();
658
845k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
54.0k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
54.0k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
54.0k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
54.0k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
54.0k
    }
656
54.0k
    _closed = true;
657
54.0k
    return Status::OK();
658
54.0k
}
_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
6.05k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
6.05k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
6.05k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
6.05k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
6.05k
    }
656
6.05k
    _closed = true;
657
6.05k
    return Status::OK();
658
6.05k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
832
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
832
    if (_closed) {
651
418
        return Status::OK();
652
418
    }
653
414
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
414
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
414
    }
656
414
    _closed = true;
657
414
    return Status::OK();
658
832
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
10.7k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
10.7k
    if (_closed) {
651
5.62k
        return Status::OK();
652
5.62k
    }
653
5.12k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
5.12k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
5.12k
    }
656
5.12k
    _closed = true;
657
5.12k
    return Status::OK();
658
10.7k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
639k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
639k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
639k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
639k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
639k
    }
656
639k
    _closed = true;
657
639k
    return Status::OK();
658
639k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE5closeEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
322
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
322
    if (_closed) {
651
167
        return Status::OK();
652
167
    }
653
155
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
155
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
155
    }
656
155
    _closed = true;
657
155
    return Status::OK();
658
322
}
659
660
template <typename SharedState>
661
1.67M
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
1.67M
    _operator_profile =
664
1.67M
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
1.67M
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
1.67M
    _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.67M
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
1.67M
    _operator_profile->add_child(_common_profile, true);
673
1.67M
    _operator_profile->add_child(_custom_profile, true);
674
675
1.67M
    _operator_profile->set_metadata(_parent->node_id());
676
1.67M
    _wait_for_finish_dependency_timer =
677
1.67M
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
1.67M
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
1.67M
    if constexpr (!is_fake_shared) {
680
1.19M
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
1.19M
            info.shared_state_map.end()) {
682
336k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
216k
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
216k
            }
685
336k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
336k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
336k
                                                  ? 0
688
336k
                                                  : info.task_idx]
689
336k
                                  .get();
690
336k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
859k
        } else {
692
18.4E
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
18.4E
                DCHECK(false);
694
18.4E
            }
695
859k
            _shared_state = info.shared_state->template cast<SharedState>();
696
859k
            _dependency = _shared_state->create_sink_dependency(
697
859k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
859k
        }
699
1.19M
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
1.19M
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
1.19M
    }
702
703
1.67M
    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.67M
    _rows_input_counter =
708
1.67M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
1.67M
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
1.67M
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
1.67M
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
1.67M
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
1.67M
    _memory_used_counter =
714
1.67M
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
1.67M
    _common_profile->add_info_string("IsColocate",
716
1.67M
                                     std::to_string(_parent->is_colocated_operator()));
717
1.67M
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
1.67M
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
1.67M
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
1.67M
    return Status::OK();
721
1.67M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
119k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
119k
    _operator_profile =
664
119k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
119k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
119k
    _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
119k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
119k
    _operator_profile->add_child(_common_profile, true);
673
119k
    _operator_profile->add_child(_custom_profile, true);
674
675
119k
    _operator_profile->set_metadata(_parent->node_id());
676
119k
    _wait_for_finish_dependency_timer =
677
119k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
119k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
119k
    if constexpr (!is_fake_shared) {
680
119k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
119k
            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
20.1k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
20.1k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
20.1k
                                                  ? 0
688
20.1k
                                                  : info.task_idx]
689
20.1k
                                  .get();
690
20.1k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
99.2k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
99.2k
            _shared_state = info.shared_state->template cast<SharedState>();
696
99.2k
            _dependency = _shared_state->create_sink_dependency(
697
99.2k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
99.2k
        }
699
119k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
119k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
119k
    }
702
703
119k
    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
119k
    _rows_input_counter =
708
119k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
119k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
119k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
119k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
119k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
119k
    _memory_used_counter =
714
119k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
119k
    _common_profile->add_info_string("IsColocate",
716
119k
                                     std::to_string(_parent->is_colocated_operator()));
717
119k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
119k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
119k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
119k
    return Status::OK();
721
119k
}
_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
195k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
195k
    _operator_profile =
664
195k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
195k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
195k
    _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
195k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
195k
    _operator_profile->add_child(_common_profile, true);
673
195k
    _operator_profile->add_child(_custom_profile, true);
674
675
195k
    _operator_profile->set_metadata(_parent->node_id());
676
195k
    _wait_for_finish_dependency_timer =
677
195k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
195k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
195k
    if constexpr (!is_fake_shared) {
680
195k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
195k
            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
195k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
195k
            _shared_state = info.shared_state->template cast<SharedState>();
696
195k
            _dependency = _shared_state->create_sink_dependency(
697
195k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
195k
        }
699
195k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
195k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
195k
    }
702
703
195k
    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
195k
    _rows_input_counter =
708
195k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
195k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
195k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
195k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
195k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
195k
    _memory_used_counter =
714
195k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
195k
    _common_profile->add_info_string("IsColocate",
716
195k
                                     std::to_string(_parent->is_colocated_operator()));
717
195k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
195k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
195k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
195k
    return Status::OK();
721
195k
}
_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
7.05k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
7.05k
    _operator_profile =
664
7.05k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
7.05k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
7.05k
    _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
7.05k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
7.05k
    _operator_profile->add_child(_common_profile, true);
673
7.05k
    _operator_profile->add_child(_custom_profile, true);
674
675
7.05k
    _operator_profile->set_metadata(_parent->node_id());
676
7.05k
    _wait_for_finish_dependency_timer =
677
7.05k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
7.05k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
7.05k
    if constexpr (!is_fake_shared) {
680
7.05k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
7.05k
            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
7.05k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
7.05k
            _shared_state = info.shared_state->template cast<SharedState>();
696
7.05k
            _dependency = _shared_state->create_sink_dependency(
697
7.05k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
7.05k
        }
699
7.05k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
7.05k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
7.05k
    }
702
703
7.05k
    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
7.05k
    _rows_input_counter =
708
7.05k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
7.05k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
7.05k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
7.05k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
7.05k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
7.05k
    _memory_used_counter =
714
7.05k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
7.05k
    _common_profile->add_info_string("IsColocate",
716
7.05k
                                     std::to_string(_parent->is_colocated_operator()));
717
7.05k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
7.05k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
7.05k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
7.05k
    return Status::OK();
721
7.05k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
8.42k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
8.42k
    _operator_profile =
664
8.42k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
8.42k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
8.42k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
8.42k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
8.42k
    _operator_profile->add_child(_common_profile, true);
673
8.42k
    _operator_profile->add_child(_custom_profile, true);
674
675
8.42k
    _operator_profile->set_metadata(_parent->node_id());
676
8.42k
    _wait_for_finish_dependency_timer =
677
8.42k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
8.42k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
8.42k
    if constexpr (!is_fake_shared) {
680
8.42k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
8.42k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
8.42k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
8.42k
            _shared_state = info.shared_state->template cast<SharedState>();
696
8.42k
            _dependency = _shared_state->create_sink_dependency(
697
8.42k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
8.42k
        }
699
8.42k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
8.42k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
8.42k
    }
702
703
8.42k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
8.42k
    _rows_input_counter =
708
8.42k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
8.42k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
8.42k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
8.42k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
8.42k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
8.42k
    _memory_used_counter =
714
8.42k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
8.42k
    _common_profile->add_info_string("IsColocate",
716
8.42k
                                     std::to_string(_parent->is_colocated_operator()));
717
8.42k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
8.42k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
8.42k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
8.42k
    return Status::OK();
721
8.42k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
86.8k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
86.8k
    _operator_profile =
664
86.8k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
86.8k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
86.8k
    _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
86.8k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
86.8k
    _operator_profile->add_child(_common_profile, true);
673
86.8k
    _operator_profile->add_child(_custom_profile, true);
674
675
86.8k
    _operator_profile->set_metadata(_parent->node_id());
676
86.8k
    _wait_for_finish_dependency_timer =
677
86.8k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
86.8k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
86.8k
    if constexpr (!is_fake_shared) {
680
86.8k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
86.8k
            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
86.8k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
86.8k
            _shared_state = info.shared_state->template cast<SharedState>();
696
86.8k
            _dependency = _shared_state->create_sink_dependency(
697
86.8k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
86.8k
        }
699
86.8k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
86.8k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
86.8k
    }
702
703
86.8k
    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
86.8k
    _rows_input_counter =
708
86.8k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
86.8k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
86.8k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
86.8k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
86.8k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
86.8k
    _memory_used_counter =
714
86.8k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
86.8k
    _common_profile->add_info_string("IsColocate",
716
86.8k
                                     std::to_string(_parent->is_colocated_operator()));
717
86.8k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
86.8k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
86.8k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
86.8k
    return Status::OK();
721
86.8k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
100k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
100k
    _operator_profile =
664
100k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
100k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
100k
    _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
100k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
100k
    _operator_profile->add_child(_common_profile, true);
673
100k
    _operator_profile->add_child(_custom_profile, true);
674
675
100k
    _operator_profile->set_metadata(_parent->node_id());
676
100k
    _wait_for_finish_dependency_timer =
677
100k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
100k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
100k
    if constexpr (!is_fake_shared) {
680
100k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
100k
            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
100k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
100k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
100k
                                                  ? 0
688
100k
                                                  : info.task_idx]
689
100k
                                  .get();
690
100k
            _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
100k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
100k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
100k
    }
702
703
100k
    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
100k
    _rows_input_counter =
708
100k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
100k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
100k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
100k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
100k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
100k
    _memory_used_counter =
714
100k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
100k
    _common_profile->add_info_string("IsColocate",
716
100k
                                     std::to_string(_parent->is_colocated_operator()));
717
100k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
100k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
100k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
100k
    return Status::OK();
721
100k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
68
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
68
    _operator_profile =
664
68
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
68
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
68
    _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
68
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
68
    _operator_profile->add_child(_common_profile, true);
673
68
    _operator_profile->add_child(_custom_profile, true);
674
675
68
    _operator_profile->set_metadata(_parent->node_id());
676
68
    _wait_for_finish_dependency_timer =
677
68
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
68
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
68
    if constexpr (!is_fake_shared) {
680
68
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
68
            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
68
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
68
            _shared_state = info.shared_state->template cast<SharedState>();
696
68
            _dependency = _shared_state->create_sink_dependency(
697
68
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
68
        }
699
68
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
68
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
68
    }
702
703
68
    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
68
    _rows_input_counter =
708
68
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
68
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
68
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
68
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
68
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
68
    _memory_used_counter =
714
68
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
68
    _common_profile->add_info_string("IsColocate",
716
68
                                     std::to_string(_parent->is_colocated_operator()));
717
68
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
68
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
68
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
68
    return Status::OK();
721
68
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
480k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
480k
    _operator_profile =
664
480k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
480k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
480k
    _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
480k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
480k
    _operator_profile->add_child(_common_profile, true);
673
480k
    _operator_profile->add_child(_custom_profile, true);
674
675
480k
    _operator_profile->set_metadata(_parent->node_id());
676
480k
    _wait_for_finish_dependency_timer =
677
480k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
480k
    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
480k
    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
480k
    _rows_input_counter =
708
480k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
480k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
480k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
480k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
480k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
480k
    _memory_used_counter =
714
480k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
480k
    _common_profile->add_info_string("IsColocate",
716
480k
                                     std::to_string(_parent->is_colocated_operator()));
717
480k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
480k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
480k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
480k
    return Status::OK();
721
480k
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
9.29k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
9.29k
    _operator_profile =
664
9.29k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
9.29k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
9.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
9.29k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
9.29k
    _operator_profile->add_child(_common_profile, true);
673
9.29k
    _operator_profile->add_child(_custom_profile, true);
674
675
9.29k
    _operator_profile->set_metadata(_parent->node_id());
676
9.29k
    _wait_for_finish_dependency_timer =
677
9.29k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
9.29k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
9.29k
    if constexpr (!is_fake_shared) {
680
9.29k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
9.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
9.29k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
9.29k
            _shared_state = info.shared_state->template cast<SharedState>();
696
9.29k
            _dependency = _shared_state->create_sink_dependency(
697
9.29k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
9.29k
        }
699
9.29k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
9.29k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
9.29k
    }
702
703
9.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
9.29k
    _rows_input_counter =
708
9.29k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
9.29k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
9.29k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
9.29k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
9.29k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
9.29k
    _memory_used_counter =
714
9.29k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
9.29k
    _common_profile->add_info_string("IsColocate",
716
9.29k
                                     std::to_string(_parent->is_colocated_operator()));
717
9.29k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
9.29k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
9.29k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
9.29k
    return Status::OK();
721
9.29k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
518
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
518
    _operator_profile =
664
518
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
518
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
518
    _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
518
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
518
    _operator_profile->add_child(_common_profile, true);
673
518
    _operator_profile->add_child(_custom_profile, true);
674
675
518
    _operator_profile->set_metadata(_parent->node_id());
676
518
    _wait_for_finish_dependency_timer =
677
518
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
518
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
518
    if constexpr (!is_fake_shared) {
680
518
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
518
            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
518
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
518
            _shared_state = info.shared_state->template cast<SharedState>();
696
518
            _dependency = _shared_state->create_sink_dependency(
697
518
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
518
        }
699
518
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
518
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
518
    }
702
703
518
    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
518
    _rows_input_counter =
708
518
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
518
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
518
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
518
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
518
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
518
    _memory_used_counter =
714
518
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
518
    _common_profile->add_info_string("IsColocate",
716
518
                                     std::to_string(_parent->is_colocated_operator()));
717
518
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
518
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
518
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
518
    return Status::OK();
721
518
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
2.56k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
2.56k
    _operator_profile =
664
2.56k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
2.56k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
2.56k
    _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.56k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
2.56k
    _operator_profile->add_child(_common_profile, true);
673
2.56k
    _operator_profile->add_child(_custom_profile, true);
674
675
2.56k
    _operator_profile->set_metadata(_parent->node_id());
676
2.56k
    _wait_for_finish_dependency_timer =
677
2.56k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
2.56k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
2.56k
    if constexpr (!is_fake_shared) {
680
2.56k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
2.56k
            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.56k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
2.56k
            _shared_state = info.shared_state->template cast<SharedState>();
696
2.56k
            _dependency = _shared_state->create_sink_dependency(
697
2.56k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
2.56k
        }
699
2.56k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
2.56k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
2.56k
    }
702
703
2.56k
    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.56k
    _rows_input_counter =
708
2.56k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
2.56k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
2.56k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
2.56k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
2.56k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
2.56k
    _memory_used_counter =
714
2.56k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
2.56k
    _common_profile->add_info_string("IsColocate",
716
2.56k
                                     std::to_string(_parent->is_colocated_operator()));
717
2.56k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
2.56k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
2.56k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
2.56k
    return Status::OK();
721
2.56k
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
12.3k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
12.3k
    _operator_profile =
664
12.3k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
12.3k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
12.3k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
12.3k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
12.3k
    _operator_profile->add_child(_common_profile, true);
673
12.3k
    _operator_profile->add_child(_custom_profile, true);
674
675
12.3k
    _operator_profile->set_metadata(_parent->node_id());
676
12.3k
    _wait_for_finish_dependency_timer =
677
12.3k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
12.3k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
12.3k
    if constexpr (!is_fake_shared) {
680
12.3k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
12.3k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
12.3k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
12.3k
            _shared_state = info.shared_state->template cast<SharedState>();
696
12.3k
            _dependency = _shared_state->create_sink_dependency(
697
12.3k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
12.3k
        }
699
12.3k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
12.3k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
12.3k
    }
702
703
12.3k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
12.3k
    _rows_input_counter =
708
12.3k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
12.3k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
12.3k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
12.3k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
12.3k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
12.3k
    _memory_used_counter =
714
12.3k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
12.3k
    _common_profile->add_info_string("IsColocate",
716
12.3k
                                     std::to_string(_parent->is_colocated_operator()));
717
12.3k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
12.3k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
12.3k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
12.3k
    return Status::OK();
721
12.3k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
215k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
215k
    _operator_profile =
664
215k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
215k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
215k
    _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
215k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
215k
    _operator_profile->add_child(_common_profile, true);
673
215k
    _operator_profile->add_child(_custom_profile, true);
674
675
215k
    _operator_profile->set_metadata(_parent->node_id());
676
215k
    _wait_for_finish_dependency_timer =
677
215k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
215k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
215k
    if constexpr (!is_fake_shared) {
680
215k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
216k
            info.shared_state_map.end()) {
682
216k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
216k
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
216k
            }
685
216k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
216k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
216k
                                                  ? 0
688
216k
                                                  : info.task_idx]
689
216k
                                  .get();
690
216k
            _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
215k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
215k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
215k
    }
702
703
215k
    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
215k
    _rows_input_counter =
708
215k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
215k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
215k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
215k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
215k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
215k
    _memory_used_counter =
714
215k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
215k
    _common_profile->add_info_string("IsColocate",
716
215k
                                     std::to_string(_parent->is_colocated_operator()));
717
215k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
215k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
215k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
215k
    return Status::OK();
721
215k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
437k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
437k
    _operator_profile =
664
437k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
437k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
437k
    _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
437k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
437k
    _operator_profile->add_child(_common_profile, true);
673
437k
    _operator_profile->add_child(_custom_profile, true);
674
675
437k
    _operator_profile->set_metadata(_parent->node_id());
676
437k
    _wait_for_finish_dependency_timer =
677
437k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
437k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
437k
    if constexpr (!is_fake_shared) {
680
437k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
437k
            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
437k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
437k
            _shared_state = info.shared_state->template cast<SharedState>();
696
437k
            _dependency = _shared_state->create_sink_dependency(
697
437k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
437k
        }
699
437k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
437k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
437k
    }
702
703
437k
    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
437k
    _rows_input_counter =
708
437k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
437k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
437k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
437k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
437k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
437k
    _memory_used_counter =
714
437k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
437k
    _common_profile->add_info_string("IsColocate",
716
437k
                                     std::to_string(_parent->is_colocated_operator()));
717
437k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
437k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
437k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
437k
    return Status::OK();
721
437k
}
_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
328
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
328
    _operator_profile =
664
328
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
328
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
328
    _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
328
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
328
    _operator_profile->add_child(_common_profile, true);
673
328
    _operator_profile->add_child(_custom_profile, true);
674
675
328
    _operator_profile->set_metadata(_parent->node_id());
676
328
    _wait_for_finish_dependency_timer =
677
328
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
328
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
328
    if constexpr (!is_fake_shared) {
680
328
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
328
            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
328
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
328
            _shared_state = info.shared_state->template cast<SharedState>();
696
328
            _dependency = _shared_state->create_sink_dependency(
697
328
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
328
        }
699
328
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
328
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
328
    }
702
703
328
    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
328
    _rows_input_counter =
708
328
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
328
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
328
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
328
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
328
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
328
    _memory_used_counter =
714
328
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
328
    _common_profile->add_info_string("IsColocate",
716
328
                                     std::to_string(_parent->is_colocated_operator()));
717
328
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
328
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
328
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
328
    return Status::OK();
721
328
}
722
723
template <typename SharedState>
724
1.68M
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
1.68M
    if (_closed) {
726
2
        return Status::OK();
727
2
    }
728
1.68M
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
1.19M
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
1.19M
    }
731
1.68M
    _closed = true;
732
1.68M
    return Status::OK();
733
1.68M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
119k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
119k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
119k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
119k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
119k
    }
731
119k
    _closed = true;
732
119k
    return Status::OK();
733
119k
}
_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
195k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
195k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
195k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
195k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
195k
    }
731
195k
    _closed = true;
732
195k
    return Status::OK();
733
195k
}
_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
7.04k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
7.04k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
7.04k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
7.04k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
7.04k
    }
731
7.04k
    _closed = true;
732
7.04k
    return Status::OK();
733
7.04k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
8.40k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
8.40k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
8.40k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
8.40k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
8.40k
    }
731
8.40k
    _closed = true;
732
8.40k
    return Status::OK();
733
8.40k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
86.7k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
86.7k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
86.7k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
86.7k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
86.7k
    }
731
86.7k
    _closed = true;
732
86.7k
    return Status::OK();
733
86.7k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
99.6k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
99.6k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
99.6k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
99.6k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
99.6k
    }
731
99.6k
    _closed = true;
732
99.6k
    return Status::OK();
733
99.6k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
57
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
57
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
57
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
57
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
57
    }
731
57
    _closed = true;
732
57
    return Status::OK();
733
57
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
483k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
483k
    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
483k
    _closed = true;
732
483k
    return Status::OK();
733
483k
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
9.31k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
9.31k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
9.31k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
9.31k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
9.31k
    }
731
9.31k
    _closed = true;
732
9.31k
    return Status::OK();
733
9.31k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
418
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
418
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
418
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
418
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
418
    }
731
418
    _closed = true;
732
418
    return Status::OK();
733
418
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
2.56k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
2.56k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
2.56k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
2.56k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
2.56k
    }
731
2.56k
    _closed = true;
732
2.56k
    return Status::OK();
733
2.56k
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
12.4k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
12.4k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
12.4k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
12.4k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
12.4k
    }
731
12.4k
    _closed = true;
732
12.4k
    return Status::OK();
733
12.4k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
216k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
216k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
216k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
216k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
216k
    }
731
216k
    _closed = true;
732
216k
    return Status::OK();
733
216k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
440k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
440k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
440k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
440k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
440k
    }
731
440k
    _closed = true;
732
440k
    return Status::OK();
733
440k
}
_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
328
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
328
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
328
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
328
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
328
    }
731
328
    _closed = true;
732
328
    return Status::OK();
733
328
}
734
735
template <typename LocalStateType>
736
Status StreamingOperatorX<LocalStateType>::get_block_impl(RuntimeState* state, Block* block,
737
5.02k
                                                          bool* eos) {
738
5.02k
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
739
5.02k
    return pull(state, block, eos);
740
5.02k
}
_ZN5doris18StreamingOperatorXINS_23AssertNumRowsLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
737
37
                                                          bool* eos) {
738
37
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
739
37
    return pull(state, block, eos);
740
37
}
_ZN5doris18StreamingOperatorXINS_16SelectLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
737
4.98k
                                                          bool* eos) {
738
4.98k
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
739
4.98k
    return pull(state, block, eos);
740
4.98k
}
741
742
template <typename LocalStateType>
743
Status StatefulOperatorX<LocalStateType>::get_block_impl(RuntimeState* state, Block* block,
744
560k
                                                         bool* eos) {
745
560k
    auto& local_state = get_local_state(state);
746
560k
    if (need_more_input_data(state)) {
747
528k
        local_state._child_block->clear_column_data(
748
528k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
528k
                        .num_materialized_slots());
750
528k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
528k
                state, local_state._child_block.get(), &local_state._child_eos));
752
528k
        *eos = local_state._child_eos;
753
528k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
91.2k
            return Status::OK();
755
91.2k
        }
756
437k
        {
757
437k
            SCOPED_TIMER(local_state.exec_time_counter());
758
437k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
437k
        }
760
437k
    }
761
762
469k
    if (!need_more_input_data(state)) {
763
444k
        SCOPED_TIMER(local_state.exec_time_counter());
764
444k
        bool new_eos = false;
765
444k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
444k
        if (new_eos) {
767
364k
            *eos = true;
768
364k
        } else if (!need_more_input_data(state)) {
769
25.4k
            *eos = false;
770
25.4k
        }
771
444k
    }
772
469k
    return Status::OK();
773
469k
}
_ZN5doris17StatefulOperatorXINS_23HashJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
147k
                                                         bool* eos) {
745
147k
    auto& local_state = get_local_state(state);
746
147k
    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
41.4k
            return Status::OK();
755
41.4k
        }
756
87.4k
        {
757
87.4k
            SCOPED_TIMER(local_state.exec_time_counter());
758
87.4k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
87.4k
        }
760
87.4k
    }
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
47.1k
            *eos = true;
768
58.5k
        } else if (!need_more_input_data(state)) {
769
11.0k
            *eos = false;
770
11.0k
        }
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.22k
                                                         bool* eos) {
745
4.22k
    auto& local_state = get_local_state(state);
746
4.22k
    if (need_more_input_data(state)) {
747
2.30k
        local_state._child_block->clear_column_data(
748
2.30k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
2.30k
                        .num_materialized_slots());
750
2.30k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
2.30k
                state, local_state._child_block.get(), &local_state._child_eos));
752
2.30k
        *eos = local_state._child_eos;
753
2.30k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
307
            return Status::OK();
755
307
        }
756
2.00k
        {
757
2.00k
            SCOPED_TIMER(local_state.exec_time_counter());
758
2.00k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
2.00k
        }
760
2.00k
    }
761
762
3.94k
    if (!need_more_input_data(state)) {
763
3.94k
        SCOPED_TIMER(local_state.exec_time_counter());
764
3.94k
        bool new_eos = false;
765
3.94k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
3.94k
        if (new_eos) {
767
1.43k
            *eos = true;
768
2.51k
        } else if (!need_more_input_data(state)) {
769
1.90k
            *eos = false;
770
1.90k
        }
771
3.94k
    }
772
3.91k
    return Status::OK();
773
3.91k
}
_ZN5doris17StatefulOperatorXINS_25MaterializationLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
1.89k
                                                         bool* eos) {
745
1.89k
    auto& local_state = get_local_state(state);
746
1.89k
    if (need_more_input_data(state)) {
747
1.89k
        local_state._child_block->clear_column_data(
748
1.89k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
1.89k
                        .num_materialized_slots());
750
1.89k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
1.89k
                state, local_state._child_block.get(), &local_state._child_eos));
752
1.89k
        *eos = local_state._child_eos;
753
1.89k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
763
            return Status::OK();
755
763
        }
756
1.12k
        {
757
1.12k
            SCOPED_TIMER(local_state.exec_time_counter());
758
1.12k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
1.12k
        }
760
1.12k
    }
761
762
1.12k
    if (!need_more_input_data(state)) {
763
1.12k
        SCOPED_TIMER(local_state.exec_time_counter());
764
1.12k
        bool new_eos = false;
765
1.12k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
1.12k
        if (new_eos) {
767
787
            *eos = true;
768
787
        } else if (!need_more_input_data(state)) {
769
0
            *eos = false;
770
0
        }
771
1.12k
    }
772
1.12k
    return Status::OK();
773
1.12k
}
_ZN5doris17StatefulOperatorXINS_22StreamingAggLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
18.2k
                                                         bool* eos) {
745
18.2k
    auto& local_state = get_local_state(state);
746
18.2k
    if (need_more_input_data(state)) {
747
18.2k
        local_state._child_block->clear_column_data(
748
18.2k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
18.2k
                        .num_materialized_slots());
750
18.2k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
18.2k
                state, local_state._child_block.get(), &local_state._child_eos));
752
18.2k
        *eos = local_state._child_eos;
753
18.2k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
6.73k
            return Status::OK();
755
6.73k
        }
756
11.4k
        {
757
11.4k
            SCOPED_TIMER(local_state.exec_time_counter());
758
11.4k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
11.4k
        }
760
11.4k
    }
761
762
11.4k
    if (!need_more_input_data(state)) {
763
6.02k
        SCOPED_TIMER(local_state.exec_time_counter());
764
6.02k
        bool new_eos = false;
765
6.02k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
6.02k
        if (new_eos) {
767
5.95k
            *eos = true;
768
5.95k
        } else if (!need_more_input_data(state)) {
769
0
            *eos = false;
770
0
        }
771
6.02k
    }
772
11.4k
    return Status::OK();
773
11.4k
}
_ZN5doris17StatefulOperatorXINS_30DistinctStreamingAggLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
358k
                                                         bool* eos) {
745
358k
    auto& local_state = get_local_state(state);
746
358k
    if (need_more_input_data(state)) {
747
358k
        local_state._child_block->clear_column_data(
748
358k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
358k
                        .num_materialized_slots());
750
358k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
358k
                state, local_state._child_block.get(), &local_state._child_eos));
752
358k
        *eos = local_state._child_eos;
753
358k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
40.4k
            return Status::OK();
755
40.4k
        }
756
318k
        {
757
318k
            SCOPED_TIMER(local_state.exec_time_counter());
758
318k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
318k
        }
760
318k
    }
761
762
317k
    if (!need_more_input_data(state)) {
763
298k
        SCOPED_TIMER(local_state.exec_time_counter());
764
298k
        bool new_eos = false;
765
298k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
298k
        if (new_eos) {
767
298k
            *eos = true;
768
298k
        } else if (!need_more_input_data(state)) {
769
0
            *eos = false;
770
0
        }
771
298k
    }
772
317k
    return Status::OK();
773
317k
}
_ZN5doris17StatefulOperatorXINS_29NestedLoopJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
23.9k
                                                         bool* eos) {
745
23.9k
    auto& local_state = get_local_state(state);
746
23.9k
    if (need_more_input_data(state)) {
747
11.9k
        local_state._child_block->clear_column_data(
748
11.9k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
11.9k
                        .num_materialized_slots());
750
11.9k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
11.9k
                state, local_state._child_block.get(), &local_state._child_eos));
752
11.9k
        *eos = local_state._child_eos;
753
11.9k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
571
            return Status::OK();
755
571
        }
756
11.3k
        {
757
11.3k
            SCOPED_TIMER(local_state.exec_time_counter());
758
11.3k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
11.3k
        }
760
11.3k
    }
761
762
23.4k
    if (!need_more_input_data(state)) {
763
22.8k
        SCOPED_TIMER(local_state.exec_time_counter());
764
22.8k
        bool new_eos = false;
765
22.8k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
22.8k
        if (new_eos) {
767
7.02k
            *eos = true;
768
15.8k
        } else if (!need_more_input_data(state)) {
769
12.0k
            *eos = false;
770
12.0k
        }
771
22.8k
    }
772
23.4k
    return Status::OK();
773
23.4k
}
_ZN5doris17StatefulOperatorXINS_23TableFunctionLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
7.01k
                                                         bool* eos) {
745
7.01k
    auto& local_state = get_local_state(state);
746
7.01k
    if (need_more_input_data(state)) {
747
6.66k
        local_state._child_block->clear_column_data(
748
6.66k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
6.66k
                        .num_materialized_slots());
750
6.66k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
6.66k
                state, local_state._child_block.get(), &local_state._child_eos));
752
6.66k
        *eos = local_state._child_eos;
753
6.66k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
929
            return Status::OK();
755
929
        }
756
5.73k
        {
757
5.73k
            SCOPED_TIMER(local_state.exec_time_counter());
758
5.73k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
5.73k
        }
760
5.73k
    }
761
762
6.09k
    if (!need_more_input_data(state)) {
763
6.09k
        SCOPED_TIMER(local_state.exec_time_counter());
764
6.09k
        bool new_eos = false;
765
6.09k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
6.09k
        if (new_eos) {
767
4.05k
            *eos = true;
768
4.05k
        } else if (!need_more_input_data(state)) {
769
366
            *eos = false;
770
366
        }
771
6.09k
    }
772
6.08k
    return Status::OK();
773
6.08k
}
774
775
template <typename Writer, typename Parent>
776
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
777
44.9k
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
778
44.9k
    RETURN_IF_ERROR(Base::init(state, info));
779
44.9k
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
780
44.9k
                                                         "AsyncWriterDependency", true);
781
44.9k
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
782
44.9k
                             _finish_dependency));
783
784
44.9k
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
785
44.9k
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
786
44.9k
    return Status::OK();
787
44.9k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
777
354
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
778
354
    RETURN_IF_ERROR(Base::init(state, info));
779
354
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
780
354
                                                         "AsyncWriterDependency", true);
781
354
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
782
354
                             _finish_dependency));
783
784
354
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
785
354
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
786
354
    return Status::OK();
787
354
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
777
44.5k
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
778
44.5k
    RETURN_IF_ERROR(Base::init(state, info));
779
44.5k
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
780
44.5k
                                                         "AsyncWriterDependency", true);
781
44.5k
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
782
44.5k
                             _finish_dependency));
783
784
44.5k
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
785
44.5k
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
786
44.5k
    return Status::OK();
787
44.5k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
777
7
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
778
7
    RETURN_IF_ERROR(Base::init(state, info));
779
7
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
780
7
                                                         "AsyncWriterDependency", true);
781
7
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
782
7
                             _finish_dependency));
783
784
7
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
785
7
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
786
7
    return Status::OK();
787
7
}
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
45.5k
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
792
45.5k
    RETURN_IF_ERROR(Base::open(state));
793
45.5k
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
794
350k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
795
305k
        RETURN_IF_ERROR(
796
305k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
797
305k
    }
798
45.5k
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
799
45.5k
    return Status::OK();
800
45.5k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
791
360
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
792
360
    RETURN_IF_ERROR(Base::open(state));
793
360
    _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
360
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
799
360
    return Status::OK();
800
360
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4openEPNS_12RuntimeStateE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
791
45.1k
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
792
45.1k
    RETURN_IF_ERROR(Base::open(state));
793
45.1k
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
794
349k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
795
303k
        RETURN_IF_ERROR(
796
303k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
797
303k
    }
798
45.1k
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
799
45.1k
    return Status::OK();
800
45.1k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
791
7
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
792
7
    RETURN_IF_ERROR(Base::open(state));
793
7
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
794
126
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
795
119
        RETURN_IF_ERROR(
796
119
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
797
119
    }
798
7
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
799
7
    return Status::OK();
800
7
}
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
60.3k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
805
60.3k
    return _writer->sink(block, eos);
806
60.3k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
804
1.17k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
805
1.17k
    return _writer->sink(block, eos);
806
1.17k
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
804
59.2k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
805
59.2k
    return _writer->sink(block, eos);
806
59.2k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
804
7
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
805
7
    return _writer->sink(block, eos);
806
7
}
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
45.5k
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
811
45.5k
    if (_closed) {
812
0
        return Status::OK();
813
0
    }
814
45.5k
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
815
45.5k
    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
45.6k
    if (_writer) {
818
45.6k
        Status st = _writer->get_writer_status();
819
45.6k
        if (exec_status.ok()) {
820
45.5k
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
821
45.5k
                                                       : Status::Cancelled("force close"));
822
45.5k
        } else {
823
93
            _writer->force_close(exec_status);
824
93
        }
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
45.6k
        RETURN_IF_ERROR(st);
829
45.6k
    }
830
45.5k
    return Base::close(state, exec_status);
831
45.5k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
810
349
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
811
349
    if (_closed) {
812
0
        return Status::OK();
813
0
    }
814
349
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
815
349
    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
349
    if (_writer) {
818
349
        Status st = _writer->get_writer_status();
819
349
        if (exec_status.ok()) {
820
349
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
821
349
                                                       : Status::Cancelled("force close"));
822
349
        } 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
349
        RETURN_IF_ERROR(st);
829
349
    }
830
349
    return Base::close(state, exec_status);
831
349
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
810
45.2k
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
811
45.2k
    if (_closed) {
812
0
        return Status::OK();
813
0
    }
814
45.2k
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
815
45.2k
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
816
    // if the init failed, the _writer may be nullptr. so here need check
817
45.2k
    if (_writer) {
818
45.2k
        Status st = _writer->get_writer_status();
819
45.2k
        if (exec_status.ok()) {
820
45.1k
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
821
45.1k
                                                       : Status::Cancelled("force close"));
822
45.1k
        } else {
823
93
            _writer->force_close(exec_status);
824
93
        }
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
45.2k
        RETURN_IF_ERROR(st);
829
45.2k
    }
830
45.1k
    return Base::close(state, exec_status);
831
45.2k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
810
7
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
811
7
    if (_closed) {
812
0
        return Status::OK();
813
0
    }
814
7
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
815
7
    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
7
    if (_writer) {
818
7
        Status st = _writer->get_writer_status();
819
7
        if (exec_status.ok()) {
820
7
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
821
7
                                                       : Status::Cancelled("force close"));
822
7
        } 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
7
        RETURN_IF_ERROR(st);
829
7
    }
830
7
    return Base::close(state, exec_status);
831
7
}
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