Coverage Report

Created: 2026-07-16 17:57

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