Coverage Report

Created: 2026-08-21 02:58

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
25.9k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
25.9k
    if (_parent->nereids_id() == -1) {
122
1.15k
        return fmt::format("(id={})", _parent->node_id());
123
24.8k
    } else {
124
24.8k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
24.8k
    }
126
25.9k
}
_ZNK5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
24.0k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
24.0k
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
24.0k
    } else {
124
24.0k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
24.0k
    }
126
24.0k
}
_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
101
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
101
    if (_parent->nereids_id() == -1) {
122
12
        return fmt::format("(id={})", _parent->node_id());
123
89
    } else {
124
89
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
89
    }
126
101
}
_ZNK5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
14
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
14
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
14
    } else {
124
14
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
14
    }
126
14
}
_ZNK5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
130
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
130
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
130
    } else {
124
130
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
130
    }
126
130
}
_ZNK5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
11
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
11
    if (_parent->nereids_id() == -1) {
122
11
        return fmt::format("(id={})", _parent->node_id());
123
11
    } else {
124
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
0
    }
126
11
}
_ZNK5doris19PipelineXLocalStateINS_14AggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
403
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
403
    if (_parent->nereids_id() == -1) {
122
29
        return fmt::format("(id={})", _parent->node_id());
123
374
    } else {
124
374
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
374
    }
126
403
}
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE11name_suffixB5cxx11Ev
_ZNK5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
65
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
65
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
65
    } else {
124
65
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
65
    }
126
65
}
_ZNK5doris19PipelineXLocalStateINS_15FakeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
709
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
709
    if (_parent->nereids_id() == -1) {
122
623
        return fmt::format("(id={})", _parent->node_id());
123
623
    } else {
124
86
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
86
    }
126
709
}
_ZNK5doris19PipelineXLocalStateINS_16UnionSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
14
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
14
    if (_parent->nereids_id() == -1) {
122
2
        return fmt::format("(id={})", _parent->node_id());
123
12
    } else {
124
12
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
12
    }
126
14
}
_ZNK5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
12
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
12
    if (_parent->nereids_id() == -1) {
122
12
        return fmt::format("(id={})", _parent->node_id());
123
12
    } else {
124
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
0
    }
126
12
}
_ZNK5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
195
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
195
    if (_parent->nereids_id() == -1) {
122
195
        return fmt::format("(id={})", _parent->node_id());
123
195
    } else {
124
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
0
    }
126
195
}
_ZNK5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
102
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
102
    if (_parent->nereids_id() == -1) {
122
102
        return fmt::format("(id={})", _parent->node_id());
123
102
    } else {
124
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
0
    }
126
102
}
_ZNK5doris19PipelineXLocalStateINS_14SetSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
13
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
13
    if (_parent->nereids_id() == -1) {
122
13
        return fmt::format("(id={})", _parent->node_id());
123
13
    } else {
124
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
0
    }
126
13
}
_ZNK5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
152
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
152
    if (_parent->nereids_id() == -1) {
122
152
        return fmt::format("(id={})", _parent->node_id());
123
152
    } else {
124
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
0
    }
126
152
}
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_16BasicSharedStateEE11name_suffixB5cxx11Ev
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_17RecCTESharedStateEE11name_suffixB5cxx11Ev
127
128
template <typename SharedStateArg>
129
73.4k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
73.4k
    if (_parent->nereids_id() == -1) {
131
722
        return fmt::format("(id={})", _parent->node_id());
132
72.7k
    } else {
133
72.7k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
72.7k
    }
135
73.4k
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
72.0k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
72.0k
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
72.0k
    } else {
133
72.0k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
72.0k
    }
135
72.0k
}
_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
105
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
105
    if (_parent->nereids_id() == -1) {
131
9
        return fmt::format("(id={})", _parent->node_id());
132
96
    } else {
133
96
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
96
    }
135
105
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
21
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
21
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
21
    } else {
133
21
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
21
    }
135
21
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
131
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
131
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
131
    } else {
133
131
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
131
    }
135
131
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
11
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
11
    if (_parent->nereids_id() == -1) {
131
11
        return fmt::format("(id={})", _parent->node_id());
132
11
    } else {
133
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
0
    }
135
11
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
413
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
413
    if (_parent->nereids_id() == -1) {
131
29
        return fmt::format("(id={})", _parent->node_id());
132
384
    } else {
133
384
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
384
    }
135
413
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE11name_suffixB5cxx11Ev
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
75
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
75
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
75
    } else {
133
75
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
75
    }
135
75
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE11name_suffixB5cxx11Ev
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
3
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
3
    if (_parent->nereids_id() == -1) {
131
3
        return fmt::format("(id={})", _parent->node_id());
132
3
    } else {
133
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
0
    }
135
3
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
102
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
102
    if (_parent->nereids_id() == -1) {
131
102
        return fmt::format("(id={})", _parent->node_id());
132
102
    } else {
133
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
0
    }
135
102
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE11name_suffixB5cxx11Ev
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
29
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
29
    if (_parent->nereids_id() == -1) {
131
29
        return fmt::format("(id={})", _parent->node_id());
132
29
    } else {
133
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
0
    }
135
29
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
14
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
14
    if (_parent->nereids_id() == -1) {
131
14
        return fmt::format("(id={})", _parent->node_id());
132
14
    } else {
133
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
0
    }
135
14
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
514
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
514
    if (_parent->nereids_id() == -1) {
131
513
        return fmt::format("(id={})", _parent->node_id());
132
513
    } else {
133
1
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
1
    }
135
514
}
_ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
11
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
11
    if (_parent->nereids_id() == -1) {
131
11
        return fmt::format("(id={})", _parent->node_id());
132
11
    } else {
133
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
0
    }
135
11
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE11name_suffixB5cxx11Ev
136
137
template <typename SharedStateArg>
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
}
_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
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
2
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
2
    _terminated = true;
143
2
    return Status::OK();
144
2
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE9terminateEPNS_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
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
39
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
39
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
39
    _terminated = true;
143
39
    return Status::OK();
144
39
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE9terminateEPNS_12RuntimeStateE
145
146
1.84k
DataDistribution OperatorBase::required_data_distribution(RuntimeState* /*state*/) const {
147
1.84k
    return _child && _child->is_serial_operator() && !is_source()
148
1.84k
                   ? DataDistribution(TLocalPartitionType::PASSTHROUGH)
149
1.84k
                   : DataDistribution(TLocalPartitionType::NOOP);
150
1.84k
}
151
152
199
bool OperatorBase::child_breaks_local_key_distribution(RuntimeState* state) const {
153
199
    if (!_child) {
154
65
        return false;
155
65
    }
156
134
    if (_child->is_serial_operator()) {
157
30
        return true;
158
30
    }
159
104
    const auto child_distribution = _child->required_data_distribution(state);
160
104
    return child_distribution.need_local_exchange() &&
161
104
           !is_shuffled_exchange(child_distribution.distribution_type);
162
134
}
163
164
72.0k
const RowDescriptor& OperatorBase::row_desc() const {
165
72.0k
    return _child->row_desc();
166
72.0k
}
167
168
template <typename SharedStateArg>
169
16.3k
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
170
16.3k
    fmt::memory_buffer debug_string_buffer;
171
16.3k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
172
16.3k
    return fmt::to_string(debug_string_buffer);
173
16.3k
}
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE12debug_stringB5cxx11Ei
_ZNK5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
169
3
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
170
3
    fmt::memory_buffer debug_string_buffer;
171
3
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
172
3
    return fmt::to_string(debug_string_buffer);
173
3
}
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_15SortSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_14AggSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE12debug_stringB5cxx11Ei
_ZNK5doris19PipelineXLocalStateINS_15FakeSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
169
16.3k
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
170
16.3k
    fmt::memory_buffer debug_string_buffer;
171
16.3k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
172
16.3k
    return fmt::to_string(debug_string_buffer);
173
16.3k
}
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_16UnionSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_14SetSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_16BasicSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_17RecCTESharedStateEE12debug_stringB5cxx11Ei
174
175
template <typename SharedStateArg>
176
16.3k
std::string PipelineXSinkLocalState<SharedStateArg>::debug_string(int indentation_level) const {
177
16.3k
    fmt::memory_buffer debug_string_buffer;
178
16.3k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
179
16.3k
    return fmt::to_string(debug_string_buffer);
180
16.3k
}
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE12debug_stringB5cxx11Ei
_ZNK5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
176
16.3k
std::string PipelineXSinkLocalState<SharedStateArg>::debug_string(int indentation_level) const {
177
16.3k
    fmt::memory_buffer debug_string_buffer;
178
16.3k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
179
16.3k
    return fmt::to_string(debug_string_buffer);
180
16.3k
}
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE12debug_stringB5cxx11Ei
181
182
16.3k
std::string OperatorXBase::debug_string(int indentation_level) const {
183
16.3k
    fmt::memory_buffer debug_string_buffer;
184
16.3k
    fmt::format_to(debug_string_buffer, "{}{}: id={}, parallel_tasks={}, _is_serial_operator={}",
185
16.3k
                   std::string(indentation_level * 2, ' '), _op_name, node_id(), _parallel_tasks,
186
16.3k
                   _is_serial_operator);
187
16.3k
    return fmt::to_string(debug_string_buffer);
188
16.3k
}
189
190
16.3k
std::string OperatorXBase::debug_string(RuntimeState* state, int indentation_level) const {
191
16.3k
    return state->get_local_state(operator_id())->debug_string(indentation_level);
192
16.3k
}
193
194
25.9k
Status OperatorXBase::init(const TPlanNode& tnode, RuntimeState* state) {
195
25.9k
    std::string node_name = print_plan_node_type(tnode.node_type);
196
25.9k
    _nereids_id = tnode.nereids_id;
197
25.9k
    if (!tnode.intermediate_output_tuple_id_list.empty()) {
198
8
        if (!tnode.__isset.output_tuple_id) {
199
0
            return Status::InternalError("no final output tuple id");
200
0
        }
201
8
        if (tnode.intermediate_output_tuple_id_list.size() !=
202
8
            tnode.intermediate_projections_list.size()) {
203
0
            return Status::InternalError(
204
0
                    "intermediate_output_tuple_id_list size:{} not match "
205
0
                    "intermediate_projections_list size:{}",
206
0
                    tnode.intermediate_output_tuple_id_list.size(),
207
0
                    tnode.intermediate_projections_list.size());
208
0
        }
209
8
    }
210
25.9k
    auto substr = node_name.substr(0, node_name.find("_NODE"));
211
25.9k
    _op_name = substr + "_OPERATOR";
212
213
25.9k
    if (tnode.__isset.vconjunct) {
214
0
        return Status::InternalError("vconjunct is not supported yet");
215
25.9k
    } else if (tnode.__isset.conjuncts) {
216
993
        for (const auto& conjunct : tnode.conjuncts) {
217
993
            VExprContextSPtr context;
218
993
            RETURN_IF_ERROR(VExpr::create_expr_tree(conjunct, context));
219
993
            _conjuncts.emplace_back(context);
220
993
        }
221
282
    }
222
223
    // create the projections expr
224
25.9k
    if (tnode.__isset.projections) {
225
24.9k
        DCHECK(tnode.__isset.output_tuple_id);
226
24.9k
        RETURN_IF_ERROR(VExpr::create_expr_trees(tnode.projections, _projections));
227
24.9k
    }
228
25.9k
    if (!tnode.intermediate_projections_list.empty()) {
229
8
        DCHECK(tnode.__isset.projections) << "no final projections";
230
8
        _intermediate_projections.reserve(tnode.intermediate_projections_list.size());
231
40
        for (const auto& tnode_projections : tnode.intermediate_projections_list) {
232
40
            VExprContextSPtrs projections;
233
40
            RETURN_IF_ERROR(VExpr::create_expr_trees(tnode_projections, projections));
234
40
            _intermediate_projections.push_back(projections);
235
40
        }
236
8
    }
237
25.9k
    return Status::OK();
238
25.9k
}
239
240
50.1k
Status OperatorXBase::prepare(RuntimeState* state) {
241
50.1k
    for (auto& conjunct : _conjuncts) {
242
990
        RETURN_IF_ERROR(conjunct->prepare(state, intermediate_row_desc()));
243
990
    }
244
50.1k
    if (state->enable_adjust_conjunct_order_by_cost()) {
245
1.96k
        std::ranges::stable_sort(_conjuncts, [](const auto& a, const auto& b) {
246
1.39k
            return a->execute_cost() < b->execute_cost();
247
1.39k
        });
248
1.96k
    };
249
250
50.2k
    for (int i = 0; i < _intermediate_projections.size(); i++) {
251
40
        RETURN_IF_ERROR(
252
40
                VExpr::prepare(_intermediate_projections[i], state, intermediate_row_desc(i)));
253
40
    }
254
50.1k
    RETURN_IF_ERROR(VExpr::prepare(_projections, state, projections_row_desc()));
255
256
50.1k
    if (has_output_row_desc()) {
257
24.9k
        RETURN_IF_ERROR(VExpr::check_expr_output_type(_projections, *_output_row_descriptor));
258
24.9k
    }
259
260
50.1k
    for (auto& conjunct : _conjuncts) {
261
990
        RETURN_IF_ERROR(conjunct->open(state));
262
990
    }
263
50.1k
    RETURN_IF_ERROR(VExpr::open(_projections, state));
264
50.1k
    for (auto& projections : _intermediate_projections) {
265
40
        RETURN_IF_ERROR(VExpr::open(projections, state));
266
40
    }
267
50.1k
    if (_child && !is_source()) {
268
24.2k
        RETURN_IF_ERROR(_child->prepare(state));
269
24.2k
    }
270
271
50.1k
    if (VExpr::contains_blockable_function(_conjuncts) ||
272
50.1k
        VExpr::contains_blockable_function(_projections)) {
273
0
        _blockable = true;
274
0
    }
275
276
50.1k
    return Status::OK();
277
50.1k
}
278
279
82
Status OperatorXBase::terminate(RuntimeState* state) {
280
82
    if (_child && !is_source()) {
281
40
        RETURN_IF_ERROR(_child->terminate(state));
282
40
    }
283
82
    auto result = state->get_local_state_result(operator_id());
284
82
    if (!result) {
285
0
        return result.error();
286
0
    }
287
82
    return result.value()->terminate(state);
288
82
}
289
290
28.9k
Status OperatorXBase::close(RuntimeState* state) {
291
28.9k
    if (_child && !is_source()) {
292
24.4k
        RETURN_IF_ERROR(_child->close(state));
293
24.4k
    }
294
28.9k
    auto result = state->get_local_state_result(operator_id());
295
28.9k
    if (!result) {
296
0
        return result.error();
297
0
    }
298
28.9k
    return result.value()->close(state);
299
28.9k
}
300
301
606
void PipelineXLocalStateBase::clear_origin_block() {
302
606
    _origin_block.clear_column_data(_parent->intermediate_row_desc().num_materialized_slots());
303
606
}
304
305
3.24k
Status PipelineXLocalStateBase::filter_block(const VExprContextSPtrs& expr_contexts, Block* block) {
306
3.24k
    RETURN_IF_ERROR(VExprContext::filter_block(expr_contexts, block, block->columns()));
307
308
3.24k
    _estimate_memory_usage += VExprContext::get_memory_usage(expr_contexts);
309
3.24k
    return Status::OK();
310
3.24k
}
311
312
0
bool PipelineXLocalStateBase::is_blockable() const {
313
0
    return std::any_of(_projections.begin(), _projections.end(),
314
0
                       [&](VExprContextSPtr expr) -> bool { return expr->is_blockable(); });
315
0
}
316
317
Status OperatorXBase::do_projections(RuntimeState* state, Block* origin_block,
318
608
                                     Block* output_block) const {
319
608
    auto* local_state = state->get_local_state(operator_id());
320
608
    SCOPED_TIMER(local_state->exec_time_counter());
321
608
    SCOPED_TIMER(local_state->_projection_timer);
322
608
    const size_t rows = origin_block->rows();
323
608
    if (rows == 0) {
324
155
        return Status::OK();
325
155
    }
326
453
    SCOPED_PEAK_MEM(&local_state->_estimate_memory_usage);
327
328
453
    {
329
453
        Block input_block = *origin_block;
330
331
453
        ColumnsWithTypeAndName new_columns;
332
453
        for (const auto& projections : local_state->_intermediate_projections) {
333
0
            if (projections.empty()) {
334
0
                return Status::InternalError("meet empty intermediate projection, node id: {}",
335
0
                                             node_id());
336
0
            }
337
0
            new_columns.resize(projections.size());
338
0
            for (int i = 0; i < projections.size(); i++) {
339
0
                RETURN_IF_ERROR(projections[i]->execute(&input_block, new_columns[i]));
340
0
                if (new_columns[i].column->size() != rows) {
341
0
                    return Status::InternalError(
342
0
                            "intermediate projection result column size {} not equal input rows "
343
0
                            "{}, expr: {}",
344
0
                            new_columns[i].column->size(), rows,
345
0
                            projections[i]->root()->debug_string());
346
0
                }
347
0
            }
348
0
            Block tmp_block {new_columns};
349
0
            input_block.swap(tmp_block);
350
0
        }
351
352
453
        if (input_block.rows() != rows) {
353
0
            return Status::InternalError(
354
0
                    "after intermediate projections input block rows {} not equal origin rows {}, "
355
0
                    "input_block: {}",
356
0
                    input_block.rows(), rows, input_block.dump_structure());
357
0
        }
358
359
453
        auto scoped_mutable_block = VectorizedUtils::build_scoped_mutable_mem_reuse_block(
360
453
                output_block, *_output_row_descriptor);
361
453
        auto& mutable_columns = scoped_mutable_block.mutable_columns();
362
453
        DCHECK_EQ(mutable_columns.size(), local_state->_projections.size()) << debug_string();
363
453
        Columns shared_columns(mutable_columns.size());
364
365
3.06k
        for (int i = 0; i < mutable_columns.size(); ++i) {
366
2.61k
            ColumnPtr column_ptr;
367
2.61k
            RETURN_IF_ERROR(local_state->_projections[i]->execute(&input_block, column_ptr));
368
2.61k
            if (column_ptr->size() != rows) {
369
0
                return Status::InternalError(
370
0
                        "projection result column size {} not equal input rows {}, expr: {}",
371
0
                        column_ptr->size(), rows,
372
0
                        local_state->_projections[i]->root()->debug_string());
373
0
            }
374
2.61k
            column_ptr = column_ptr->convert_to_full_column_if_const();
375
2.61k
            if (is_column_nullable(*mutable_columns[i]) && !is_column_nullable(*column_ptr)) {
376
0
                column_ptr = make_nullable(column_ptr, false);
377
0
            }
378
2.61k
            if (column_ptr->is_exclusive()) {
379
1.16k
                mutable_columns[i] = IColumn::mutate(std::move(column_ptr));
380
1.44k
            } else {
381
1.44k
                shared_columns[i] = std::move(column_ptr);
382
1.44k
            }
383
2.61k
        }
384
385
453
        scoped_mutable_block.restore();
386
3.06k
        for (int i = 0; i < shared_columns.size(); ++i) {
387
2.61k
            if (shared_columns[i]) {
388
1.44k
                output_block->replace_by_position(i, std::move(shared_columns[i]));
389
1.44k
            }
390
2.61k
        }
391
453
    }
392
393
0
    origin_block->clear_column_data(
394
453
            local_state->_parent->intermediate_row_desc().num_materialized_slots());
395
453
    DCHECK_EQ(output_block->rows(), rows);
396
397
453
    return Status::OK();
398
453
}
399
400
1.27M
Status OperatorXBase::get_block_after_projects(RuntimeState* state, Block* block, bool* eos) {
401
1.27M
    DBUG_EXECUTE_IF("Pipeline::return_empty_block", {
402
1.27M
        if (this->_op_name == "AGGREGATION_OPERATOR" || this->_op_name == "HASH_JOIN_OPERATOR" ||
403
1.27M
            this->_op_name == "PARTITIONED_AGGREGATION_OPERATOR" ||
404
1.27M
            this->_op_name == "PARTITIONED_HASH_JOIN_OPERATOR" ||
405
1.27M
            this->_op_name == "CROSS_JOIN_OPERATOR" || this->_op_name == "SORT_OPERATOR") {
406
1.27M
            if (_debug_point_count++ % 2 == 0) {
407
1.27M
                return Status::OK();
408
1.27M
            }
409
1.27M
        }
410
1.27M
    });
411
412
1.27M
    Status status;
413
1.27M
    auto* local_state = state->get_local_state(operator_id());
414
1.27M
    Defer defer([&]() {
415
1.27M
        if (status.ok()) {
416
1.27M
            local_state->update_output_block_counters(*block);
417
1.27M
        }
418
1.27M
    });
419
1.27M
    if (_output_row_descriptor) {
420
606
        local_state->clear_origin_block();
421
606
        status = get_block(state, &local_state->_origin_block, eos);
422
606
        if (UNLIKELY(!status.ok())) {
423
0
            return status;
424
0
        }
425
606
        status = do_projections(state, &local_state->_origin_block, block);
426
606
        return status;
427
606
    }
428
1.27M
    status = get_block(state, block, eos);
429
1.27M
    RETURN_IF_ERROR(block->check_type_and_column());
430
1.27M
    return status;
431
1.27M
}
432
433
15.4k
void PipelineXLocalStateBase::reached_limit(Block* block, bool* eos) {
434
15.4k
    if (_parent->_limit != -1 and _num_rows_returned + block->rows() >= _parent->_limit) {
435
20
        block->set_num_rows(_parent->_limit - _num_rows_returned);
436
20
        *eos = true;
437
20
    }
438
439
15.4k
    DBUG_EXECUTE_IF("Pipeline::reached_limit_early", {
440
15.4k
        auto op_name = to_lower(_parent->_op_name);
441
15.4k
        auto arg_op_name = dp->param<std::string>("op_name");
442
15.4k
        arg_op_name = to_lower(arg_op_name);
443
444
15.4k
        if (op_name == arg_op_name) {
445
15.4k
            *eos = true;
446
15.4k
        }
447
15.4k
    });
448
449
15.4k
    if (auto rows = block->rows()) {
450
4.40k
        _num_rows_returned += rows;
451
4.40k
        _state->get_query_ctx()->resource_ctx()->io_context()->update_process_rows(rows);
452
4.40k
    }
453
15.4k
}
454
455
24.0k
Status DataSinkOperatorXBase::terminate(RuntimeState* state) {
456
24.0k
    auto result = state->get_sink_local_state_result();
457
24.0k
    if (!result) {
458
0
        return result.error();
459
0
    }
460
24.0k
    return result.value()->terminate(state);
461
24.0k
}
462
463
16.3k
std::string DataSinkOperatorXBase::debug_string(int indentation_level) const {
464
16.3k
    fmt::memory_buffer debug_string_buffer;
465
466
16.3k
    fmt::format_to(debug_string_buffer, "{}{}: id={}, _is_serial_operator={}",
467
16.3k
                   std::string(indentation_level * 2, ' '), _name, node_id(), _is_serial_operator);
468
16.3k
    return fmt::to_string(debug_string_buffer);
469
16.3k
}
470
471
16.3k
std::string DataSinkOperatorXBase::debug_string(RuntimeState* state, int indentation_level) const {
472
16.3k
    return state->get_sink_local_state()->debug_string(indentation_level);
473
16.3k
}
474
475
1.12k
Status DataSinkOperatorXBase::init(const TDataSink& tsink) {
476
1.12k
    std::string op_name = "UNKNOWN_SINK";
477
1.12k
    auto it = _TDataSinkType_VALUES_TO_NAMES.find(tsink.type);
478
479
1.12k
    if (it != _TDataSinkType_VALUES_TO_NAMES.end()) {
480
1.12k
        op_name = it->second;
481
1.12k
    }
482
1.12k
    _name = op_name + "_OPERATOR";
483
1.12k
    return Status::OK();
484
1.12k
}
485
486
72.8k
Status DataSinkOperatorXBase::init(const TPlanNode& tnode, RuntimeState* state) {
487
72.8k
    std::string op_name = print_plan_node_type(tnode.node_type);
488
72.8k
    _nereids_id = tnode.nereids_id;
489
72.8k
    auto substr = op_name.substr(0, op_name.find("_NODE"));
490
72.8k
    _name = substr + "_SINK_OPERATOR";
491
72.8k
    return Status::OK();
492
72.8k
}
493
494
template <typename LocalStateType>
495
Status DataSinkOperatorX<LocalStateType>::setup_local_state(RuntimeState* state,
496
74.1k
                                                            LocalSinkStateInfo& info) {
497
74.1k
    auto local_state = LocalStateType::create_unique(this, state);
498
74.1k
    RETURN_IF_ERROR(local_state->init(state, info));
499
74.1k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
74.1k
    return Status::OK();
501
74.1k
}
_ZN5doris17DataSinkOperatorXINS_27HashJoinBuildSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
72.0k
                                                            LocalSinkStateInfo& info) {
497
72.0k
    auto local_state = LocalStateType::create_unique(this, state);
498
72.0k
    RETURN_IF_ERROR(local_state->init(state, info));
499
72.0k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
72.0k
    return Status::OK();
501
72.0k
}
_ZN5doris17DataSinkOperatorXINS_20ResultSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
418
                                                            LocalSinkStateInfo& info) {
497
418
    auto local_state = LocalStateType::create_unique(this, state);
498
418
    RETURN_IF_ERROR(local_state->init(state, info));
499
418
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
418
    return Status::OK();
501
418
}
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_23JdbcTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_27MemoryScratchSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_24ResultFileSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
_ZN5doris17DataSinkOperatorXINS_23OlapTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
11
                                                            LocalSinkStateInfo& info) {
497
11
    auto local_state = LocalStateType::create_unique(this, state);
498
11
    RETURN_IF_ERROR(local_state->init(state, info));
499
11
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
11
    return Status::OK();
501
11
}
_ZN5doris17DataSinkOperatorXINS_25OlapTableSinkV2LocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
12
                                                            LocalSinkStateInfo& info) {
497
12
    auto local_state = LocalStateType::create_unique(this, state);
498
12
    RETURN_IF_ERROR(local_state->init(state, info));
499
12
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
12
    return Status::OK();
501
12
}
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
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_22AnalyticSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_23BlackholeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
_ZN5doris17DataSinkOperatorXINS_18SortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
96
                                                            LocalSinkStateInfo& info) {
497
96
    auto local_state = LocalStateType::create_unique(this, state);
498
96
    RETURN_IF_ERROR(local_state->init(state, info));
499
96
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
96
    return Status::OK();
501
96
}
_ZN5doris17DataSinkOperatorXINS_23SpillSortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
21
                                                            LocalSinkStateInfo& info) {
497
21
    auto local_state = LocalStateType::create_unique(this, state);
498
21
    RETURN_IF_ERROR(local_state->init(state, info));
499
21
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
21
    return Status::OK();
501
21
}
_ZN5doris17DataSinkOperatorXINS_27LocalExchangeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
14
                                                            LocalSinkStateInfo& info) {
497
14
    auto local_state = LocalStateType::create_unique(this, state);
498
14
    RETURN_IF_ERROR(local_state->init(state, info));
499
14
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
14
    return Status::OK();
501
14
}
_ZN5doris17DataSinkOperatorXINS_17AggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
384
                                                            LocalSinkStateInfo& info) {
497
384
    auto local_state = LocalStateType::create_unique(this, state);
498
384
    RETURN_IF_ERROR(local_state->init(state, info));
499
384
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
384
    return Status::OK();
501
384
}
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_25BucketedAggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
_ZN5doris17DataSinkOperatorXINS_28PartitionedAggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
75
                                                            LocalSinkStateInfo& info) {
497
75
    auto local_state = LocalStateType::create_unique(this, state);
498
75
    RETURN_IF_ERROR(local_state->init(state, info));
499
75
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
75
    return Status::OK();
501
75
}
_ZN5doris17DataSinkOperatorXINS_22ExchangeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
814
                                                            LocalSinkStateInfo& info) {
497
814
    auto local_state = LocalStateType::create_unique(this, state);
498
814
    RETURN_IF_ERROR(local_state->init(state, info));
499
814
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
814
    return Status::OK();
501
814
}
_ZN5doris17DataSinkOperatorXINS_33NestedLoopJoinBuildSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
131
                                                            LocalSinkStateInfo& info) {
497
131
    auto local_state = LocalStateType::create_unique(this, state);
498
131
    RETURN_IF_ERROR(local_state->init(state, info));
499
131
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
131
    return Status::OK();
501
131
}
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_19UnionSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
_ZN5doris17DataSinkOperatorXINS_33MultiCastDataStreamSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
65
                                                            LocalSinkStateInfo& info) {
497
65
    auto local_state = LocalStateType::create_unique(this, state);
498
65
    RETURN_IF_ERROR(local_state->init(state, info));
499
65
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
65
    return Status::OK();
501
65
}
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_27PartitionSortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
_ZN5doris17DataSinkOperatorXINS_33PartitionedHashJoinSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
1
                                                            LocalSinkStateInfo& info) {
497
1
    auto local_state = LocalStateType::create_unique(this, state);
498
1
    RETURN_IF_ERROR(local_state->init(state, info));
499
1
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
1
    return Status::OK();
501
1
}
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_30GroupCommitBlockSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_19CacheSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
_ZN5doris17DataSinkOperatorXINS_18DictSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
53
                                                            LocalSinkStateInfo& info) {
497
53
    auto local_state = LocalStateType::create_unique(this, state);
498
53
    RETURN_IF_ERROR(local_state->init(state, info));
499
53
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
53
    return Status::OK();
501
53
}
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_20RecCTESinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_26RecCTEAnchorSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
502
503
template <typename LocalStateType>
504
74.2k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
505
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
0
                                 LocalExchangeSharedState>) {
507
0
        return nullptr;
508
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
0
                                        MultiCastSharedState>) {
510
0
        throw Exception(Status::FatalError("should not reach here!"));
511
74.2k
    } else {
512
74.2k
        auto ss = LocalStateType::SharedStateType::create_shared();
513
74.2k
        ss->id = operator_id();
514
74.2k
        for (auto& dest : dests_id()) {
515
74.2k
            ss->related_op_ids.insert(dest);
516
74.2k
        }
517
74.2k
        return ss;
518
74.2k
    }
519
74.2k
}
_ZNK5doris17DataSinkOperatorXINS_27HashJoinBuildSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
504
72.0k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
505
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
                                 LocalExchangeSharedState>) {
507
        return nullptr;
508
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                        MultiCastSharedState>) {
510
        throw Exception(Status::FatalError("should not reach here!"));
511
72.0k
    } else {
512
72.0k
        auto ss = LocalStateType::SharedStateType::create_shared();
513
72.0k
        ss->id = operator_id();
514
72.0k
        for (auto& dest : dests_id()) {
515
72.0k
            ss->related_op_ids.insert(dest);
516
72.0k
        }
517
72.0k
        return ss;
518
72.0k
    }
519
72.0k
}
_ZNK5doris17DataSinkOperatorXINS_20ResultSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
504
416
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
505
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
                                 LocalExchangeSharedState>) {
507
        return nullptr;
508
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                        MultiCastSharedState>) {
510
        throw Exception(Status::FatalError("should not reach here!"));
511
416
    } else {
512
416
        auto ss = LocalStateType::SharedStateType::create_shared();
513
416
        ss->id = operator_id();
514
416
        for (auto& dest : dests_id()) {
515
416
            ss->related_op_ids.insert(dest);
516
416
        }
517
416
        return ss;
518
416
    }
519
416
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_23JdbcTableSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_27MemoryScratchSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_24ResultFileSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_23OlapTableSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
504
11
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
505
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
                                 LocalExchangeSharedState>) {
507
        return nullptr;
508
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                        MultiCastSharedState>) {
510
        throw Exception(Status::FatalError("should not reach here!"));
511
11
    } else {
512
11
        auto ss = LocalStateType::SharedStateType::create_shared();
513
11
        ss->id = operator_id();
514
11
        for (auto& dest : dests_id()) {
515
11
            ss->related_op_ids.insert(dest);
516
11
        }
517
11
        return ss;
518
11
    }
519
11
}
_ZNK5doris17DataSinkOperatorXINS_25OlapTableSinkV2LocalStateEE19create_shared_stateEv
Line
Count
Source
504
12
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
505
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
                                 LocalExchangeSharedState>) {
507
        return nullptr;
508
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                        MultiCastSharedState>) {
510
        throw Exception(Status::FatalError("should not reach here!"));
511
12
    } else {
512
12
        auto ss = LocalStateType::SharedStateType::create_shared();
513
12
        ss->id = operator_id();
514
12
        for (auto& dest : dests_id()) {
515
12
            ss->related_op_ids.insert(dest);
516
12
        }
517
12
        return ss;
518
12
    }
519
12
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_23HiveTableSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22TVFTableSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_26IcebergTableSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_31SpillIcebergTableSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_27IcebergDeleteSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_26IcebergMergeSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_21MCTableSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_22AnalyticSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
504
11
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
505
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
                                 LocalExchangeSharedState>) {
507
        return nullptr;
508
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                        MultiCastSharedState>) {
510
        throw Exception(Status::FatalError("should not reach here!"));
511
11
    } else {
512
11
        auto ss = LocalStateType::SharedStateType::create_shared();
513
11
        ss->id = operator_id();
514
11
        for (auto& dest : dests_id()) {
515
11
            ss->related_op_ids.insert(dest);
516
11
        }
517
11
        return ss;
518
11
    }
519
11
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_23BlackholeSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_18SortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
504
105
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
505
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
                                 LocalExchangeSharedState>) {
507
        return nullptr;
508
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                        MultiCastSharedState>) {
510
        throw Exception(Status::FatalError("should not reach here!"));
511
105
    } else {
512
105
        auto ss = LocalStateType::SharedStateType::create_shared();
513
105
        ss->id = operator_id();
514
105
        for (auto& dest : dests_id()) {
515
105
            ss->related_op_ids.insert(dest);
516
105
        }
517
105
        return ss;
518
105
    }
519
105
}
_ZNK5doris17DataSinkOperatorXINS_23SpillSortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
504
23
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
505
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
                                 LocalExchangeSharedState>) {
507
        return nullptr;
508
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                        MultiCastSharedState>) {
510
        throw Exception(Status::FatalError("should not reach here!"));
511
23
    } else {
512
23
        auto ss = LocalStateType::SharedStateType::create_shared();
513
23
        ss->id = operator_id();
514
23
        for (auto& dest : dests_id()) {
515
23
            ss->related_op_ids.insert(dest);
516
23
        }
517
23
        return ss;
518
23
    }
519
23
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_27LocalExchangeSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_17AggSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
504
413
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
505
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
                                 LocalExchangeSharedState>) {
507
        return nullptr;
508
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                        MultiCastSharedState>) {
510
        throw Exception(Status::FatalError("should not reach here!"));
511
413
    } else {
512
413
        auto ss = LocalStateType::SharedStateType::create_shared();
513
413
        ss->id = operator_id();
514
413
        for (auto& dest : dests_id()) {
515
413
            ss->related_op_ids.insert(dest);
516
413
        }
517
413
        return ss;
518
413
    }
519
413
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_25BucketedAggSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_28PartitionedAggSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
504
74
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
505
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
                                 LocalExchangeSharedState>) {
507
        return nullptr;
508
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                        MultiCastSharedState>) {
510
        throw Exception(Status::FatalError("should not reach here!"));
511
74
    } else {
512
74
        auto ss = LocalStateType::SharedStateType::create_shared();
513
74
        ss->id = operator_id();
514
74
        for (auto& dest : dests_id()) {
515
74
            ss->related_op_ids.insert(dest);
516
74
        }
517
74
        return ss;
518
74
    }
519
74
}
_ZNK5doris17DataSinkOperatorXINS_22ExchangeSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
504
816
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
505
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
                                 LocalExchangeSharedState>) {
507
        return nullptr;
508
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                        MultiCastSharedState>) {
510
        throw Exception(Status::FatalError("should not reach here!"));
511
816
    } else {
512
816
        auto ss = LocalStateType::SharedStateType::create_shared();
513
816
        ss->id = operator_id();
514
816
        for (auto& dest : dests_id()) {
515
815
            ss->related_op_ids.insert(dest);
516
815
        }
517
816
        return ss;
518
816
    }
519
816
}
_ZNK5doris17DataSinkOperatorXINS_33NestedLoopJoinBuildSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
504
131
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
505
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
                                 LocalExchangeSharedState>) {
507
        return nullptr;
508
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                        MultiCastSharedState>) {
510
        throw Exception(Status::FatalError("should not reach here!"));
511
131
    } else {
512
131
        auto ss = LocalStateType::SharedStateType::create_shared();
513
131
        ss->id = operator_id();
514
131
        for (auto& dest : dests_id()) {
515
131
            ss->related_op_ids.insert(dest);
516
131
        }
517
131
        return ss;
518
131
    }
519
131
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_19UnionSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_33MultiCastDataStreamSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_27PartitionSortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
504
102
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
505
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
                                 LocalExchangeSharedState>) {
507
        return nullptr;
508
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                        MultiCastSharedState>) {
510
        throw Exception(Status::FatalError("should not reach here!"));
511
102
    } else {
512
102
        auto ss = LocalStateType::SharedStateType::create_shared();
513
102
        ss->id = operator_id();
514
102
        for (auto& dest : dests_id()) {
515
102
            ss->related_op_ids.insert(dest);
516
102
        }
517
102
        return ss;
518
102
    }
519
102
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb1EEEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb0EEEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb1EEEE19create_shared_stateEv
Line
Count
Source
504
7
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
505
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
                                 LocalExchangeSharedState>) {
507
        return nullptr;
508
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                        MultiCastSharedState>) {
510
        throw Exception(Status::FatalError("should not reach here!"));
511
7
    } else {
512
7
        auto ss = LocalStateType::SharedStateType::create_shared();
513
7
        ss->id = operator_id();
514
7
        for (auto& dest : dests_id()) {
515
7
            ss->related_op_ids.insert(dest);
516
7
        }
517
7
        return ss;
518
7
    }
519
7
}
_ZNK5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb0EEEE19create_shared_stateEv
Line
Count
Source
504
6
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
505
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
                                 LocalExchangeSharedState>) {
507
        return nullptr;
508
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                        MultiCastSharedState>) {
510
        throw Exception(Status::FatalError("should not reach here!"));
511
6
    } else {
512
6
        auto ss = LocalStateType::SharedStateType::create_shared();
513
6
        ss->id = operator_id();
514
6
        for (auto& dest : dests_id()) {
515
6
            ss->related_op_ids.insert(dest);
516
6
        }
517
6
        return ss;
518
6
    }
519
6
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_33PartitionedHashJoinSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_30GroupCommitBlockSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_19CacheSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_18DictSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
504
53
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
505
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
                                 LocalExchangeSharedState>) {
507
        return nullptr;
508
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                        MultiCastSharedState>) {
510
        throw Exception(Status::FatalError("should not reach here!"));
511
53
    } else {
512
53
        auto ss = LocalStateType::SharedStateType::create_shared();
513
53
        ss->id = operator_id();
514
53
        for (auto& dest : dests_id()) {
515
53
            ss->related_op_ids.insert(dest);
516
53
        }
517
53
        return ss;
518
53
    }
519
53
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_20RecCTESinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_26RecCTEAnchorSinkLocalStateEE19create_shared_stateEv
520
521
template <typename LocalStateType>
522
26.3k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
26.3k
    auto local_state = LocalStateType::create_unique(state, this);
524
26.3k
    RETURN_IF_ERROR(local_state->init(state, info));
525
26.3k
    state->emplace_local_state(operator_id(), std::move(local_state));
526
26.3k
    return Status::OK();
527
26.3k
}
_ZN5doris9OperatorXINS_23HashJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
24.0k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
24.0k
    auto local_state = LocalStateType::create_unique(state, this);
524
24.0k
    RETURN_IF_ERROR(local_state->init(state, info));
525
24.0k
    state->emplace_local_state(operator_id(), std::move(local_state));
526
24.0k
    return Status::OK();
527
24.0k
}
_ZN5doris9OperatorXINS_18OlapScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
582
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
582
    auto local_state = LocalStateType::create_unique(state, this);
524
582
    RETURN_IF_ERROR(local_state->init(state, info));
525
582
    state->emplace_local_state(operator_id(), std::move(local_state));
526
582
    return Status::OK();
527
582
}
Unexecuted instantiation: _ZN5doris9OperatorXINS_21GroupCommitLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Unexecuted instantiation: _ZN5doris9OperatorXINS_18JDBCScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris9OperatorXINS_18FileScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
4
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
4
    auto local_state = LocalStateType::create_unique(state, this);
524
4
    RETURN_IF_ERROR(local_state->init(state, info));
525
4
    state->emplace_local_state(operator_id(), std::move(local_state));
526
4
    return Status::OK();
527
4
}
Unexecuted instantiation: _ZN5doris9OperatorXINS_18AnalyticLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris9OperatorXINS_14SortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
14
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
14
    auto local_state = LocalStateType::create_unique(state, this);
524
14
    RETURN_IF_ERROR(local_state->init(state, info));
525
14
    state->emplace_local_state(operator_id(), std::move(local_state));
526
14
    return Status::OK();
527
14
}
_ZN5doris9OperatorXINS_19SpillSortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
14
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
14
    auto local_state = LocalStateType::create_unique(state, this);
524
14
    RETURN_IF_ERROR(local_state->init(state, info));
525
14
    state->emplace_local_state(operator_id(), std::move(local_state));
526
14
    return Status::OK();
527
14
}
_ZN5doris9OperatorXINS_24LocalMergeSortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
75
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
75
    auto local_state = LocalStateType::create_unique(state, this);
524
75
    RETURN_IF_ERROR(local_state->init(state, info));
525
75
    state->emplace_local_state(operator_id(), std::move(local_state));
526
75
    return Status::OK();
527
75
}
_ZN5doris9OperatorXINS_13AggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
374
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
374
    auto local_state = LocalStateType::create_unique(state, this);
524
374
    RETURN_IF_ERROR(local_state->init(state, info));
525
374
    state->emplace_local_state(operator_id(), std::move(local_state));
526
374
    return Status::OK();
527
374
}
Unexecuted instantiation: _ZN5doris9OperatorXINS_21BucketedAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris9OperatorXINS_24PartitionedAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
65
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
65
    auto local_state = LocalStateType::create_unique(state, this);
524
65
    RETURN_IF_ERROR(local_state->init(state, info));
525
65
    state->emplace_local_state(operator_id(), std::move(local_state));
526
65
    return Status::OK();
527
65
}
_ZN5doris9OperatorXINS_23TableFunctionLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
5
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
5
    auto local_state = LocalStateType::create_unique(state, this);
524
5
    RETURN_IF_ERROR(local_state->init(state, info));
525
5
    state->emplace_local_state(operator_id(), std::move(local_state));
526
5
    return Status::OK();
527
5
}
_ZN5doris9OperatorXINS_18ExchangeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
572
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
572
    auto local_state = LocalStateType::create_unique(state, this);
524
572
    RETURN_IF_ERROR(local_state->init(state, info));
525
572
    state->emplace_local_state(operator_id(), std::move(local_state));
526
572
    return Status::OK();
527
572
}
Unexecuted instantiation: _ZN5doris9OperatorXINS_16RepeatLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris9OperatorXINS_29NestedLoopJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
130
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
130
    auto local_state = LocalStateType::create_unique(state, this);
524
130
    RETURN_IF_ERROR(local_state->init(state, info));
525
130
    state->emplace_local_state(operator_id(), std::move(local_state));
526
130
    return Status::OK();
527
130
}
_ZN5doris9OperatorXINS_23AssertNumRowsLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
3
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
3
    auto local_state = LocalStateType::create_unique(state, this);
524
3
    RETURN_IF_ERROR(local_state->init(state, info));
525
3
    state->emplace_local_state(operator_id(), std::move(local_state));
526
3
    return Status::OK();
527
3
}
_ZN5doris9OperatorXINS_18EmptySetLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
3
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
3
    auto local_state = LocalStateType::create_unique(state, this);
524
3
    RETURN_IF_ERROR(local_state->init(state, info));
525
3
    state->emplace_local_state(operator_id(), std::move(local_state));
526
3
    return Status::OK();
527
3
}
_ZN5doris9OperatorXINS_21UnionSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
12
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
12
    auto local_state = LocalStateType::create_unique(state, this);
524
12
    RETURN_IF_ERROR(local_state->init(state, info));
525
12
    state->emplace_local_state(operator_id(), std::move(local_state));
526
12
    return Status::OK();
527
12
}
_ZN5doris9OperatorXINS_35MultiCastDataStreamSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
195
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
195
    auto local_state = LocalStateType::create_unique(state, this);
524
195
    RETURN_IF_ERROR(local_state->init(state, info));
525
195
    state->emplace_local_state(operator_id(), std::move(local_state));
526
195
    return Status::OK();
527
195
}
Unexecuted instantiation: _ZN5doris9OperatorXINS_29PartitionSortSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Unexecuted instantiation: _ZN5doris9OperatorXINS_19SetSourceLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Unexecuted instantiation: _ZN5doris9OperatorXINS_19SetSourceLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris9OperatorXINS_17DataGenLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
4
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
4
    auto local_state = LocalStateType::create_unique(state, this);
524
4
    RETURN_IF_ERROR(local_state->init(state, info));
525
4
    state->emplace_local_state(operator_id(), std::move(local_state));
526
4
    return Status::OK();
527
4
}
Unexecuted instantiation: _ZN5doris9OperatorXINS_20SchemaScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Unexecuted instantiation: _ZN5doris9OperatorXINS_18MetaScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris9OperatorXINS_29LocalExchangeSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
150
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
150
    auto local_state = LocalStateType::create_unique(state, this);
524
150
    RETURN_IF_ERROR(local_state->init(state, info));
525
150
    state->emplace_local_state(operator_id(), std::move(local_state));
526
150
    return Status::OK();
527
150
}
Unexecuted instantiation: _ZN5doris9OperatorXINS_34PartitionedHashJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Unexecuted instantiation: _ZN5doris9OperatorXINS_21CacheSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Unexecuted instantiation: _ZN5doris9OperatorXINS_22RecCTESourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Unexecuted instantiation: _ZN5doris9OperatorXINS_20RecCTEScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Unexecuted instantiation: _ZN5doris9OperatorXINS_25MaterializationLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris9OperatorXINS_16SelectLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
73
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
73
    auto local_state = LocalStateType::create_unique(state, this);
524
73
    RETURN_IF_ERROR(local_state->init(state, info));
525
73
    state->emplace_local_state(operator_id(), std::move(local_state));
526
73
    return Status::OK();
527
73
}
Unexecuted instantiation: _ZN5doris9OperatorXINS_22StreamingAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Unexecuted instantiation: _ZN5doris9OperatorXINS_30DistinctStreamingAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
528
529
PipelineXSinkLocalStateBase::PipelineXSinkLocalStateBase(DataSinkOperatorXBase* parent,
530
                                                         RuntimeState* state)
531
74.4k
        : _parent(parent), _state(state) {}
532
533
PipelineXLocalStateBase::PipelineXLocalStateBase(RuntimeState* state, OperatorXBase* parent)
534
26.7k
        : _num_rows_returned(0),
535
26.7k
          _rows_returned_counter(nullptr),
536
26.7k
          _parent(parent),
537
26.7k
          _state(state),
538
26.7k
          _budget(state->batch_size(), state->preferred_block_size_bytes()) {}
539
540
template <typename SharedStateArg>
541
26.5k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
542
26.5k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
543
26.5k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
544
26.5k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
545
26.5k
    _operator_profile->set_metadata(_parent->node_id());
546
    // indent is false so that source operator will have same
547
    // indentation_level with its parent operator.
548
26.5k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
549
26.5k
    _operator_profile->add_child(_common_profile.get(), true);
550
26.5k
    _operator_profile->add_child(_custom_profile.get(), true);
551
26.5k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
552
26.5k
    if constexpr (!is_fake_shared) {
553
25.2k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
554
152
            _shared_state = info.shared_state_map.at(_parent->operator_id())
555
152
                                    .first.get()
556
152
                                    ->template cast<SharedStateArg>();
557
558
152
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
559
152
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
560
152
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
561
25.0k
        } else if (info.shared_state) {
562
25.0k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
563
0
                DCHECK(false);
564
0
            }
565
            // For UnionSourceOperator without children, there is no shared state.
566
25.0k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
567
568
25.0k
            _dependency = _shared_state->create_source_dependency(
569
25.0k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
570
25.0k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
571
25.0k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
572
25.0k
        } else {
573
14
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
574
0
                DCHECK(false);
575
0
            }
576
14
        }
577
25.2k
    }
578
579
26.5k
    if (must_set_shared_state() && _shared_state == nullptr) {
580
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
581
0
    }
582
583
26.5k
    _rows_returned_counter =
584
26.5k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
585
26.5k
    _blocks_returned_counter =
586
26.5k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
587
26.5k
    _output_block_bytes_counter =
588
26.5k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
589
26.5k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
590
26.5k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
591
26.5k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
592
26.5k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
593
26.5k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
594
26.5k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
595
26.5k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
596
26.5k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
597
26.5k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
598
26.5k
    _memory_used_counter =
599
26.5k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
600
26.5k
    _common_profile->add_info_string("IsColocate",
601
26.5k
                                     std::to_string(_parent->is_colocated_operator()));
602
26.5k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
603
26.5k
    _common_profile->add_info_string("FollowedByShuffledOperator",
604
26.5k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
605
26.5k
    return Status::OK();
606
26.5k
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
541
24.0k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
542
24.0k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
543
24.0k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
544
24.0k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
545
24.0k
    _operator_profile->set_metadata(_parent->node_id());
546
    // indent is false so that source operator will have same
547
    // indentation_level with its parent operator.
548
24.0k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
549
24.0k
    _operator_profile->add_child(_common_profile.get(), true);
550
24.0k
    _operator_profile->add_child(_custom_profile.get(), true);
551
24.0k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
552
24.0k
    if constexpr (!is_fake_shared) {
553
24.0k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
554
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
555
0
                                    .first.get()
556
0
                                    ->template cast<SharedStateArg>();
557
558
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
559
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
560
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
561
24.0k
        } else if (info.shared_state) {
562
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
563
                DCHECK(false);
564
            }
565
            // For UnionSourceOperator without children, there is no shared state.
566
24.0k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
567
568
24.0k
            _dependency = _shared_state->create_source_dependency(
569
24.0k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
570
24.0k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
571
24.0k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
572
24.0k
        } else {
573
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
574
                DCHECK(false);
575
            }
576
0
        }
577
24.0k
    }
578
579
24.0k
    if (must_set_shared_state() && _shared_state == nullptr) {
580
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
581
0
    }
582
583
24.0k
    _rows_returned_counter =
584
24.0k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
585
24.0k
    _blocks_returned_counter =
586
24.0k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
587
24.0k
    _output_block_bytes_counter =
588
24.0k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
589
24.0k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
590
24.0k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
591
24.0k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
592
24.0k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
593
24.0k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
594
24.0k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
595
24.0k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
596
24.0k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
597
24.0k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
598
24.0k
    _memory_used_counter =
599
24.0k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
600
24.0k
    _common_profile->add_info_string("IsColocate",
601
24.0k
                                     std::to_string(_parent->is_colocated_operator()));
602
24.0k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
603
24.0k
    _common_profile->add_info_string("FollowedByShuffledOperator",
604
24.0k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
605
24.0k
    return Status::OK();
606
24.0k
}
_ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
541
1
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
542
1
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
543
1
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
544
1
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
545
1
    _operator_profile->set_metadata(_parent->node_id());
546
    // indent is false so that source operator will have same
547
    // indentation_level with its parent operator.
548
1
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
549
1
    _operator_profile->add_child(_common_profile.get(), true);
550
1
    _operator_profile->add_child(_custom_profile.get(), true);
551
1
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
552
1
    if constexpr (!is_fake_shared) {
553
1
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
554
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
555
0
                                    .first.get()
556
0
                                    ->template cast<SharedStateArg>();
557
558
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
559
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
560
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
561
1
        } else if (info.shared_state) {
562
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
563
                DCHECK(false);
564
            }
565
            // For UnionSourceOperator without children, there is no shared state.
566
1
            _shared_state = info.shared_state->template cast<SharedStateArg>();
567
568
1
            _dependency = _shared_state->create_source_dependency(
569
1
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
570
1
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
571
1
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
572
1
        } else {
573
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
574
                DCHECK(false);
575
            }
576
0
        }
577
1
    }
578
579
1
    if (must_set_shared_state() && _shared_state == nullptr) {
580
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
581
0
    }
582
583
1
    _rows_returned_counter =
584
1
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
585
1
    _blocks_returned_counter =
586
1
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
587
1
    _output_block_bytes_counter =
588
1
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
589
1
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
590
1
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
591
1
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
592
1
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
593
1
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
594
1
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
595
1
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
596
1
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
597
1
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
598
1
    _memory_used_counter =
599
1
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
600
1
    _common_profile->add_info_string("IsColocate",
601
1
                                     std::to_string(_parent->is_colocated_operator()));
602
1
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
603
1
    _common_profile->add_info_string("FollowedByShuffledOperator",
604
1
                                     std::to_string(_parent->followed_by_shuffled_operator()));
605
1
    return Status::OK();
606
1
}
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
541
101
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
542
101
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
543
101
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
544
101
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
545
101
    _operator_profile->set_metadata(_parent->node_id());
546
    // indent is false so that source operator will have same
547
    // indentation_level with its parent operator.
548
101
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
549
101
    _operator_profile->add_child(_common_profile.get(), true);
550
101
    _operator_profile->add_child(_custom_profile.get(), true);
551
101
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
552
101
    if constexpr (!is_fake_shared) {
553
101
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
554
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
555
0
                                    .first.get()
556
0
                                    ->template cast<SharedStateArg>();
557
558
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
559
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
560
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
561
101
        } else if (info.shared_state) {
562
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
563
                DCHECK(false);
564
            }
565
            // For UnionSourceOperator without children, there is no shared state.
566
101
            _shared_state = info.shared_state->template cast<SharedStateArg>();
567
568
101
            _dependency = _shared_state->create_source_dependency(
569
101
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
570
101
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
571
101
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
572
101
        } else {
573
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
574
                DCHECK(false);
575
            }
576
0
        }
577
101
    }
578
579
101
    if (must_set_shared_state() && _shared_state == nullptr) {
580
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
581
0
    }
582
583
101
    _rows_returned_counter =
584
101
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
585
101
    _blocks_returned_counter =
586
101
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
587
101
    _output_block_bytes_counter =
588
101
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
589
101
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
590
101
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
591
101
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
592
101
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
593
101
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
594
101
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
595
101
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
596
101
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
597
101
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
598
101
    _memory_used_counter =
599
101
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
600
101
    _common_profile->add_info_string("IsColocate",
601
101
                                     std::to_string(_parent->is_colocated_operator()));
602
101
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
603
101
    _common_profile->add_info_string("FollowedByShuffledOperator",
604
101
                                     std::to_string(_parent->followed_by_shuffled_operator()));
605
101
    return Status::OK();
606
101
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
541
14
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
542
14
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
543
14
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
544
14
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
545
14
    _operator_profile->set_metadata(_parent->node_id());
546
    // indent is false so that source operator will have same
547
    // indentation_level with its parent operator.
548
14
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
549
14
    _operator_profile->add_child(_common_profile.get(), true);
550
14
    _operator_profile->add_child(_custom_profile.get(), true);
551
14
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
552
14
    if constexpr (!is_fake_shared) {
553
14
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
554
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
555
0
                                    .first.get()
556
0
                                    ->template cast<SharedStateArg>();
557
558
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
559
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
560
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
561
14
        } else if (info.shared_state) {
562
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
563
                DCHECK(false);
564
            }
565
            // For UnionSourceOperator without children, there is no shared state.
566
14
            _shared_state = info.shared_state->template cast<SharedStateArg>();
567
568
14
            _dependency = _shared_state->create_source_dependency(
569
14
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
570
14
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
571
14
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
572
14
        } else {
573
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
574
                DCHECK(false);
575
            }
576
0
        }
577
14
    }
578
579
14
    if (must_set_shared_state() && _shared_state == nullptr) {
580
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
581
0
    }
582
583
14
    _rows_returned_counter =
584
14
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
585
14
    _blocks_returned_counter =
586
14
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
587
14
    _output_block_bytes_counter =
588
14
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
589
14
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
590
14
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
591
14
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
592
14
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
593
14
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
594
14
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
595
14
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
596
14
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
597
14
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
598
14
    _memory_used_counter =
599
14
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
600
14
    _common_profile->add_info_string("IsColocate",
601
14
                                     std::to_string(_parent->is_colocated_operator()));
602
14
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
603
14
    _common_profile->add_info_string("FollowedByShuffledOperator",
604
14
                                     std::to_string(_parent->followed_by_shuffled_operator()));
605
14
    return Status::OK();
606
14
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
541
130
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
542
130
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
543
130
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
544
130
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
545
130
    _operator_profile->set_metadata(_parent->node_id());
546
    // indent is false so that source operator will have same
547
    // indentation_level with its parent operator.
548
130
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
549
130
    _operator_profile->add_child(_common_profile.get(), true);
550
130
    _operator_profile->add_child(_custom_profile.get(), true);
551
130
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
552
130
    if constexpr (!is_fake_shared) {
553
130
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
554
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
555
0
                                    .first.get()
556
0
                                    ->template cast<SharedStateArg>();
557
558
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
559
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
560
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
561
130
        } else if (info.shared_state) {
562
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
563
                DCHECK(false);
564
            }
565
            // For UnionSourceOperator without children, there is no shared state.
566
130
            _shared_state = info.shared_state->template cast<SharedStateArg>();
567
568
130
            _dependency = _shared_state->create_source_dependency(
569
130
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
570
130
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
571
130
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
572
130
        } else {
573
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
574
                DCHECK(false);
575
            }
576
0
        }
577
130
    }
578
579
130
    if (must_set_shared_state() && _shared_state == nullptr) {
580
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
581
0
    }
582
583
130
    _rows_returned_counter =
584
130
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
585
130
    _blocks_returned_counter =
586
130
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
587
130
    _output_block_bytes_counter =
588
130
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
589
130
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
590
130
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
591
130
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
592
130
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
593
130
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
594
130
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
595
130
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
596
130
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
597
130
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
598
130
    _memory_used_counter =
599
130
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
600
130
    _common_profile->add_info_string("IsColocate",
601
130
                                     std::to_string(_parent->is_colocated_operator()));
602
130
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
603
130
    _common_profile->add_info_string("FollowedByShuffledOperator",
604
130
                                     std::to_string(_parent->followed_by_shuffled_operator()));
605
130
    return Status::OK();
606
130
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
541
11
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
542
11
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
543
11
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
544
11
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
545
11
    _operator_profile->set_metadata(_parent->node_id());
546
    // indent is false so that source operator will have same
547
    // indentation_level with its parent operator.
548
11
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
549
11
    _operator_profile->add_child(_common_profile.get(), true);
550
11
    _operator_profile->add_child(_custom_profile.get(), true);
551
11
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
552
11
    if constexpr (!is_fake_shared) {
553
11
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
554
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
555
0
                                    .first.get()
556
0
                                    ->template cast<SharedStateArg>();
557
558
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
559
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
560
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
561
11
        } else if (info.shared_state) {
562
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
563
                DCHECK(false);
564
            }
565
            // For UnionSourceOperator without children, there is no shared state.
566
11
            _shared_state = info.shared_state->template cast<SharedStateArg>();
567
568
11
            _dependency = _shared_state->create_source_dependency(
569
11
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
570
11
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
571
11
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
572
11
        } else {
573
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
574
                DCHECK(false);
575
            }
576
0
        }
577
11
    }
578
579
11
    if (must_set_shared_state() && _shared_state == nullptr) {
580
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
581
0
    }
582
583
11
    _rows_returned_counter =
584
11
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
585
11
    _blocks_returned_counter =
586
11
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
587
11
    _output_block_bytes_counter =
588
11
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
589
11
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
590
11
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
591
11
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
592
11
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
593
11
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
594
11
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
595
11
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
596
11
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
597
11
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
598
11
    _memory_used_counter =
599
11
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
600
11
    _common_profile->add_info_string("IsColocate",
601
11
                                     std::to_string(_parent->is_colocated_operator()));
602
11
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
603
11
    _common_profile->add_info_string("FollowedByShuffledOperator",
604
11
                                     std::to_string(_parent->followed_by_shuffled_operator()));
605
11
    return Status::OK();
606
11
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
541
403
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
542
403
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
543
403
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
544
403
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
545
403
    _operator_profile->set_metadata(_parent->node_id());
546
    // indent is false so that source operator will have same
547
    // indentation_level with its parent operator.
548
403
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
549
403
    _operator_profile->add_child(_common_profile.get(), true);
550
403
    _operator_profile->add_child(_custom_profile.get(), true);
551
403
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
552
403
    if constexpr (!is_fake_shared) {
553
403
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
554
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
555
0
                                    .first.get()
556
0
                                    ->template cast<SharedStateArg>();
557
558
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
559
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
560
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
561
403
        } else if (info.shared_state) {
562
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
563
                DCHECK(false);
564
            }
565
            // For UnionSourceOperator without children, there is no shared state.
566
402
            _shared_state = info.shared_state->template cast<SharedStateArg>();
567
568
402
            _dependency = _shared_state->create_source_dependency(
569
402
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
570
402
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
571
402
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
572
402
        } else {
573
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
574
                DCHECK(false);
575
            }
576
1
        }
577
403
    }
578
579
403
    if (must_set_shared_state() && _shared_state == nullptr) {
580
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
581
0
    }
582
583
403
    _rows_returned_counter =
584
403
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
585
403
    _blocks_returned_counter =
586
403
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
587
403
    _output_block_bytes_counter =
588
403
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
589
403
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
590
403
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
591
403
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
592
403
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
593
403
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
594
403
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
595
403
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
596
403
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
597
403
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
598
403
    _memory_used_counter =
599
403
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
600
403
    _common_profile->add_info_string("IsColocate",
601
403
                                     std::to_string(_parent->is_colocated_operator()));
602
403
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
603
403
    _common_profile->add_info_string("FollowedByShuffledOperator",
604
403
                                     std::to_string(_parent->followed_by_shuffled_operator()));
605
403
    return Status::OK();
606
403
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
541
65
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
542
65
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
543
65
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
544
65
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
545
65
    _operator_profile->set_metadata(_parent->node_id());
546
    // indent is false so that source operator will have same
547
    // indentation_level with its parent operator.
548
65
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
549
65
    _operator_profile->add_child(_common_profile.get(), true);
550
65
    _operator_profile->add_child(_custom_profile.get(), true);
551
65
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
552
65
    if constexpr (!is_fake_shared) {
553
65
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
554
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
555
0
                                    .first.get()
556
0
                                    ->template cast<SharedStateArg>();
557
558
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
559
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
560
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
561
65
        } else if (info.shared_state) {
562
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
563
                DCHECK(false);
564
            }
565
            // For UnionSourceOperator without children, there is no shared state.
566
65
            _shared_state = info.shared_state->template cast<SharedStateArg>();
567
568
65
            _dependency = _shared_state->create_source_dependency(
569
65
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
570
65
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
571
65
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
572
65
        } else {
573
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
574
                DCHECK(false);
575
            }
576
0
        }
577
65
    }
578
579
65
    if (must_set_shared_state() && _shared_state == nullptr) {
580
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
581
0
    }
582
583
65
    _rows_returned_counter =
584
65
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
585
65
    _blocks_returned_counter =
586
65
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
587
65
    _output_block_bytes_counter =
588
65
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
589
65
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
590
65
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
591
65
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
592
65
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
593
65
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
594
65
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
595
65
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
596
65
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
597
65
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
598
65
    _memory_used_counter =
599
65
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
600
65
    _common_profile->add_info_string("IsColocate",
601
65
                                     std::to_string(_parent->is_colocated_operator()));
602
65
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
603
65
    _common_profile->add_info_string("FollowedByShuffledOperator",
604
65
                                     std::to_string(_parent->followed_by_shuffled_operator()));
605
65
    return Status::OK();
606
65
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
541
1.30k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
542
1.30k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
543
1.30k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
544
1.30k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
545
1.30k
    _operator_profile->set_metadata(_parent->node_id());
546
    // indent is false so that source operator will have same
547
    // indentation_level with its parent operator.
548
1.30k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
549
1.30k
    _operator_profile->add_child(_common_profile.get(), true);
550
1.30k
    _operator_profile->add_child(_custom_profile.get(), true);
551
1.30k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
552
    if constexpr (!is_fake_shared) {
553
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
554
            _shared_state = info.shared_state_map.at(_parent->operator_id())
555
                                    .first.get()
556
                                    ->template cast<SharedStateArg>();
557
558
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
559
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
560
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
561
        } else if (info.shared_state) {
562
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
563
                DCHECK(false);
564
            }
565
            // For UnionSourceOperator without children, there is no shared state.
566
            _shared_state = info.shared_state->template cast<SharedStateArg>();
567
568
            _dependency = _shared_state->create_source_dependency(
569
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
570
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
571
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
572
        } else {
573
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
574
                DCHECK(false);
575
            }
576
        }
577
    }
578
579
1.30k
    if (must_set_shared_state() && _shared_state == nullptr) {
580
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
581
0
    }
582
583
1.30k
    _rows_returned_counter =
584
1.30k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
585
1.30k
    _blocks_returned_counter =
586
1.30k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
587
1.30k
    _output_block_bytes_counter =
588
1.30k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
589
1.30k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
590
1.30k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
591
1.30k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
592
1.30k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
593
1.30k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
594
1.30k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
595
1.30k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
596
1.30k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
597
1.30k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
598
1.30k
    _memory_used_counter =
599
1.30k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
600
1.30k
    _common_profile->add_info_string("IsColocate",
601
1.30k
                                     std::to_string(_parent->is_colocated_operator()));
602
1.30k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
603
1.30k
    _common_profile->add_info_string("FollowedByShuffledOperator",
604
1.30k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
605
1.30k
    return Status::OK();
606
1.30k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
541
14
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
542
14
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
543
14
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
544
14
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
545
14
    _operator_profile->set_metadata(_parent->node_id());
546
    // indent is false so that source operator will have same
547
    // indentation_level with its parent operator.
548
14
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
549
14
    _operator_profile->add_child(_common_profile.get(), true);
550
14
    _operator_profile->add_child(_custom_profile.get(), true);
551
14
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
552
14
    if constexpr (!is_fake_shared) {
553
14
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
554
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
555
0
                                    .first.get()
556
0
                                    ->template cast<SharedStateArg>();
557
558
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
559
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
560
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
561
14
        } else if (info.shared_state) {
562
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
563
                DCHECK(false);
564
            }
565
            // For UnionSourceOperator without children, there is no shared state.
566
1
            _shared_state = info.shared_state->template cast<SharedStateArg>();
567
568
1
            _dependency = _shared_state->create_source_dependency(
569
1
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
570
1
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
571
1
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
572
13
        } else {
573
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
574
                DCHECK(false);
575
            }
576
13
        }
577
14
    }
578
579
14
    if (must_set_shared_state() && _shared_state == nullptr) {
580
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
581
0
    }
582
583
14
    _rows_returned_counter =
584
14
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
585
14
    _blocks_returned_counter =
586
14
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
587
14
    _output_block_bytes_counter =
588
14
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
589
14
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
590
14
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
591
14
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
592
14
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
593
14
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
594
14
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
595
14
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
596
14
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
597
14
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
598
14
    _memory_used_counter =
599
14
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
600
14
    _common_profile->add_info_string("IsColocate",
601
14
                                     std::to_string(_parent->is_colocated_operator()));
602
14
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
603
14
    _common_profile->add_info_string("FollowedByShuffledOperator",
604
14
                                     std::to_string(_parent->followed_by_shuffled_operator()));
605
14
    return Status::OK();
606
14
}
_ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
541
12
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
542
12
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
543
12
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
544
12
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
545
12
    _operator_profile->set_metadata(_parent->node_id());
546
    // indent is false so that source operator will have same
547
    // indentation_level with its parent operator.
548
12
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
549
12
    _operator_profile->add_child(_common_profile.get(), true);
550
12
    _operator_profile->add_child(_custom_profile.get(), true);
551
12
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
552
12
    if constexpr (!is_fake_shared) {
553
12
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
554
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
555
0
                                    .first.get()
556
0
                                    ->template cast<SharedStateArg>();
557
558
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
559
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
560
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
561
12
        } else if (info.shared_state) {
562
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
563
                DCHECK(false);
564
            }
565
            // For UnionSourceOperator without children, there is no shared state.
566
12
            _shared_state = info.shared_state->template cast<SharedStateArg>();
567
568
12
            _dependency = _shared_state->create_source_dependency(
569
12
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
570
12
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
571
12
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
572
12
        } else {
573
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
574
                DCHECK(false);
575
            }
576
0
        }
577
12
    }
578
579
12
    if (must_set_shared_state() && _shared_state == nullptr) {
580
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
581
0
    }
582
583
12
    _rows_returned_counter =
584
12
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
585
12
    _blocks_returned_counter =
586
12
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
587
12
    _output_block_bytes_counter =
588
12
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
589
12
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
590
12
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
591
12
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
592
12
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
593
12
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
594
12
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
595
12
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
596
12
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
597
12
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
598
12
    _memory_used_counter =
599
12
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
600
12
    _common_profile->add_info_string("IsColocate",
601
12
                                     std::to_string(_parent->is_colocated_operator()));
602
12
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
603
12
    _common_profile->add_info_string("FollowedByShuffledOperator",
604
12
                                     std::to_string(_parent->followed_by_shuffled_operator()));
605
12
    return Status::OK();
606
12
}
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
541
195
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
542
195
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
543
195
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
544
195
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
545
195
    _operator_profile->set_metadata(_parent->node_id());
546
    // indent is false so that source operator will have same
547
    // indentation_level with its parent operator.
548
195
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
549
195
    _operator_profile->add_child(_common_profile.get(), true);
550
195
    _operator_profile->add_child(_custom_profile.get(), true);
551
195
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
552
195
    if constexpr (!is_fake_shared) {
553
195
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
554
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
555
0
                                    .first.get()
556
0
                                    ->template cast<SharedStateArg>();
557
558
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
559
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
560
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
561
195
        } else if (info.shared_state) {
562
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
563
                DCHECK(false);
564
            }
565
            // For UnionSourceOperator without children, there is no shared state.
566
195
            _shared_state = info.shared_state->template cast<SharedStateArg>();
567
568
195
            _dependency = _shared_state->create_source_dependency(
569
195
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
570
195
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
571
195
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
572
195
        } else {
573
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
574
                DCHECK(false);
575
            }
576
0
        }
577
195
    }
578
579
195
    if (must_set_shared_state() && _shared_state == nullptr) {
580
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
581
0
    }
582
583
195
    _rows_returned_counter =
584
195
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
585
195
    _blocks_returned_counter =
586
195
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
587
195
    _output_block_bytes_counter =
588
195
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
589
195
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
590
195
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
591
195
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
592
195
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
593
195
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
594
195
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
595
195
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
596
195
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
597
195
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
598
195
    _memory_used_counter =
599
195
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
600
195
    _common_profile->add_info_string("IsColocate",
601
195
                                     std::to_string(_parent->is_colocated_operator()));
602
195
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
603
195
    _common_profile->add_info_string("FollowedByShuffledOperator",
604
195
                                     std::to_string(_parent->followed_by_shuffled_operator()));
605
195
    return Status::OK();
606
195
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
541
102
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
542
102
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
543
102
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
544
102
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
545
102
    _operator_profile->set_metadata(_parent->node_id());
546
    // indent is false so that source operator will have same
547
    // indentation_level with its parent operator.
548
102
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
549
102
    _operator_profile->add_child(_common_profile.get(), true);
550
102
    _operator_profile->add_child(_custom_profile.get(), true);
551
102
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
552
102
    if constexpr (!is_fake_shared) {
553
102
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
554
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
555
0
                                    .first.get()
556
0
                                    ->template cast<SharedStateArg>();
557
558
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
559
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
560
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
561
102
        } else if (info.shared_state) {
562
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
563
                DCHECK(false);
564
            }
565
            // For UnionSourceOperator without children, there is no shared state.
566
102
            _shared_state = info.shared_state->template cast<SharedStateArg>();
567
568
102
            _dependency = _shared_state->create_source_dependency(
569
102
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
570
102
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
571
102
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
572
102
        } else {
573
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
574
                DCHECK(false);
575
            }
576
0
        }
577
102
    }
578
579
102
    if (must_set_shared_state() && _shared_state == nullptr) {
580
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
581
0
    }
582
583
102
    _rows_returned_counter =
584
102
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
585
102
    _blocks_returned_counter =
586
102
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
587
102
    _output_block_bytes_counter =
588
102
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
589
102
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
590
102
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
591
102
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
592
102
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
593
102
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
594
102
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
595
102
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
596
102
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
597
102
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
598
102
    _memory_used_counter =
599
102
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
600
102
    _common_profile->add_info_string("IsColocate",
601
102
                                     std::to_string(_parent->is_colocated_operator()));
602
102
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
603
102
    _common_profile->add_info_string("FollowedByShuffledOperator",
604
102
                                     std::to_string(_parent->followed_by_shuffled_operator()));
605
102
    return Status::OK();
606
102
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
541
13
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
542
13
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
543
13
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
544
13
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
545
13
    _operator_profile->set_metadata(_parent->node_id());
546
    // indent is false so that source operator will have same
547
    // indentation_level with its parent operator.
548
13
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
549
13
    _operator_profile->add_child(_common_profile.get(), true);
550
13
    _operator_profile->add_child(_custom_profile.get(), true);
551
13
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
552
13
    if constexpr (!is_fake_shared) {
553
13
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
554
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
555
0
                                    .first.get()
556
0
                                    ->template cast<SharedStateArg>();
557
558
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
559
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
560
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
561
13
        } else if (info.shared_state) {
562
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
563
                DCHECK(false);
564
            }
565
            // For UnionSourceOperator without children, there is no shared state.
566
13
            _shared_state = info.shared_state->template cast<SharedStateArg>();
567
568
13
            _dependency = _shared_state->create_source_dependency(
569
13
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
570
13
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
571
13
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
572
13
        } else {
573
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
574
                DCHECK(false);
575
            }
576
0
        }
577
13
    }
578
579
13
    if (must_set_shared_state() && _shared_state == nullptr) {
580
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
581
0
    }
582
583
13
    _rows_returned_counter =
584
13
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
585
13
    _blocks_returned_counter =
586
13
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
587
13
    _output_block_bytes_counter =
588
13
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
589
13
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
590
13
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
591
13
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
592
13
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
593
13
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
594
13
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
595
13
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
596
13
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
597
13
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
598
13
    _memory_used_counter =
599
13
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
600
13
    _common_profile->add_info_string("IsColocate",
601
13
                                     std::to_string(_parent->is_colocated_operator()));
602
13
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
603
13
    _common_profile->add_info_string("FollowedByShuffledOperator",
604
13
                                     std::to_string(_parent->followed_by_shuffled_operator()));
605
13
    return Status::OK();
606
13
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
541
152
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
542
152
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
543
152
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
544
152
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
545
152
    _operator_profile->set_metadata(_parent->node_id());
546
    // indent is false so that source operator will have same
547
    // indentation_level with its parent operator.
548
152
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
549
152
    _operator_profile->add_child(_common_profile.get(), true);
550
152
    _operator_profile->add_child(_custom_profile.get(), true);
551
152
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
552
152
    if constexpr (!is_fake_shared) {
553
152
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
554
152
            _shared_state = info.shared_state_map.at(_parent->operator_id())
555
152
                                    .first.get()
556
152
                                    ->template cast<SharedStateArg>();
557
558
152
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
559
152
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
560
152
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
561
152
        } else if (info.shared_state) {
562
0
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
563
0
                DCHECK(false);
564
0
            }
565
            // For UnionSourceOperator without children, there is no shared state.
566
0
            _shared_state = info.shared_state->template cast<SharedStateArg>();
567
568
0
            _dependency = _shared_state->create_source_dependency(
569
0
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
570
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
571
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
572
0
        } else {
573
0
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
574
0
                DCHECK(false);
575
0
            }
576
0
        }
577
152
    }
578
579
152
    if (must_set_shared_state() && _shared_state == nullptr) {
580
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
581
0
    }
582
583
152
    _rows_returned_counter =
584
152
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
585
152
    _blocks_returned_counter =
586
152
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
587
152
    _output_block_bytes_counter =
588
152
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
589
152
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
590
152
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
591
152
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
592
152
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
593
152
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
594
152
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
595
152
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
596
152
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
597
152
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
598
152
    _memory_used_counter =
599
152
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
600
152
    _common_profile->add_info_string("IsColocate",
601
152
                                     std::to_string(_parent->is_colocated_operator()));
602
152
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
603
152
    _common_profile->add_info_string("FollowedByShuffledOperator",
604
152
                                     std::to_string(_parent->followed_by_shuffled_operator()));
605
152
    return Status::OK();
606
152
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
607
608
template <typename SharedStateArg>
609
26.5k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
610
26.5k
    _conjuncts.resize(_parent->_conjuncts.size());
611
26.5k
    _projections.resize(_parent->_projections.size());
612
27.5k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
613
1.08k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
614
1.08k
    }
615
99.5k
    for (size_t i = 0; i < _projections.size(); i++) {
616
73.0k
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
617
73.0k
    }
618
26.5k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
619
26.5k
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
620
40
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
621
240
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
622
200
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
623
200
                    state, _intermediate_projections[i][j]));
624
200
        }
625
40
    }
626
26.5k
    return Status::OK();
627
26.5k
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
609
24.0k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
610
24.0k
    _conjuncts.resize(_parent->_conjuncts.size());
611
24.0k
    _projections.resize(_parent->_projections.size());
612
24.0k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
613
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
614
0
    }
615
89.9k
    for (size_t i = 0; i < _projections.size(); i++) {
616
65.9k
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
617
65.9k
    }
618
24.0k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
619
24.0k
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
620
0
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
621
0
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
622
0
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
623
0
                    state, _intermediate_projections[i][j]));
624
0
        }
625
0
    }
626
24.0k
    return Status::OK();
627
24.0k
}
_ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
609
3
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
610
3
    _conjuncts.resize(_parent->_conjuncts.size());
611
3
    _projections.resize(_parent->_projections.size());
612
3
    for (size_t i = 0; i < _conjuncts.size(); i++) {
613
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
614
0
    }
615
3
    for (size_t i = 0; i < _projections.size(); i++) {
616
0
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
617
0
    }
618
3
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
619
3
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
620
0
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
621
0
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
622
0
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
623
0
                    state, _intermediate_projections[i][j]));
624
0
        }
625
0
    }
626
3
    return Status::OK();
627
3
}
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
609
98
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
610
98
    _conjuncts.resize(_parent->_conjuncts.size());
611
98
    _projections.resize(_parent->_projections.size());
612
98
    for (size_t i = 0; i < _conjuncts.size(); i++) {
613
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
614
0
    }
615
98
    for (size_t i = 0; i < _projections.size(); i++) {
616
0
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
617
0
    }
618
98
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
619
98
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
620
0
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
621
0
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
622
0
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
623
0
                    state, _intermediate_projections[i][j]));
624
0
        }
625
0
    }
626
98
    return Status::OK();
627
98
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
609
14
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
610
14
    _conjuncts.resize(_parent->_conjuncts.size());
611
14
    _projections.resize(_parent->_projections.size());
612
14
    for (size_t i = 0; i < _conjuncts.size(); i++) {
613
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
614
0
    }
615
14
    for (size_t i = 0; i < _projections.size(); i++) {
616
0
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
617
0
    }
618
14
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
619
14
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
620
0
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
621
0
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
622
0
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
623
0
                    state, _intermediate_projections[i][j]));
624
0
        }
625
0
    }
626
14
    return Status::OK();
627
14
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
609
130
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
610
130
    _conjuncts.resize(_parent->_conjuncts.size());
611
130
    _projections.resize(_parent->_projections.size());
612
130
    for (size_t i = 0; i < _conjuncts.size(); i++) {
613
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
614
0
    }
615
1.17k
    for (size_t i = 0; i < _projections.size(); i++) {
616
1.04k
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
617
1.04k
    }
618
130
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
619
130
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
620
0
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
621
0
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
622
0
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
623
0
                    state, _intermediate_projections[i][j]));
624
0
        }
625
0
    }
626
130
    return Status::OK();
627
130
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
609
11
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
610
11
    _conjuncts.resize(_parent->_conjuncts.size());
611
11
    _projections.resize(_parent->_projections.size());
612
11
    for (size_t i = 0; i < _conjuncts.size(); i++) {
613
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
614
0
    }
615
11
    for (size_t i = 0; i < _projections.size(); i++) {
616
0
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
617
0
    }
618
11
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
619
11
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
620
0
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
621
0
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
622
0
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
623
0
                    state, _intermediate_projections[i][j]));
624
0
        }
625
0
    }
626
11
    return Status::OK();
627
11
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
609
403
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
610
403
    _conjuncts.resize(_parent->_conjuncts.size());
611
403
    _projections.resize(_parent->_projections.size());
612
403
    for (size_t i = 0; i < _conjuncts.size(); i++) {
613
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
614
0
    }
615
1.63k
    for (size_t i = 0; i < _projections.size(); i++) {
616
1.23k
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
617
1.23k
    }
618
403
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
619
403
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
620
0
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
621
0
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
622
0
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
623
0
                    state, _intermediate_projections[i][j]));
624
0
        }
625
0
    }
626
403
    return Status::OK();
627
403
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE4openEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
609
69
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
610
69
    _conjuncts.resize(_parent->_conjuncts.size());
611
69
    _projections.resize(_parent->_projections.size());
612
69
    for (size_t i = 0; i < _conjuncts.size(); i++) {
613
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
614
0
    }
615
179
    for (size_t i = 0; i < _projections.size(); i++) {
616
110
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
617
110
    }
618
69
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
619
69
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
620
0
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
621
0
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
622
0
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
623
0
                    state, _intermediate_projections[i][j]));
624
0
        }
625
0
    }
626
69
    return Status::OK();
627
69
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
609
1.27k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
610
1.27k
    _conjuncts.resize(_parent->_conjuncts.size());
611
1.27k
    _projections.resize(_parent->_projections.size());
612
2.26k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
613
992
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
614
992
    }
615
5.74k
    for (size_t i = 0; i < _projections.size(); i++) {
616
4.47k
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
617
4.47k
    }
618
1.27k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
619
1.31k
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
620
40
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
621
240
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
622
200
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
623
200
                    state, _intermediate_projections[i][j]));
624
200
        }
625
40
    }
626
1.27k
    return Status::OK();
627
1.27k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
609
14
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
610
14
    _conjuncts.resize(_parent->_conjuncts.size());
611
14
    _projections.resize(_parent->_projections.size());
612
14
    for (size_t i = 0; i < _conjuncts.size(); i++) {
613
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
614
0
    }
615
201
    for (size_t i = 0; i < _projections.size(); i++) {
616
187
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
617
187
    }
618
14
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
619
14
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
620
0
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
621
0
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
622
0
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
623
0
                    state, _intermediate_projections[i][j]));
624
0
        }
625
0
    }
626
14
    return Status::OK();
627
14
}
_ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
609
11
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
610
11
    _conjuncts.resize(_parent->_conjuncts.size());
611
11
    _projections.resize(_parent->_projections.size());
612
11
    for (size_t i = 0; i < _conjuncts.size(); i++) {
613
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
614
0
    }
615
11
    for (size_t i = 0; i < _projections.size(); i++) {
616
0
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
617
0
    }
618
11
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
619
11
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
620
0
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
621
0
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
622
0
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
623
0
                    state, _intermediate_projections[i][j]));
624
0
        }
625
0
    }
626
11
    return Status::OK();
627
11
}
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
609
194
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
610
194
    _conjuncts.resize(_parent->_conjuncts.size());
611
194
    _projections.resize(_parent->_projections.size());
612
282
    for (size_t i = 0; i < _conjuncts.size(); i++) {
613
88
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
614
88
    }
615
194
    for (size_t i = 0; i < _projections.size(); i++) {
616
0
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
617
0
    }
618
194
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
619
194
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
620
0
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
621
0
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
622
0
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
623
0
                    state, _intermediate_projections[i][j]));
624
0
        }
625
0
    }
626
194
    return Status::OK();
627
194
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
609
102
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
610
102
    _conjuncts.resize(_parent->_conjuncts.size());
611
102
    _projections.resize(_parent->_projections.size());
612
102
    for (size_t i = 0; i < _conjuncts.size(); i++) {
613
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
614
0
    }
615
102
    for (size_t i = 0; i < _projections.size(); i++) {
616
0
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
617
0
    }
618
102
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
619
102
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
620
0
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
621
0
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
622
0
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
623
0
                    state, _intermediate_projections[i][j]));
624
0
        }
625
0
    }
626
102
    return Status::OK();
627
102
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
609
13
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
610
13
    _conjuncts.resize(_parent->_conjuncts.size());
611
13
    _projections.resize(_parent->_projections.size());
612
13
    for (size_t i = 0; i < _conjuncts.size(); i++) {
613
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
614
0
    }
615
13
    for (size_t i = 0; i < _projections.size(); i++) {
616
0
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
617
0
    }
618
13
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
619
13
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
620
0
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
621
0
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
622
0
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
623
0
                    state, _intermediate_projections[i][j]));
624
0
        }
625
0
    }
626
13
    return Status::OK();
627
13
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
609
152
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
610
152
    _conjuncts.resize(_parent->_conjuncts.size());
611
152
    _projections.resize(_parent->_projections.size());
612
152
    for (size_t i = 0; i < _conjuncts.size(); i++) {
613
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
614
0
    }
615
152
    for (size_t i = 0; i < _projections.size(); i++) {
616
0
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
617
0
    }
618
152
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
619
152
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
620
0
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
621
0
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
622
0
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
623
0
                    state, _intermediate_projections[i][j]));
624
0
        }
625
0
    }
626
152
    return Status::OK();
627
152
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE4openEPNS_12RuntimeStateE
628
629
template <typename SharedStateArg>
630
82
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
631
82
    if (_terminated) {
632
0
        return Status::OK();
633
0
    }
634
82
    _terminated = true;
635
82
    return Status::OK();
636
82
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
630
1
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
631
1
    if (_terminated) {
632
0
        return Status::OK();
633
0
    }
634
1
    _terminated = true;
635
1
    return Status::OK();
636
1
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
630
81
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
631
81
    if (_terminated) {
632
0
        return Status::OK();
633
0
    }
634
81
    _terminated = true;
635
81
    return Status::OK();
636
81
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE9terminateEPNS_12RuntimeStateE
637
638
template <typename SharedStateArg>
639
26.3k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
640
26.3k
    if (_closed) {
641
151
        return Status::OK();
642
151
    }
643
26.2k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
644
24.9k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
645
24.9k
    }
646
26.2k
    _closed = true;
647
26.2k
    return Status::OK();
648
26.3k
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
639
24.0k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
640
24.0k
    if (_closed) {
641
0
        return Status::OK();
642
0
    }
643
24.0k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
644
24.0k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
645
24.0k
    }
646
24.0k
    _closed = true;
647
24.0k
    return Status::OK();
648
24.0k
}
_ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
639
4
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
640
4
    if (_closed) {
641
0
        return Status::OK();
642
0
    }
643
4
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
644
4
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
645
4
    }
646
4
    _closed = true;
647
4
    return Status::OK();
648
4
}
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
639
150
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
640
150
    if (_closed) {
641
75
        return Status::OK();
642
75
    }
643
75
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
644
75
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
645
75
    }
646
75
    _closed = true;
647
75
    return Status::OK();
648
150
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
639
14
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
640
14
    if (_closed) {
641
0
        return Status::OK();
642
0
    }
643
14
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
644
14
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
645
14
    }
646
14
    _closed = true;
647
14
    return Status::OK();
648
14
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
639
130
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
640
130
    if (_closed) {
641
0
        return Status::OK();
642
0
    }
643
130
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
644
130
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
645
130
    }
646
130
    _closed = true;
647
130
    return Status::OK();
648
130
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
639
1
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
640
1
    if (_closed) {
641
0
        return Status::OK();
642
0
    }
643
1
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
644
1
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
645
1
    }
646
1
    _closed = true;
647
1
    return Status::OK();
648
1
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
639
309
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
640
309
    if (_closed) {
641
0
        return Status::OK();
642
0
    }
643
309
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
644
309
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
645
309
    }
646
309
    _closed = true;
647
309
    return Status::OK();
648
309
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE5closeEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
639
64
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
640
64
    if (_closed) {
641
0
        return Status::OK();
642
0
    }
643
64
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
644
64
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
645
64
    }
646
64
    _closed = true;
647
64
    return Status::OK();
648
64
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
639
1.32k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
640
1.32k
    if (_closed) {
641
76
        return Status::OK();
642
76
    }
643
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
644
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
645
    }
646
1.25k
    _closed = true;
647
1.25k
    return Status::OK();
648
1.32k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
639
12
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
640
12
    if (_closed) {
641
0
        return Status::OK();
642
0
    }
643
12
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
644
12
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
645
12
    }
646
12
    _closed = true;
647
12
    return Status::OK();
648
12
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE5closeEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
639
189
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
640
189
    if (_closed) {
641
0
        return Status::OK();
642
0
    }
643
189
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
644
189
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
645
189
    }
646
189
    _closed = true;
647
189
    return Status::OK();
648
189
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE5closeEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE5closeEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
639
150
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
640
150
    if (_closed) {
641
0
        return Status::OK();
642
0
    }
643
150
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
644
150
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
645
150
    }
646
150
    _closed = true;
647
150
    return Status::OK();
648
150
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE5closeEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE5closeEPNS_12RuntimeStateE
649
650
template <typename SharedState>
651
74.3k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
652
    // create profile
653
74.3k
    _operator_profile =
654
74.3k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
655
74.3k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
656
74.3k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
657
658
    // indentation is true
659
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
660
    // So we should set the indentation to true.
661
74.3k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
662
74.3k
    _operator_profile->add_child(_common_profile, true);
663
74.3k
    _operator_profile->add_child(_custom_profile, true);
664
665
74.3k
    _operator_profile->set_metadata(_parent->node_id());
666
74.3k
    _wait_for_finish_dependency_timer =
667
74.3k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
668
74.3k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
669
74.3k
    if constexpr (!is_fake_shared) {
670
73.5k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
671
73.5k
            info.shared_state_map.end()) {
672
14
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
673
14
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
674
14
            }
675
14
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
676
14
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
677
14
                                                  ? 0
678
14
                                                  : info.task_idx]
679
14
                                  .get();
680
14
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
681
73.5k
        } else {
682
73.5k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
0
                DCHECK(false);
684
0
            }
685
73.5k
            _shared_state = info.shared_state->template cast<SharedState>();
686
73.5k
            _dependency = _shared_state->create_sink_dependency(
687
73.5k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
688
73.5k
        }
689
73.5k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
690
73.5k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
691
73.5k
    }
692
693
74.3k
    if (must_set_shared_state() && _shared_state == nullptr) {
694
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
695
0
    }
696
697
74.3k
    _rows_input_counter =
698
74.3k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
699
74.3k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
700
74.3k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
701
74.3k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
702
74.3k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
703
74.3k
    _memory_used_counter =
704
74.3k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
705
74.3k
    _common_profile->add_info_string("IsColocate",
706
74.3k
                                     std::to_string(_parent->is_colocated_operator()));
707
74.3k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
708
74.3k
    _common_profile->add_info_string("FollowedByShuffledOperator",
709
74.3k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
710
74.3k
    return Status::OK();
711
74.3k
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
651
72.0k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
652
    // create profile
653
72.0k
    _operator_profile =
654
72.0k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
655
72.0k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
656
72.0k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
657
658
    // indentation is true
659
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
660
    // So we should set the indentation to true.
661
72.0k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
662
72.0k
    _operator_profile->add_child(_common_profile, true);
663
72.0k
    _operator_profile->add_child(_custom_profile, true);
664
665
72.0k
    _operator_profile->set_metadata(_parent->node_id());
666
72.0k
    _wait_for_finish_dependency_timer =
667
72.0k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
668
72.0k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
669
72.0k
    if constexpr (!is_fake_shared) {
670
72.0k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
671
72.0k
            info.shared_state_map.end()) {
672
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
673
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
674
            }
675
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
676
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
677
0
                                                  ? 0
678
0
                                                  : info.task_idx]
679
0
                                  .get();
680
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
681
72.0k
        } else {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(false);
684
            }
685
72.0k
            _shared_state = info.shared_state->template cast<SharedState>();
686
72.0k
            _dependency = _shared_state->create_sink_dependency(
687
72.0k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
688
72.0k
        }
689
72.0k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
690
72.0k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
691
72.0k
    }
692
693
72.0k
    if (must_set_shared_state() && _shared_state == nullptr) {
694
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
695
0
    }
696
697
72.0k
    _rows_input_counter =
698
72.0k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
699
72.0k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
700
72.0k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
701
72.0k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
702
72.0k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
703
72.0k
    _memory_used_counter =
704
72.0k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
705
72.0k
    _common_profile->add_info_string("IsColocate",
706
72.0k
                                     std::to_string(_parent->is_colocated_operator()));
707
72.0k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
708
72.0k
    _common_profile->add_info_string("FollowedByShuffledOperator",
709
72.0k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
710
72.0k
    return Status::OK();
711
72.0k
}
_ZN5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
651
2
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
652
    // create profile
653
2
    _operator_profile =
654
2
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
655
2
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
656
2
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
657
658
    // indentation is true
659
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
660
    // So we should set the indentation to true.
661
2
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
662
2
    _operator_profile->add_child(_common_profile, true);
663
2
    _operator_profile->add_child(_custom_profile, true);
664
665
2
    _operator_profile->set_metadata(_parent->node_id());
666
2
    _wait_for_finish_dependency_timer =
667
2
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
668
2
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
669
2
    if constexpr (!is_fake_shared) {
670
2
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
671
2
            info.shared_state_map.end()) {
672
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
673
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
674
            }
675
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
676
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
677
0
                                                  ? 0
678
0
                                                  : info.task_idx]
679
0
                                  .get();
680
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
681
2
        } else {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(false);
684
            }
685
2
            _shared_state = info.shared_state->template cast<SharedState>();
686
2
            _dependency = _shared_state->create_sink_dependency(
687
2
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
688
2
        }
689
2
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
690
2
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
691
2
    }
692
693
2
    if (must_set_shared_state() && _shared_state == nullptr) {
694
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
695
0
    }
696
697
2
    _rows_input_counter =
698
2
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
699
2
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
700
2
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
701
2
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
702
2
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
703
2
    _memory_used_counter =
704
2
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
705
2
    _common_profile->add_info_string("IsColocate",
706
2
                                     std::to_string(_parent->is_colocated_operator()));
707
2
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
708
2
    _common_profile->add_info_string("FollowedByShuffledOperator",
709
2
                                     std::to_string(_parent->followed_by_shuffled_operator()));
710
2
    return Status::OK();
711
2
}
_ZN5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
651
105
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
652
    // create profile
653
105
    _operator_profile =
654
105
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
655
105
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
656
105
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
657
658
    // indentation is true
659
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
660
    // So we should set the indentation to true.
661
105
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
662
105
    _operator_profile->add_child(_common_profile, true);
663
105
    _operator_profile->add_child(_custom_profile, true);
664
665
105
    _operator_profile->set_metadata(_parent->node_id());
666
105
    _wait_for_finish_dependency_timer =
667
105
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
668
105
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
669
105
    if constexpr (!is_fake_shared) {
670
105
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
671
105
            info.shared_state_map.end()) {
672
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
673
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
674
            }
675
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
676
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
677
0
                                                  ? 0
678
0
                                                  : info.task_idx]
679
0
                                  .get();
680
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
681
105
        } else {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(false);
684
            }
685
105
            _shared_state = info.shared_state->template cast<SharedState>();
686
105
            _dependency = _shared_state->create_sink_dependency(
687
105
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
688
105
        }
689
105
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
690
105
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
691
105
    }
692
693
105
    if (must_set_shared_state() && _shared_state == nullptr) {
694
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
695
0
    }
696
697
105
    _rows_input_counter =
698
105
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
699
105
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
700
105
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
701
105
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
702
105
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
703
105
    _memory_used_counter =
704
105
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
705
105
    _common_profile->add_info_string("IsColocate",
706
105
                                     std::to_string(_parent->is_colocated_operator()));
707
105
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
708
105
    _common_profile->add_info_string("FollowedByShuffledOperator",
709
105
                                     std::to_string(_parent->followed_by_shuffled_operator()));
710
105
    return Status::OK();
711
105
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
651
21
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
652
    // create profile
653
21
    _operator_profile =
654
21
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
655
21
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
656
21
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
657
658
    // indentation is true
659
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
660
    // So we should set the indentation to true.
661
21
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
662
21
    _operator_profile->add_child(_common_profile, true);
663
21
    _operator_profile->add_child(_custom_profile, true);
664
665
21
    _operator_profile->set_metadata(_parent->node_id());
666
21
    _wait_for_finish_dependency_timer =
667
21
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
668
21
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
669
21
    if constexpr (!is_fake_shared) {
670
21
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
671
21
            info.shared_state_map.end()) {
672
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
673
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
674
            }
675
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
676
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
677
0
                                                  ? 0
678
0
                                                  : info.task_idx]
679
0
                                  .get();
680
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
681
21
        } else {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(false);
684
            }
685
21
            _shared_state = info.shared_state->template cast<SharedState>();
686
21
            _dependency = _shared_state->create_sink_dependency(
687
21
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
688
21
        }
689
21
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
690
21
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
691
21
    }
692
693
21
    if (must_set_shared_state() && _shared_state == nullptr) {
694
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
695
0
    }
696
697
21
    _rows_input_counter =
698
21
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
699
21
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
700
21
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
701
21
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
702
21
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
703
21
    _memory_used_counter =
704
21
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
705
21
    _common_profile->add_info_string("IsColocate",
706
21
                                     std::to_string(_parent->is_colocated_operator()));
707
21
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
708
21
    _common_profile->add_info_string("FollowedByShuffledOperator",
709
21
                                     std::to_string(_parent->followed_by_shuffled_operator()));
710
21
    return Status::OK();
711
21
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
651
131
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
652
    // create profile
653
131
    _operator_profile =
654
131
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
655
131
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
656
131
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
657
658
    // indentation is true
659
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
660
    // So we should set the indentation to true.
661
131
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
662
131
    _operator_profile->add_child(_common_profile, true);
663
131
    _operator_profile->add_child(_custom_profile, true);
664
665
131
    _operator_profile->set_metadata(_parent->node_id());
666
131
    _wait_for_finish_dependency_timer =
667
131
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
668
131
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
669
131
    if constexpr (!is_fake_shared) {
670
131
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
671
131
            info.shared_state_map.end()) {
672
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
673
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
674
            }
675
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
676
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
677
0
                                                  ? 0
678
0
                                                  : info.task_idx]
679
0
                                  .get();
680
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
681
131
        } else {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(false);
684
            }
685
131
            _shared_state = info.shared_state->template cast<SharedState>();
686
131
            _dependency = _shared_state->create_sink_dependency(
687
131
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
688
131
        }
689
131
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
690
131
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
691
131
    }
692
693
131
    if (must_set_shared_state() && _shared_state == nullptr) {
694
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
695
0
    }
696
697
131
    _rows_input_counter =
698
131
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
699
131
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
700
131
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
701
131
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
702
131
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
703
131
    _memory_used_counter =
704
131
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
705
131
    _common_profile->add_info_string("IsColocate",
706
131
                                     std::to_string(_parent->is_colocated_operator()));
707
131
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
708
131
    _common_profile->add_info_string("FollowedByShuffledOperator",
709
131
                                     std::to_string(_parent->followed_by_shuffled_operator()));
710
131
    return Status::OK();
711
131
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
651
11
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
652
    // create profile
653
11
    _operator_profile =
654
11
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
655
11
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
656
11
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
657
658
    // indentation is true
659
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
660
    // So we should set the indentation to true.
661
11
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
662
11
    _operator_profile->add_child(_common_profile, true);
663
11
    _operator_profile->add_child(_custom_profile, true);
664
665
11
    _operator_profile->set_metadata(_parent->node_id());
666
11
    _wait_for_finish_dependency_timer =
667
11
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
668
11
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
669
11
    if constexpr (!is_fake_shared) {
670
11
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
671
11
            info.shared_state_map.end()) {
672
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
673
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
674
            }
675
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
676
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
677
0
                                                  ? 0
678
0
                                                  : info.task_idx]
679
0
                                  .get();
680
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
681
11
        } else {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(false);
684
            }
685
11
            _shared_state = info.shared_state->template cast<SharedState>();
686
11
            _dependency = _shared_state->create_sink_dependency(
687
11
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
688
11
        }
689
11
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
690
11
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
691
11
    }
692
693
11
    if (must_set_shared_state() && _shared_state == nullptr) {
694
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
695
0
    }
696
697
11
    _rows_input_counter =
698
11
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
699
11
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
700
11
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
701
11
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
702
11
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
703
11
    _memory_used_counter =
704
11
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
705
11
    _common_profile->add_info_string("IsColocate",
706
11
                                     std::to_string(_parent->is_colocated_operator()));
707
11
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
708
11
    _common_profile->add_info_string("FollowedByShuffledOperator",
709
11
                                     std::to_string(_parent->followed_by_shuffled_operator()));
710
11
    return Status::OK();
711
11
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
651
413
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
652
    // create profile
653
413
    _operator_profile =
654
413
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
655
413
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
656
413
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
657
658
    // indentation is true
659
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
660
    // So we should set the indentation to true.
661
413
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
662
413
    _operator_profile->add_child(_common_profile, true);
663
413
    _operator_profile->add_child(_custom_profile, true);
664
665
413
    _operator_profile->set_metadata(_parent->node_id());
666
413
    _wait_for_finish_dependency_timer =
667
413
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
668
413
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
669
413
    if constexpr (!is_fake_shared) {
670
413
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
671
413
            info.shared_state_map.end()) {
672
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
673
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
674
            }
675
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
676
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
677
0
                                                  ? 0
678
0
                                                  : info.task_idx]
679
0
                                  .get();
680
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
681
413
        } else {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(false);
684
            }
685
413
            _shared_state = info.shared_state->template cast<SharedState>();
686
413
            _dependency = _shared_state->create_sink_dependency(
687
413
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
688
413
        }
689
413
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
690
413
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
691
413
    }
692
693
413
    if (must_set_shared_state() && _shared_state == nullptr) {
694
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
695
0
    }
696
697
413
    _rows_input_counter =
698
413
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
699
413
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
700
413
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
701
413
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
702
413
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
703
413
    _memory_used_counter =
704
413
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
705
413
    _common_profile->add_info_string("IsColocate",
706
413
                                     std::to_string(_parent->is_colocated_operator()));
707
413
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
708
413
    _common_profile->add_info_string("FollowedByShuffledOperator",
709
413
                                     std::to_string(_parent->followed_by_shuffled_operator()));
710
413
    return Status::OK();
711
413
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
651
75
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
652
    // create profile
653
75
    _operator_profile =
654
75
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
655
75
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
656
75
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
657
658
    // indentation is true
659
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
660
    // So we should set the indentation to true.
661
75
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
662
75
    _operator_profile->add_child(_common_profile, true);
663
75
    _operator_profile->add_child(_custom_profile, true);
664
665
75
    _operator_profile->set_metadata(_parent->node_id());
666
75
    _wait_for_finish_dependency_timer =
667
75
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
668
75
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
669
75
    if constexpr (!is_fake_shared) {
670
75
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
671
75
            info.shared_state_map.end()) {
672
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
673
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
674
            }
675
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
676
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
677
0
                                                  ? 0
678
0
                                                  : info.task_idx]
679
0
                                  .get();
680
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
681
75
        } else {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(false);
684
            }
685
75
            _shared_state = info.shared_state->template cast<SharedState>();
686
75
            _dependency = _shared_state->create_sink_dependency(
687
75
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
688
75
        }
689
75
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
690
75
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
691
75
    }
692
693
75
    if (must_set_shared_state() && _shared_state == nullptr) {
694
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
695
0
    }
696
697
75
    _rows_input_counter =
698
75
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
699
75
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
700
75
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
701
75
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
702
75
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
703
75
    _memory_used_counter =
704
75
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
705
75
    _common_profile->add_info_string("IsColocate",
706
75
                                     std::to_string(_parent->is_colocated_operator()));
707
75
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
708
75
    _common_profile->add_info_string("FollowedByShuffledOperator",
709
75
                                     std::to_string(_parent->followed_by_shuffled_operator()));
710
75
    return Status::OK();
711
75
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
651
820
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
652
    // create profile
653
820
    _operator_profile =
654
820
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
655
820
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
656
820
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
657
658
    // indentation is true
659
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
660
    // So we should set the indentation to true.
661
820
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
662
820
    _operator_profile->add_child(_common_profile, true);
663
820
    _operator_profile->add_child(_custom_profile, true);
664
665
820
    _operator_profile->set_metadata(_parent->node_id());
666
820
    _wait_for_finish_dependency_timer =
667
820
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
668
820
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
669
    if constexpr (!is_fake_shared) {
670
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
671
            info.shared_state_map.end()) {
672
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
673
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
674
            }
675
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
676
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
677
                                                  ? 0
678
                                                  : info.task_idx]
679
                                  .get();
680
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
681
        } else {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(false);
684
            }
685
            _shared_state = info.shared_state->template cast<SharedState>();
686
            _dependency = _shared_state->create_sink_dependency(
687
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
688
        }
689
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
690
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
691
    }
692
693
820
    if (must_set_shared_state() && _shared_state == nullptr) {
694
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
695
0
    }
696
697
820
    _rows_input_counter =
698
820
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
699
820
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
700
820
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
701
820
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
702
820
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
703
820
    _memory_used_counter =
704
820
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
705
820
    _common_profile->add_info_string("IsColocate",
706
820
                                     std::to_string(_parent->is_colocated_operator()));
707
820
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
708
820
    _common_profile->add_info_string("FollowedByShuffledOperator",
709
820
                                     std::to_string(_parent->followed_by_shuffled_operator()));
710
820
    return Status::OK();
711
820
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
651
3
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
652
    // create profile
653
3
    _operator_profile =
654
3
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
655
3
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
656
3
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
657
658
    // indentation is true
659
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
660
    // So we should set the indentation to true.
661
3
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
662
3
    _operator_profile->add_child(_common_profile, true);
663
3
    _operator_profile->add_child(_custom_profile, true);
664
665
3
    _operator_profile->set_metadata(_parent->node_id());
666
3
    _wait_for_finish_dependency_timer =
667
3
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
668
3
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
669
3
    if constexpr (!is_fake_shared) {
670
3
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
671
3
            info.shared_state_map.end()) {
672
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
673
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
674
            }
675
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
676
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
677
0
                                                  ? 0
678
0
                                                  : info.task_idx]
679
0
                                  .get();
680
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
681
3
        } else {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(false);
684
            }
685
3
            _shared_state = info.shared_state->template cast<SharedState>();
686
3
            _dependency = _shared_state->create_sink_dependency(
687
3
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
688
3
        }
689
3
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
690
3
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
691
3
    }
692
693
3
    if (must_set_shared_state() && _shared_state == nullptr) {
694
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
695
0
    }
696
697
3
    _rows_input_counter =
698
3
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
699
3
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
700
3
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
701
3
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
702
3
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
703
3
    _memory_used_counter =
704
3
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
705
3
    _common_profile->add_info_string("IsColocate",
706
3
                                     std::to_string(_parent->is_colocated_operator()));
707
3
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
708
3
    _common_profile->add_info_string("FollowedByShuffledOperator",
709
3
                                     std::to_string(_parent->followed_by_shuffled_operator()));
710
3
    return Status::OK();
711
3
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
651
102
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
652
    // create profile
653
102
    _operator_profile =
654
102
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
655
102
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
656
102
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
657
658
    // indentation is true
659
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
660
    // So we should set the indentation to true.
661
102
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
662
102
    _operator_profile->add_child(_common_profile, true);
663
102
    _operator_profile->add_child(_custom_profile, true);
664
665
102
    _operator_profile->set_metadata(_parent->node_id());
666
102
    _wait_for_finish_dependency_timer =
667
102
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
668
102
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
669
102
    if constexpr (!is_fake_shared) {
670
102
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
671
102
            info.shared_state_map.end()) {
672
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
673
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
674
            }
675
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
676
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
677
0
                                                  ? 0
678
0
                                                  : info.task_idx]
679
0
                                  .get();
680
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
681
102
        } else {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(false);
684
            }
685
102
            _shared_state = info.shared_state->template cast<SharedState>();
686
102
            _dependency = _shared_state->create_sink_dependency(
687
102
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
688
102
        }
689
102
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
690
102
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
691
102
    }
692
693
102
    if (must_set_shared_state() && _shared_state == nullptr) {
694
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
695
0
    }
696
697
102
    _rows_input_counter =
698
102
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
699
102
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
700
102
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
701
102
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
702
102
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
703
102
    _memory_used_counter =
704
102
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
705
102
    _common_profile->add_info_string("IsColocate",
706
102
                                     std::to_string(_parent->is_colocated_operator()));
707
102
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
708
102
    _common_profile->add_info_string("FollowedByShuffledOperator",
709
102
                                     std::to_string(_parent->followed_by_shuffled_operator()));
710
102
    return Status::OK();
711
102
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
651
65
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
652
    // create profile
653
65
    _operator_profile =
654
65
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
655
65
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
656
65
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
657
658
    // indentation is true
659
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
660
    // So we should set the indentation to true.
661
65
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
662
65
    _operator_profile->add_child(_common_profile, true);
663
65
    _operator_profile->add_child(_custom_profile, true);
664
665
65
    _operator_profile->set_metadata(_parent->node_id());
666
65
    _wait_for_finish_dependency_timer =
667
65
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
668
65
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
669
65
    if constexpr (!is_fake_shared) {
670
65
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
671
65
            info.shared_state_map.end()) {
672
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
673
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
674
            }
675
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
676
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
677
0
                                                  ? 0
678
0
                                                  : info.task_idx]
679
0
                                  .get();
680
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
681
65
        } else {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(false);
684
            }
685
65
            _shared_state = info.shared_state->template cast<SharedState>();
686
65
            _dependency = _shared_state->create_sink_dependency(
687
65
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
688
65
        }
689
65
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
690
65
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
691
65
    }
692
693
65
    if (must_set_shared_state() && _shared_state == nullptr) {
694
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
695
0
    }
696
697
65
    _rows_input_counter =
698
65
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
699
65
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
700
65
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
701
65
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
702
65
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
703
65
    _memory_used_counter =
704
65
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
705
65
    _common_profile->add_info_string("IsColocate",
706
65
                                     std::to_string(_parent->is_colocated_operator()));
707
65
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
708
65
    _common_profile->add_info_string("FollowedByShuffledOperator",
709
65
                                     std::to_string(_parent->followed_by_shuffled_operator()));
710
65
    return Status::OK();
711
65
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
651
29
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
652
    // create profile
653
29
    _operator_profile =
654
29
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
655
29
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
656
29
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
657
658
    // indentation is true
659
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
660
    // So we should set the indentation to true.
661
29
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
662
29
    _operator_profile->add_child(_common_profile, true);
663
29
    _operator_profile->add_child(_custom_profile, true);
664
665
29
    _operator_profile->set_metadata(_parent->node_id());
666
29
    _wait_for_finish_dependency_timer =
667
29
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
668
29
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
669
29
    if constexpr (!is_fake_shared) {
670
29
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
671
29
            info.shared_state_map.end()) {
672
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
673
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
674
            }
675
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
676
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
677
0
                                                  ? 0
678
0
                                                  : info.task_idx]
679
0
                                  .get();
680
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
681
29
        } else {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(false);
684
            }
685
29
            _shared_state = info.shared_state->template cast<SharedState>();
686
29
            _dependency = _shared_state->create_sink_dependency(
687
29
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
688
29
        }
689
29
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
690
29
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
691
29
    }
692
693
29
    if (must_set_shared_state() && _shared_state == nullptr) {
694
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
695
0
    }
696
697
29
    _rows_input_counter =
698
29
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
699
29
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
700
29
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
701
29
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
702
29
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
703
29
    _memory_used_counter =
704
29
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
705
29
    _common_profile->add_info_string("IsColocate",
706
29
                                     std::to_string(_parent->is_colocated_operator()));
707
29
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
708
29
    _common_profile->add_info_string("FollowedByShuffledOperator",
709
29
                                     std::to_string(_parent->followed_by_shuffled_operator()));
710
29
    return Status::OK();
711
29
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
651
14
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
652
    // create profile
653
14
    _operator_profile =
654
14
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
655
14
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
656
14
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
657
658
    // indentation is true
659
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
660
    // So we should set the indentation to true.
661
14
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
662
14
    _operator_profile->add_child(_common_profile, true);
663
14
    _operator_profile->add_child(_custom_profile, true);
664
665
14
    _operator_profile->set_metadata(_parent->node_id());
666
14
    _wait_for_finish_dependency_timer =
667
14
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
668
14
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
669
14
    if constexpr (!is_fake_shared) {
670
14
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
671
14
            info.shared_state_map.end()) {
672
14
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
673
14
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
674
14
            }
675
14
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
676
14
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
677
14
                                                  ? 0
678
14
                                                  : info.task_idx]
679
14
                                  .get();
680
14
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
681
14
        } else {
682
0
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
0
                DCHECK(false);
684
0
            }
685
0
            _shared_state = info.shared_state->template cast<SharedState>();
686
0
            _dependency = _shared_state->create_sink_dependency(
687
0
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
688
0
        }
689
14
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
690
14
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
691
14
    }
692
693
14
    if (must_set_shared_state() && _shared_state == nullptr) {
694
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
695
0
    }
696
697
14
    _rows_input_counter =
698
14
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
699
14
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
700
14
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
701
14
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
702
14
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
703
14
    _memory_used_counter =
704
14
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
705
14
    _common_profile->add_info_string("IsColocate",
706
14
                                     std::to_string(_parent->is_colocated_operator()));
707
14
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
708
14
    _common_profile->add_info_string("FollowedByShuffledOperator",
709
14
                                     std::to_string(_parent->followed_by_shuffled_operator()));
710
14
    return Status::OK();
711
14
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
651
514
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
652
    // create profile
653
514
    _operator_profile =
654
514
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
655
514
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
656
514
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
657
658
    // indentation is true
659
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
660
    // So we should set the indentation to true.
661
514
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
662
514
    _operator_profile->add_child(_common_profile, true);
663
514
    _operator_profile->add_child(_custom_profile, true);
664
665
514
    _operator_profile->set_metadata(_parent->node_id());
666
514
    _wait_for_finish_dependency_timer =
667
514
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
668
514
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
669
514
    if constexpr (!is_fake_shared) {
670
514
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
671
514
            info.shared_state_map.end()) {
672
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
673
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
674
            }
675
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
676
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
677
0
                                                  ? 0
678
0
                                                  : info.task_idx]
679
0
                                  .get();
680
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
681
514
        } else {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(false);
684
            }
685
514
            _shared_state = info.shared_state->template cast<SharedState>();
686
514
            _dependency = _shared_state->create_sink_dependency(
687
514
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
688
514
        }
689
514
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
690
514
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
691
514
    }
692
693
514
    if (must_set_shared_state() && _shared_state == nullptr) {
694
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
695
0
    }
696
697
514
    _rows_input_counter =
698
514
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
699
514
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
700
514
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
701
514
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
702
514
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
703
514
    _memory_used_counter =
704
514
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
705
514
    _common_profile->add_info_string("IsColocate",
706
514
                                     std::to_string(_parent->is_colocated_operator()));
707
514
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
708
514
    _common_profile->add_info_string("FollowedByShuffledOperator",
709
514
                                     std::to_string(_parent->followed_by_shuffled_operator()));
710
514
    return Status::OK();
711
514
}
_ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
651
11
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
652
    // create profile
653
11
    _operator_profile =
654
11
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
655
11
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
656
11
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
657
658
    // indentation is true
659
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
660
    // So we should set the indentation to true.
661
11
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
662
11
    _operator_profile->add_child(_common_profile, true);
663
11
    _operator_profile->add_child(_custom_profile, true);
664
665
11
    _operator_profile->set_metadata(_parent->node_id());
666
11
    _wait_for_finish_dependency_timer =
667
11
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
668
11
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
669
11
    if constexpr (!is_fake_shared) {
670
11
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
671
11
            info.shared_state_map.end()) {
672
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
673
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
674
            }
675
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
676
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
677
0
                                                  ? 0
678
0
                                                  : info.task_idx]
679
0
                                  .get();
680
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
681
11
        } else {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(false);
684
            }
685
11
            _shared_state = info.shared_state->template cast<SharedState>();
686
11
            _dependency = _shared_state->create_sink_dependency(
687
11
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
688
11
        }
689
11
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
690
11
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
691
11
    }
692
693
11
    if (must_set_shared_state() && _shared_state == nullptr) {
694
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
695
0
    }
696
697
11
    _rows_input_counter =
698
11
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
699
11
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
700
11
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
701
11
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
702
11
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
703
11
    _memory_used_counter =
704
11
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
705
11
    _common_profile->add_info_string("IsColocate",
706
11
                                     std::to_string(_parent->is_colocated_operator()));
707
11
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
708
11
    _common_profile->add_info_string("FollowedByShuffledOperator",
709
11
                                     std::to_string(_parent->followed_by_shuffled_operator()));
710
11
    return Status::OK();
711
11
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
712
713
template <typename SharedState>
714
74.0k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
715
74.0k
    if (_closed) {
716
2
        return Status::OK();
717
2
    }
718
74.0k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
719
73.2k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
720
73.2k
    }
721
74.0k
    _closed = true;
722
74.0k
    return Status::OK();
723
74.0k
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
714
72.0k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
715
72.0k
    if (_closed) {
716
0
        return Status::OK();
717
0
    }
718
72.0k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
719
72.0k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
720
72.0k
    }
721
72.0k
    _closed = true;
722
72.0k
    return Status::OK();
723
72.0k
}
_ZN5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
714
1
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
715
1
    if (_closed) {
716
0
        return Status::OK();
717
0
    }
718
1
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
719
1
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
720
1
    }
721
1
    _closed = true;
722
1
    return Status::OK();
723
1
}
_ZN5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
714
75
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
715
75
    if (_closed) {
716
0
        return Status::OK();
717
0
    }
718
75
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
719
75
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
720
75
    }
721
75
    _closed = true;
722
75
    return Status::OK();
723
75
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
714
12
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
715
12
    if (_closed) {
716
2
        return Status::OK();
717
2
    }
718
10
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
719
10
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
720
10
    }
721
10
    _closed = true;
722
10
    return Status::OK();
723
12
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
714
131
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
715
131
    if (_closed) {
716
0
        return Status::OK();
717
0
    }
718
131
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
719
131
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
720
131
    }
721
131
    _closed = true;
722
131
    return Status::OK();
723
131
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
714
1
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
715
1
    if (_closed) {
716
0
        return Status::OK();
717
0
    }
718
1
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
719
1
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
720
1
    }
721
1
    _closed = true;
722
1
    return Status::OK();
723
1
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
714
308
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
715
308
    if (_closed) {
716
0
        return Status::OK();
717
0
    }
718
308
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
719
308
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
720
308
    }
721
308
    _closed = true;
722
308
    return Status::OK();
723
308
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
714
64
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
715
64
    if (_closed) {
716
0
        return Status::OK();
717
0
    }
718
64
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
719
64
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
720
64
    }
721
64
    _closed = true;
722
64
    return Status::OK();
723
64
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
714
811
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
715
811
    if (_closed) {
716
0
        return Status::OK();
717
0
    }
718
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
719
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
720
    }
721
811
    _closed = true;
722
811
    return Status::OK();
723
811
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
714
65
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
715
65
    if (_closed) {
716
0
        return Status::OK();
717
0
    }
718
65
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
719
65
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
720
65
    }
721
65
    _closed = true;
722
65
    return Status::OK();
723
65
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
714
14
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
715
14
    if (_closed) {
716
0
        return Status::OK();
717
0
    }
718
14
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
719
14
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
720
14
    }
721
14
    _closed = true;
722
14
    return Status::OK();
723
14
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
714
498
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
715
498
    if (_closed) {
716
0
        return Status::OK();
717
0
    }
718
498
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
719
498
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
720
498
    }
721
498
    _closed = true;
722
498
    return Status::OK();
723
498
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
724
725
template <typename LocalStateType>
726
Status StreamingOperatorX<LocalStateType>::get_block_impl(RuntimeState* state, Block* block,
727
2.57k
                                                          bool* eos) {
728
2.57k
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
729
2.57k
    return pull(state, block, eos);
730
2.57k
}
_ZN5doris18StreamingOperatorXINS_23AssertNumRowsLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
727
4
                                                          bool* eos) {
728
4
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
729
4
    return pull(state, block, eos);
730
4
}
_ZN5doris18StreamingOperatorXINS_16SelectLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
727
2.57k
                                                          bool* eos) {
728
2.57k
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
729
2.57k
    return pull(state, block, eos);
730
2.57k
}
731
732
template <typename LocalStateType>
733
Status StatefulOperatorX<LocalStateType>::get_block_impl(RuntimeState* state, Block* block,
734
301
                                                         bool* eos) {
735
301
    auto& local_state = get_local_state(state);
736
301
    if (need_more_input_data(state)) {
737
295
        local_state._child_block->clear_column_data(
738
295
                OperatorX<LocalStateType>::_child->row_desc().num_materialized_slots());
739
295
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
740
295
                state, local_state._child_block.get(), &local_state._child_eos));
741
295
        *eos = local_state._child_eos;
742
295
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
743
67
            return Status::OK();
744
67
        }
745
228
        {
746
228
            SCOPED_TIMER(local_state.exec_time_counter());
747
228
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
748
228
        }
749
228
    }
750
751
234
    if (!need_more_input_data(state)) {
752
234
        SCOPED_TIMER(local_state.exec_time_counter());
753
234
        bool new_eos = false;
754
234
        RETURN_IF_ERROR(pull(state, block, &new_eos));
755
234
        if (new_eos) {
756
165
            *eos = true;
757
165
        } else if (!need_more_input_data(state)) {
758
0
            *eos = false;
759
0
        }
760
234
    }
761
234
    return Status::OK();
762
234
}
_ZN5doris17StatefulOperatorXINS_23HashJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
734
60
                                                         bool* eos) {
735
60
    auto& local_state = get_local_state(state);
736
60
    if (need_more_input_data(state)) {
737
54
        local_state._child_block->clear_column_data(
738
54
                OperatorX<LocalStateType>::_child->row_desc().num_materialized_slots());
739
54
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
740
54
                state, local_state._child_block.get(), &local_state._child_eos));
741
54
        *eos = local_state._child_eos;
742
54
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
743
2
            return Status::OK();
744
2
        }
745
52
        {
746
52
            SCOPED_TIMER(local_state.exec_time_counter());
747
52
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
748
52
        }
749
52
    }
750
751
58
    if (!need_more_input_data(state)) {
752
58
        SCOPED_TIMER(local_state.exec_time_counter());
753
58
        bool new_eos = false;
754
58
        RETURN_IF_ERROR(pull(state, block, &new_eos));
755
58
        if (new_eos) {
756
33
            *eos = true;
757
33
        } else if (!need_more_input_data(state)) {
758
0
            *eos = false;
759
0
        }
760
58
    }
761
58
    return Status::OK();
762
58
}
Unexecuted instantiation: _ZN5doris17StatefulOperatorXINS_34PartitionedHashJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Unexecuted instantiation: _ZN5doris17StatefulOperatorXINS_16RepeatLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Unexecuted instantiation: _ZN5doris17StatefulOperatorXINS_25MaterializationLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Unexecuted instantiation: _ZN5doris17StatefulOperatorXINS_22StreamingAggLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
_ZN5doris17StatefulOperatorXINS_30DistinctStreamingAggLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
734
2
                                                         bool* eos) {
735
2
    auto& local_state = get_local_state(state);
736
2
    if (need_more_input_data(state)) {
737
2
        local_state._child_block->clear_column_data(
738
2
                OperatorX<LocalStateType>::_child->row_desc().num_materialized_slots());
739
2
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
740
2
                state, local_state._child_block.get(), &local_state._child_eos));
741
2
        *eos = local_state._child_eos;
742
2
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
743
0
            return Status::OK();
744
0
        }
745
2
        {
746
2
            SCOPED_TIMER(local_state.exec_time_counter());
747
2
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
748
2
        }
749
2
    }
750
751
2
    if (!need_more_input_data(state)) {
752
2
        SCOPED_TIMER(local_state.exec_time_counter());
753
2
        bool new_eos = false;
754
2
        RETURN_IF_ERROR(pull(state, block, &new_eos));
755
2
        if (new_eos) {
756
2
            *eos = true;
757
2
        } else if (!need_more_input_data(state)) {
758
0
            *eos = false;
759
0
        }
760
2
    }
761
2
    return Status::OK();
762
2
}
_ZN5doris17StatefulOperatorXINS_29NestedLoopJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
734
239
                                                         bool* eos) {
735
239
    auto& local_state = get_local_state(state);
736
239
    if (need_more_input_data(state)) {
737
239
        local_state._child_block->clear_column_data(
738
239
                OperatorX<LocalStateType>::_child->row_desc().num_materialized_slots());
739
239
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
740
239
                state, local_state._child_block.get(), &local_state._child_eos));
741
239
        *eos = local_state._child_eos;
742
239
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
743
65
            return Status::OK();
744
65
        }
745
174
        {
746
174
            SCOPED_TIMER(local_state.exec_time_counter());
747
174
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
748
174
        }
749
174
    }
750
751
174
    if (!need_more_input_data(state)) {
752
174
        SCOPED_TIMER(local_state.exec_time_counter());
753
174
        bool new_eos = false;
754
174
        RETURN_IF_ERROR(pull(state, block, &new_eos));
755
174
        if (new_eos) {
756
130
            *eos = true;
757
130
        } else if (!need_more_input_data(state)) {
758
0
            *eos = false;
759
0
        }
760
174
    }
761
174
    return Status::OK();
762
174
}
Unexecuted instantiation: _ZN5doris17StatefulOperatorXINS_23TableFunctionLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
763
764
template <typename Writer, typename Parent>
765
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
766
23
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
767
23
    RETURN_IF_ERROR(Base::init(state, info));
768
23
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
769
23
                                                         "AsyncWriterDependency", true);
770
23
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
771
23
                             _finish_dependency));
772
773
23
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
774
23
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
775
23
    return Status::OK();
776
23
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
766
11
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
767
11
    RETURN_IF_ERROR(Base::init(state, info));
768
11
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
769
11
                                                         "AsyncWriterDependency", true);
770
11
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
771
11
                             _finish_dependency));
772
773
11
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
774
11
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
775
11
    return Status::OK();
776
11
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
766
12
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
767
12
    RETURN_IF_ERROR(Base::init(state, info));
768
12
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
769
12
                                                         "AsyncWriterDependency", true);
770
12
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
771
12
                             _finish_dependency));
772
773
12
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
774
12
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
775
12
    return Status::OK();
776
12
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_18VIcebergDeleteSinkENS_26IcebergDeleteSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_17VIcebergMergeSinkENS_25IcebergMergeSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
777
778
template <typename Writer, typename Parent>
779
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
780
23
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
781
23
    RETURN_IF_ERROR(Base::open(state));
782
23
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
783
283
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
784
260
        RETURN_IF_ERROR(
785
260
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
786
260
    }
787
23
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
788
23
    return Status::OK();
789
23
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4openEPNS_12RuntimeStateE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
780
11
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
781
11
    RETURN_IF_ERROR(Base::open(state));
782
11
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
783
67
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
784
56
        RETURN_IF_ERROR(
785
56
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
786
56
    }
787
11
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
788
11
    return Status::OK();
789
11
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
780
12
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
781
12
    RETURN_IF_ERROR(Base::open(state));
782
12
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
783
216
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
784
204
        RETURN_IF_ERROR(
785
204
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
786
204
    }
787
12
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
788
12
    return Status::OK();
789
12
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_18VIcebergDeleteSinkENS_26IcebergDeleteSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_17VIcebergMergeSinkENS_25IcebergMergeSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE4openEPNS_12RuntimeStateE
790
791
template <typename Writer, typename Parent>
792
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
793
66
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
794
66
    return _writer->sink(block, eos);
795
66
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
793
54
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
794
54
    return _writer->sink(block, eos);
795
54
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
793
12
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
794
12
    return _writer->sink(block, eos);
795
12
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_18VIcebergDeleteSinkENS_26IcebergDeleteSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_17VIcebergMergeSinkENS_25IcebergMergeSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
796
797
template <typename Writer, typename Parent>
798
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
799
23
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
800
23
    if (_closed) {
801
0
        return Status::OK();
802
0
    }
803
23
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
804
23
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
805
    // if the init failed, the _writer may be nullptr. so here need check
806
23
    if (_writer) {
807
23
        Status st = _writer->get_writer_status();
808
23
        if (exec_status.ok()) {
809
23
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
810
23
                                                       : Status::Cancelled("force close"));
811
23
        } else {
812
0
            _writer->force_close(exec_status);
813
0
        }
814
        // If there is an error in process_block thread, then we should get the writer
815
        // status before call force_close. For example, the thread may failed in commit
816
        // transaction.
817
23
        RETURN_IF_ERROR(st);
818
23
    }
819
23
    return Base::close(state, exec_status);
820
23
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
799
11
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
800
11
    if (_closed) {
801
0
        return Status::OK();
802
0
    }
803
11
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
804
11
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
805
    // if the init failed, the _writer may be nullptr. so here need check
806
11
    if (_writer) {
807
11
        Status st = _writer->get_writer_status();
808
11
        if (exec_status.ok()) {
809
11
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
810
11
                                                       : Status::Cancelled("force close"));
811
11
        } else {
812
0
            _writer->force_close(exec_status);
813
0
        }
814
        // If there is an error in process_block thread, then we should get the writer
815
        // status before call force_close. For example, the thread may failed in commit
816
        // transaction.
817
11
        RETURN_IF_ERROR(st);
818
11
    }
819
11
    return Base::close(state, exec_status);
820
11
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
799
12
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
800
12
    if (_closed) {
801
0
        return Status::OK();
802
0
    }
803
12
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
804
12
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
805
    // if the init failed, the _writer may be nullptr. so here need check
806
12
    if (_writer) {
807
12
        Status st = _writer->get_writer_status();
808
12
        if (exec_status.ok()) {
809
12
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
810
12
                                                       : Status::Cancelled("force close"));
811
12
        } else {
812
0
            _writer->force_close(exec_status);
813
0
        }
814
        // If there is an error in process_block thread, then we should get the writer
815
        // status before call force_close. For example, the thread may failed in commit
816
        // transaction.
817
12
        RETURN_IF_ERROR(st);
818
12
    }
819
12
    return Base::close(state, exec_status);
820
12
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_18VIcebergDeleteSinkENS_26IcebergDeleteSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_17VIcebergMergeSinkENS_25IcebergMergeSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
821
822
// An instantiation added outside the macros below needs the matching
823
// 'extern template' declaration in the operator's header (enforced by
824
// build-support/check-extern-template-pairing.py). Instantiations expanded
825
// through DECLARE_OPERATOR are invisible to that check -- macro bodies are
826
// skipped -- so their extern pairing has to be kept in sync by hand.
827
#define DECLARE_OPERATOR(LOCAL_STATE) template class DataSinkOperatorX<LOCAL_STATE>;
828
DECLARE_OPERATOR(HashJoinBuildSinkLocalState)
829
DECLARE_OPERATOR(ResultSinkLocalState)
830
DECLARE_OPERATOR(JdbcTableSinkLocalState)
831
DECLARE_OPERATOR(MemoryScratchSinkLocalState)
832
DECLARE_OPERATOR(ResultFileSinkLocalState)
833
DECLARE_OPERATOR(OlapTableSinkLocalState)
834
DECLARE_OPERATOR(OlapTableSinkV2LocalState)
835
DECLARE_OPERATOR(HiveTableSinkLocalState)
836
DECLARE_OPERATOR(TVFTableSinkLocalState)
837
DECLARE_OPERATOR(IcebergTableSinkLocalState)
838
DECLARE_OPERATOR(SpillIcebergTableSinkLocalState)
839
DECLARE_OPERATOR(IcebergDeleteSinkLocalState)
840
DECLARE_OPERATOR(IcebergMergeSinkLocalState)
841
DECLARE_OPERATOR(MCTableSinkLocalState)
842
DECLARE_OPERATOR(AnalyticSinkLocalState)
843
DECLARE_OPERATOR(BlackholeSinkLocalState)
844
DECLARE_OPERATOR(SortSinkLocalState)
845
DECLARE_OPERATOR(SpillSortSinkLocalState)
846
DECLARE_OPERATOR(LocalExchangeSinkLocalState)
847
DECLARE_OPERATOR(AggSinkLocalState)
848
DECLARE_OPERATOR(BucketedAggSinkLocalState)
849
DECLARE_OPERATOR(PartitionedAggSinkLocalState)
850
DECLARE_OPERATOR(ExchangeSinkLocalState)
851
DECLARE_OPERATOR(NestedLoopJoinBuildSinkLocalState)
852
DECLARE_OPERATOR(UnionSinkLocalState)
853
DECLARE_OPERATOR(MultiCastDataStreamSinkLocalState)
854
DECLARE_OPERATOR(PartitionSortSinkLocalState)
855
DECLARE_OPERATOR(SetProbeSinkLocalState<true>)
856
DECLARE_OPERATOR(SetProbeSinkLocalState<false>)
857
DECLARE_OPERATOR(SetSinkLocalState<true>)
858
DECLARE_OPERATOR(SetSinkLocalState<false>)
859
DECLARE_OPERATOR(PartitionedHashJoinSinkLocalState)
860
DECLARE_OPERATOR(GroupCommitBlockSinkLocalState)
861
DECLARE_OPERATOR(CacheSinkLocalState)
862
DECLARE_OPERATOR(DictSinkLocalState)
863
DECLARE_OPERATOR(RecCTESinkLocalState)
864
DECLARE_OPERATOR(RecCTEAnchorSinkLocalState)
865
866
#undef DECLARE_OPERATOR
867
868
#define DECLARE_OPERATOR(LOCAL_STATE) template class OperatorX<LOCAL_STATE>;
869
DECLARE_OPERATOR(HashJoinProbeLocalState)
870
DECLARE_OPERATOR(OlapScanLocalState)
871
DECLARE_OPERATOR(GroupCommitLocalState)
872
DECLARE_OPERATOR(JDBCScanLocalState)
873
DECLARE_OPERATOR(FileScanLocalState)
874
DECLARE_OPERATOR(AnalyticLocalState)
875
DECLARE_OPERATOR(SortLocalState)
876
DECLARE_OPERATOR(SpillSortLocalState)
877
DECLARE_OPERATOR(LocalMergeSortLocalState)
878
DECLARE_OPERATOR(AggLocalState)
879
DECLARE_OPERATOR(BucketedAggLocalState)
880
DECLARE_OPERATOR(PartitionedAggLocalState)
881
DECLARE_OPERATOR(TableFunctionLocalState)
882
DECLARE_OPERATOR(ExchangeLocalState)
883
DECLARE_OPERATOR(RepeatLocalState)
884
DECLARE_OPERATOR(NestedLoopJoinProbeLocalState)
885
DECLARE_OPERATOR(AssertNumRowsLocalState)
886
DECLARE_OPERATOR(EmptySetLocalState)
887
DECLARE_OPERATOR(UnionSourceLocalState)
888
DECLARE_OPERATOR(MultiCastDataStreamSourceLocalState)
889
DECLARE_OPERATOR(PartitionSortSourceLocalState)
890
DECLARE_OPERATOR(SetSourceLocalState<true>)
891
DECLARE_OPERATOR(SetSourceLocalState<false>)
892
DECLARE_OPERATOR(DataGenLocalState)
893
DECLARE_OPERATOR(SchemaScanLocalState)
894
DECLARE_OPERATOR(MetaScanLocalState)
895
DECLARE_OPERATOR(LocalExchangeSourceLocalState)
896
DECLARE_OPERATOR(PartitionedHashJoinProbeLocalState)
897
DECLARE_OPERATOR(CacheSourceLocalState)
898
DECLARE_OPERATOR(RecCTESourceLocalState)
899
DECLARE_OPERATOR(RecCTEScanLocalState)
900
901
#ifdef BE_TEST
902
DECLARE_OPERATOR(MockLocalState)
903
DECLARE_OPERATOR(MockScanLocalState)
904
#endif
905
#undef DECLARE_OPERATOR
906
907
template class StreamingOperatorX<AssertNumRowsLocalState>;
908
template class StreamingOperatorX<SelectLocalState>;
909
910
template class StatefulOperatorX<HashJoinProbeLocalState>;
911
template class StatefulOperatorX<PartitionedHashJoinProbeLocalState>;
912
template class StatefulOperatorX<RepeatLocalState>;
913
template class StatefulOperatorX<MaterializationLocalState>;
914
template class StatefulOperatorX<StreamingAggLocalState>;
915
template class StatefulOperatorX<DistinctStreamingAggLocalState>;
916
template class StatefulOperatorX<NestedLoopJoinProbeLocalState>;
917
template class StatefulOperatorX<TableFunctionLocalState>;
918
919
template class PipelineXSinkLocalState<HashJoinSharedState>;
920
template class PipelineXSinkLocalState<PartitionedHashJoinSharedState>;
921
template class PipelineXSinkLocalState<SortSharedState>;
922
template class PipelineXSinkLocalState<SpillSortSharedState>;
923
template class PipelineXSinkLocalState<NestedLoopJoinSharedState>;
924
template class PipelineXSinkLocalState<AnalyticSharedState>;
925
template class PipelineXSinkLocalState<AggSharedState>;
926
template class PipelineXSinkLocalState<BucketedAggSharedState>;
927
template class PipelineXSinkLocalState<PartitionedAggSharedState>;
928
template class PipelineXSinkLocalState<FakeSharedState>;
929
template class PipelineXSinkLocalState<UnionSharedState>;
930
template class PipelineXSinkLocalState<PartitionSortNodeSharedState>;
931
template class PipelineXSinkLocalState<MultiCastSharedState>;
932
template class PipelineXSinkLocalState<SetSharedState>;
933
template class PipelineXSinkLocalState<LocalExchangeSharedState>;
934
template class PipelineXSinkLocalState<BasicSharedState>;
935
template class PipelineXSinkLocalState<DataQueueSharedState>;
936
template class PipelineXSinkLocalState<RecCTESharedState>;
937
938
template class PipelineXLocalState<HashJoinSharedState>;
939
template class PipelineXLocalState<PartitionedHashJoinSharedState>;
940
template class PipelineXLocalState<SortSharedState>;
941
template class PipelineXLocalState<SpillSortSharedState>;
942
template class PipelineXLocalState<NestedLoopJoinSharedState>;
943
template class PipelineXLocalState<AnalyticSharedState>;
944
template class PipelineXLocalState<AggSharedState>;
945
template class PipelineXLocalState<BucketedAggSharedState>;
946
template class PipelineXLocalState<PartitionedAggSharedState>;
947
template class PipelineXLocalState<FakeSharedState>;
948
template class PipelineXLocalState<UnionSharedState>;
949
template class PipelineXLocalState<DataQueueSharedState>;
950
template class PipelineXLocalState<MultiCastSharedState>;
951
template class PipelineXLocalState<PartitionSortNodeSharedState>;
952
template class PipelineXLocalState<SetSharedState>;
953
template class PipelineXLocalState<LocalExchangeSharedState>;
954
template class PipelineXLocalState<BasicSharedState>;
955
template class PipelineXLocalState<RecCTESharedState>;
956
957
template class AsyncWriterSink<doris::VFileResultWriter, ResultFileSinkOperatorX>;
958
template class AsyncWriterSink<doris::VJdbcTableWriter, JdbcTableSinkOperatorX>;
959
template class AsyncWriterSink<doris::VTabletWriter, OlapTableSinkOperatorX>;
960
template class AsyncWriterSink<doris::VTabletWriterV2, OlapTableSinkV2OperatorX>;
961
template class AsyncWriterSink<doris::VHiveTableWriter, HiveTableSinkOperatorX>;
962
template class AsyncWriterSink<doris::VIcebergTableWriter, IcebergTableSinkOperatorX>;
963
template class AsyncWriterSink<doris::VIcebergTableWriter, SpillIcebergTableSinkOperatorX>;
964
template class AsyncWriterSink<doris::VIcebergDeleteSink, IcebergDeleteSinkOperatorX>;
965
template class AsyncWriterSink<doris::VIcebergMergeSink, IcebergMergeSinkOperatorX>;
966
template class AsyncWriterSink<doris::VMCTableWriter, MCTableSinkOperatorX>;
967
template class AsyncWriterSink<doris::VTVFTableWriter, TVFTableSinkOperatorX>;
968
969
#ifdef BE_TEST
970
template class OperatorX<DummyOperatorLocalState>;
971
template class DataSinkOperatorX<DummySinkLocalState>;
972
#endif
973
974
} // namespace doris