Coverage Report

Created: 2026-03-31 07:01

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 "common/status.h"
21
#include "exec/common/util.hpp"
22
#include "exec/exchange/local_exchange_sink_operator.h"
23
#include "exec/exchange/local_exchange_source_operator.h"
24
#include "exec/operator/aggregation_sink_operator.h"
25
#include "exec/operator/aggregation_source_operator.h"
26
#include "exec/operator/analytic_sink_operator.h"
27
#include "exec/operator/analytic_source_operator.h"
28
#include "exec/operator/assert_num_rows_operator.h"
29
#include "exec/operator/blackhole_sink_operator.h"
30
#include "exec/operator/cache_sink_operator.h"
31
#include "exec/operator/cache_source_operator.h"
32
#include "exec/operator/datagen_operator.h"
33
#include "exec/operator/dict_sink_operator.h"
34
#include "exec/operator/distinct_streaming_aggregation_operator.h"
35
#include "exec/operator/empty_set_operator.h"
36
#include "exec/operator/es_scan_operator.h"
37
#include "exec/operator/exchange_sink_operator.h"
38
#include "exec/operator/exchange_source_operator.h"
39
#include "exec/operator/file_scan_operator.h"
40
#include "exec/operator/group_commit_block_sink_operator.h"
41
#include "exec/operator/group_commit_scan_operator.h"
42
#include "exec/operator/hashjoin_build_sink.h"
43
#include "exec/operator/hashjoin_probe_operator.h"
44
#include "exec/operator/hive_table_sink_operator.h"
45
#include "exec/operator/iceberg_delete_sink_operator.h"
46
#include "exec/operator/iceberg_merge_sink_operator.h"
47
#include "exec/operator/iceberg_table_sink_operator.h"
48
#include "exec/operator/jdbc_scan_operator.h"
49
#include "exec/operator/jdbc_table_sink_operator.h"
50
#include "exec/operator/local_merge_sort_source_operator.h"
51
#include "exec/operator/materialization_opertor.h"
52
#include "exec/operator/maxcompute_table_sink_operator.h"
53
#include "exec/operator/memory_scratch_sink_operator.h"
54
#include "exec/operator/meta_scan_operator.h"
55
#include "exec/operator/mock_operator.h"
56
#include "exec/operator/mock_scan_operator.h"
57
#include "exec/operator/multi_cast_data_stream_sink.h"
58
#include "exec/operator/multi_cast_data_stream_source.h"
59
#include "exec/operator/nested_loop_join_build_operator.h"
60
#include "exec/operator/nested_loop_join_probe_operator.h"
61
#include "exec/operator/olap_scan_operator.h"
62
#include "exec/operator/olap_table_sink_operator.h"
63
#include "exec/operator/olap_table_sink_v2_operator.h"
64
#include "exec/operator/partition_sort_sink_operator.h"
65
#include "exec/operator/partition_sort_source_operator.h"
66
#include "exec/operator/partitioned_aggregation_sink_operator.h"
67
#include "exec/operator/partitioned_aggregation_source_operator.h"
68
#include "exec/operator/partitioned_hash_join_probe_operator.h"
69
#include "exec/operator/partitioned_hash_join_sink_operator.h"
70
#include "exec/operator/rec_cte_anchor_sink_operator.h"
71
#include "exec/operator/rec_cte_scan_operator.h"
72
#include "exec/operator/rec_cte_sink_operator.h"
73
#include "exec/operator/rec_cte_source_operator.h"
74
#include "exec/operator/repeat_operator.h"
75
#include "exec/operator/result_file_sink_operator.h"
76
#include "exec/operator/result_sink_operator.h"
77
#include "exec/operator/schema_scan_operator.h"
78
#include "exec/operator/select_operator.h"
79
#include "exec/operator/set_probe_sink_operator.h"
80
#include "exec/operator/set_sink_operator.h"
81
#include "exec/operator/set_source_operator.h"
82
#include "exec/operator/sort_sink_operator.h"
83
#include "exec/operator/sort_source_operator.h"
84
#include "exec/operator/spill_iceberg_table_sink_operator.h"
85
#include "exec/operator/spill_sort_sink_operator.h"
86
#include "exec/operator/spill_sort_source_operator.h"
87
#include "exec/operator/streaming_aggregation_operator.h"
88
#include "exec/operator/table_function_operator.h"
89
#include "exec/operator/tvf_table_sink_operator.h"
90
#include "exec/operator/union_sink_operator.h"
91
#include "exec/operator/union_source_operator.h"
92
#include "exec/pipeline/dependency.h"
93
#include "exec/pipeline/pipeline.h"
94
#include "exprs/vexpr.h"
95
#include "exprs/vexpr_context.h"
96
#include "runtime/runtime_profile.h"
97
#include "runtime/runtime_profile_counter_names.h"
98
#include "util/debug_util.h"
99
#include "util/string_util.h"
100
101
namespace doris {
102
#include "common/compile_check_begin.h"
103
class RowDescriptor;
104
class RuntimeState;
105
} // namespace doris
106
107
namespace doris {
108
109
0
Status OperatorBase::close(RuntimeState* state) {
110
0
    if (_is_closed) {
111
0
        return Status::OK();
112
0
    }
113
0
    _is_closed = true;
114
0
    return Status::OK();
115
0
}
116
117
template <typename SharedStateArg>
118
2.21M
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
119
2.21M
    if (_parent->nereids_id() == -1) {
120
1.17M
        return fmt::format("(id={})", _parent->node_id());
121
1.17M
    } else {
122
1.04M
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
123
1.04M
    }
124
2.21M
}
_ZNK5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
118
103k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
119
103k
    if (_parent->nereids_id() == -1) {
120
0
        return fmt::format("(id={})", _parent->node_id());
121
103k
    } else {
122
103k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
123
103k
    }
124
103k
}
_ZNK5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
118
1
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
119
1
    if (_parent->nereids_id() == -1) {
120
1
        return fmt::format("(id={})", _parent->node_id());
121
1
    } else {
122
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
123
0
    }
124
1
}
_ZNK5doris19PipelineXLocalStateINS_15SortSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
118
193k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
119
193k
    if (_parent->nereids_id() == -1) {
120
12
        return fmt::format("(id={})", _parent->node_id());
121
193k
    } else {
122
193k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
123
193k
    }
124
193k
}
_ZNK5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
118
27
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
119
27
    if (_parent->nereids_id() == -1) {
120
0
        return fmt::format("(id={})", _parent->node_id());
121
27
    } else {
122
27
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
123
27
    }
124
27
}
_ZNK5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
118
10.2k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
119
10.2k
    if (_parent->nereids_id() == -1) {
120
0
        return fmt::format("(id={})", _parent->node_id());
121
10.2k
    } else {
122
10.2k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
123
10.2k
    }
124
10.2k
}
_ZNK5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
118
7.52k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
119
7.52k
    if (_parent->nereids_id() == -1) {
120
9
        return fmt::format("(id={})", _parent->node_id());
121
7.52k
    } else {
122
7.52k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
123
7.52k
    }
124
7.52k
}
_ZNK5doris19PipelineXLocalStateINS_14AggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
118
111k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
119
111k
    if (_parent->nereids_id() == -1) {
120
27
        return fmt::format("(id={})", _parent->node_id());
121
111k
    } else {
122
111k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
123
111k
    }
124
111k
}
_ZNK5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
118
1.52k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
119
1.52k
    if (_parent->nereids_id() == -1) {
120
0
        return fmt::format("(id={})", _parent->node_id());
121
1.52k
    } else {
122
1.52k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
123
1.52k
    }
124
1.52k
}
_ZNK5doris19PipelineXLocalStateINS_15FakeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
118
976k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
119
976k
    if (_parent->nereids_id() == -1) {
120
417k
        return fmt::format("(id={})", _parent->node_id());
121
559k
    } else {
122
559k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
123
559k
    }
124
976k
}
_ZNK5doris19PipelineXLocalStateINS_16UnionSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
118
51.6k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
119
51.6k
    if (_parent->nereids_id() == -1) {
120
2
        return fmt::format("(id={})", _parent->node_id());
121
51.6k
    } else {
122
51.6k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
123
51.6k
    }
124
51.6k
}
_ZNK5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
118
111
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
119
111
    if (_parent->nereids_id() == -1) {
120
111
        return fmt::format("(id={})", _parent->node_id());
121
111
    } else {
122
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
123
0
    }
124
111
}
_ZNK5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
118
9.60k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
119
9.60k
    if (_parent->nereids_id() == -1) {
120
9.60k
        return fmt::format("(id={})", _parent->node_id());
121
9.60k
    } else {
122
2
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
123
2
    }
124
9.60k
}
_ZNK5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
118
354
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
119
354
    if (_parent->nereids_id() == -1) {
120
102
        return fmt::format("(id={})", _parent->node_id());
121
252
    } else {
122
252
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
123
252
    }
124
354
}
_ZNK5doris19PipelineXLocalStateINS_14SetSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
118
4.81k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
119
4.81k
    if (_parent->nereids_id() == -1) {
120
12
        return fmt::format("(id={})", _parent->node_id());
121
4.80k
    } else {
122
4.80k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
123
4.80k
    }
124
4.81k
}
_ZNK5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
118
746k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
119
746k
    if (_parent->nereids_id() == -1) {
120
745k
        return fmt::format("(id={})", _parent->node_id());
121
745k
    } else {
122
265
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
123
265
    }
124
746k
}
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_16BasicSharedStateEE11name_suffixB5cxx11Ev
_ZNK5doris19PipelineXLocalStateINS_17RecCTESharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
118
151
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
119
151
    if (_parent->nereids_id() == -1) {
120
0
        return fmt::format("(id={})", _parent->node_id());
121
151
    } else {
122
151
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
123
151
    }
124
151
}
125
126
template <typename SharedStateArg>
127
1.28M
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
128
1.28M
    if (_parent->nereids_id() == -1) {
129
794k
        return fmt::format("(id={})", _parent->node_id());
130
794k
    } else {
131
490k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
132
490k
    }
133
1.28M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
127
154k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
128
154k
    if (_parent->nereids_id() == -1) {
129
0
        return fmt::format("(id={})", _parent->node_id());
130
154k
    } else {
131
154k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
132
154k
    }
133
154k
}
_ZN5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
127
2
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
128
2
    if (_parent->nereids_id() == -1) {
129
1
        return fmt::format("(id={})", _parent->node_id());
130
1
    } else {
131
1
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
132
1
    }
133
2
}
_ZN5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
127
195k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
128
195k
    if (_parent->nereids_id() == -1) {
129
9
        return fmt::format("(id={})", _parent->node_id());
130
195k
    } else {
131
195k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
132
195k
    }
133
195k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
127
33
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
128
33
    if (_parent->nereids_id() == -1) {
129
0
        return fmt::format("(id={})", _parent->node_id());
130
33
    } else {
131
33
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
132
33
    }
133
33
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
127
10.3k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
128
10.3k
    if (_parent->nereids_id() == -1) {
129
0
        return fmt::format("(id={})", _parent->node_id());
130
10.3k
    } else {
131
10.3k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
132
10.3k
    }
133
10.3k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
127
7.58k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
128
7.58k
    if (_parent->nereids_id() == -1) {
129
9
        return fmt::format("(id={})", _parent->node_id());
130
7.57k
    } else {
131
7.57k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
132
7.57k
    }
133
7.58k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
127
112k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
128
112k
    if (_parent->nereids_id() == -1) {
129
27
        return fmt::format("(id={})", _parent->node_id());
130
112k
    } else {
131
112k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
132
112k
    }
133
112k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
127
1.53k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
128
1.53k
    if (_parent->nereids_id() == -1) {
129
0
        return fmt::format("(id={})", _parent->node_id());
130
1.53k
    } else {
131
1.53k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
132
1.53k
    }
133
1.53k
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
127
24
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
128
24
    if (_parent->nereids_id() == -1) {
129
24
        return fmt::format("(id={})", _parent->node_id());
130
24
    } else {
131
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
132
0
    }
133
24
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
127
9.62k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
128
9.62k
    if (_parent->nereids_id() == -1) {
129
3
        return fmt::format("(id={})", _parent->node_id());
130
9.61k
    } else {
131
9.61k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
132
9.61k
    }
133
9.62k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
127
356
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
128
356
    if (_parent->nereids_id() == -1) {
129
102
        return fmt::format("(id={})", _parent->node_id());
130
254
    } else {
131
254
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
132
254
    }
133
356
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE11name_suffixB5cxx11Ev
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
127
11.9k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
128
11.9k
    if (_parent->nereids_id() == -1) {
129
11.9k
        return fmt::format("(id={})", _parent->node_id());
130
18.4E
    } else {
131
18.4E
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
132
18.4E
    }
133
11.9k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
127
325k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
128
325k
    if (_parent->nereids_id() == -1) {
129
325k
        return fmt::format("(id={})", _parent->node_id());
130
18.4E
    } else {
131
18.4E
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
132
18.4E
    }
133
325k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
127
456k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
128
457k
    if (_parent->nereids_id() == -1) {
129
457k
        return fmt::format("(id={})", _parent->node_id());
130
18.4E
    } else {
131
18.4E
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
132
18.4E
    }
133
456k
}
_ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
127
111
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
128
111
    if (_parent->nereids_id() == -1) {
129
111
        return fmt::format("(id={})", _parent->node_id());
130
111
    } else {
131
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
132
0
    }
133
111
}
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
127
302
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
128
302
    if (_parent->nereids_id() == -1) {
129
0
        return fmt::format("(id={})", _parent->node_id());
130
302
    } else {
131
302
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
132
302
    }
133
302
}
134
135
template <typename SharedStateArg>
136
29.3k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
137
29.3k
    if (_terminated) {
138
1
        return Status::OK();
139
1
    }
140
29.3k
    _terminated = true;
141
29.3k
    return Status::OK();
142
29.3k
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
136
24.0k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
137
24.0k
    if (_terminated) {
138
0
        return Status::OK();
139
0
    }
140
24.0k
    _terminated = true;
141
24.0k
    return Status::OK();
142
24.0k
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
136
701
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
137
701
    if (_terminated) {
138
0
        return Status::OK();
139
0
    }
140
701
    _terminated = true;
141
701
    return Status::OK();
142
701
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
136
1
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
137
1
    if (_terminated) {
138
0
        return Status::OK();
139
0
    }
140
1
    _terminated = true;
141
1
    return Status::OK();
142
1
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
136
2.68k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
137
2.68k
    if (_terminated) {
138
0
        return Status::OK();
139
0
    }
140
2.68k
    _terminated = true;
141
2.68k
    return Status::OK();
142
2.68k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
136
2
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
137
2
    if (_terminated) {
138
0
        return Status::OK();
139
0
    }
140
2
    _terminated = true;
141
2
    return Status::OK();
142
2
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
136
1.29k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
137
1.29k
    if (_terminated) {
138
1
        return Status::OK();
139
1
    }
140
1.29k
    _terminated = true;
141
1.29k
    return Status::OK();
142
1.29k
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
136
7
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
137
7
    if (_terminated) {
138
0
        return Status::OK();
139
0
    }
140
7
    _terminated = true;
141
7
    return Status::OK();
142
7
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
136
1
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
137
1
    if (_terminated) {
138
0
        return Status::OK();
139
0
    }
140
1
    _terminated = true;
141
1
    return Status::OK();
142
1
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
136
54
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
137
54
    if (_terminated) {
138
0
        return Status::OK();
139
0
    }
140
54
    _terminated = true;
141
54
    return Status::OK();
142
54
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
136
1
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
137
1
    if (_terminated) {
138
0
        return Status::OK();
139
0
    }
140
1
    _terminated = true;
141
1
    return Status::OK();
142
1
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
136
359
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
137
359
    if (_terminated) {
138
0
        return Status::OK();
139
0
    }
140
359
    _terminated = true;
141
359
    return Status::OK();
142
359
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
136
142
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
137
142
    if (_terminated) {
138
0
        return Status::OK();
139
0
    }
140
142
    _terminated = true;
141
142
    return Status::OK();
142
142
}
143
144
652k
DataDistribution OperatorBase::required_data_distribution(RuntimeState* /*state*/) const {
145
652k
    return _child && _child->is_serial_operator() && !is_source()
146
652k
                   ? DataDistribution(ExchangeType::PASSTHROUGH)
147
652k
                   : DataDistribution(ExchangeType::NOOP);
148
652k
}
149
150
79.2k
const RowDescriptor& OperatorBase::row_desc() const {
151
79.2k
    return _child->row_desc();
152
79.2k
}
153
154
template <typename SharedStateArg>
155
57.4k
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
156
57.4k
    fmt::memory_buffer debug_string_buffer;
157
57.4k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
158
57.4k
    return fmt::to_string(debug_string_buffer);
159
57.4k
}
_ZNK5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
155
78
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
156
78
    fmt::memory_buffer debug_string_buffer;
157
78
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
158
78
    return fmt::to_string(debug_string_buffer);
159
78
}
_ZNK5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
155
3
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
156
3
    fmt::memory_buffer debug_string_buffer;
157
3
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
158
3
    return fmt::to_string(debug_string_buffer);
159
3
}
_ZNK5doris19PipelineXLocalStateINS_15SortSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
155
26
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
156
26
    fmt::memory_buffer debug_string_buffer;
157
26
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
158
26
    return fmt::to_string(debug_string_buffer);
159
26
}
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE12debug_stringB5cxx11Ei
_ZNK5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
155
15
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
156
15
    fmt::memory_buffer debug_string_buffer;
157
15
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
158
15
    return fmt::to_string(debug_string_buffer);
159
15
}
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE12debug_stringB5cxx11Ei
_ZNK5doris19PipelineXLocalStateINS_14AggSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
155
79
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
156
79
    fmt::memory_buffer debug_string_buffer;
157
79
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
158
79
    return fmt::to_string(debug_string_buffer);
159
79
}
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE12debug_stringB5cxx11Ei
_ZNK5doris19PipelineXLocalStateINS_15FakeSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
155
55.2k
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
156
55.2k
    fmt::memory_buffer debug_string_buffer;
157
55.2k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
158
55.2k
    return fmt::to_string(debug_string_buffer);
159
55.2k
}
_ZNK5doris19PipelineXLocalStateINS_16UnionSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
155
1
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
156
1
    fmt::memory_buffer debug_string_buffer;
157
1
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
158
1
    return fmt::to_string(debug_string_buffer);
159
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
155
1.94k
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
156
1.94k
    fmt::memory_buffer debug_string_buffer;
157
1.94k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
158
1.94k
    return fmt::to_string(debug_string_buffer);
159
1.94k
}
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_16BasicSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_17RecCTESharedStateEE12debug_stringB5cxx11Ei
160
161
template <typename SharedStateArg>
162
57.3k
std::string PipelineXSinkLocalState<SharedStateArg>::debug_string(int indentation_level) const {
163
57.3k
    fmt::memory_buffer debug_string_buffer;
164
57.3k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
165
57.3k
    return fmt::to_string(debug_string_buffer);
166
57.3k
}
_ZNK5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
162
18
std::string PipelineXSinkLocalState<SharedStateArg>::debug_string(int indentation_level) const {
163
18
    fmt::memory_buffer debug_string_buffer;
164
18
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
165
18
    return fmt::to_string(debug_string_buffer);
166
18
}
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE12debug_stringB5cxx11Ei
_ZNK5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
162
26
std::string PipelineXSinkLocalState<SharedStateArg>::debug_string(int indentation_level) const {
163
26
    fmt::memory_buffer debug_string_buffer;
164
26
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
165
26
    return fmt::to_string(debug_string_buffer);
166
26
}
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE12debug_stringB5cxx11Ei
_ZNK5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
162
78
std::string PipelineXSinkLocalState<SharedStateArg>::debug_string(int indentation_level) const {
163
78
    fmt::memory_buffer debug_string_buffer;
164
78
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
165
78
    return fmt::to_string(debug_string_buffer);
166
78
}
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE12debug_stringB5cxx11Ei
_ZNK5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
162
1.81k
std::string PipelineXSinkLocalState<SharedStateArg>::debug_string(int indentation_level) const {
163
1.81k
    fmt::memory_buffer debug_string_buffer;
164
1.81k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
165
1.81k
    return fmt::to_string(debug_string_buffer);
166
1.81k
}
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
162
135
std::string PipelineXSinkLocalState<SharedStateArg>::debug_string(int indentation_level) const {
163
135
    fmt::memory_buffer debug_string_buffer;
164
135
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
165
135
    return fmt::to_string(debug_string_buffer);
166
135
}
_ZNK5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
162
55.2k
std::string PipelineXSinkLocalState<SharedStateArg>::debug_string(int indentation_level) const {
163
55.2k
    fmt::memory_buffer debug_string_buffer;
164
55.2k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
165
55.2k
    return fmt::to_string(debug_string_buffer);
166
55.2k
}
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE12debug_stringB5cxx11Ei
167
168
58.3k
std::string OperatorXBase::debug_string(int indentation_level) const {
169
58.3k
    fmt::memory_buffer debug_string_buffer;
170
58.3k
    fmt::format_to(debug_string_buffer, "{}{}: id={}, parallel_tasks={}, _is_serial_operator={}",
171
58.3k
                   std::string(indentation_level * 2, ' '), _op_name, node_id(), _parallel_tasks,
172
58.3k
                   _is_serial_operator);
173
58.3k
    return fmt::to_string(debug_string_buffer);
174
58.3k
}
175
176
57.4k
std::string OperatorXBase::debug_string(RuntimeState* state, int indentation_level) const {
177
57.4k
    return state->get_local_state(operator_id())->debug_string(indentation_level);
178
57.4k
}
179
180
575k
Status OperatorXBase::init(const TPlanNode& tnode, RuntimeState* state) {
181
575k
    std::string node_name = print_plan_node_type(tnode.node_type);
182
575k
    _nereids_id = tnode.nereids_id;
183
575k
    if (!tnode.intermediate_output_tuple_id_list.empty()) {
184
2.89k
        if (!tnode.__isset.output_tuple_id) {
185
0
            return Status::InternalError("no final output tuple id");
186
0
        }
187
2.89k
        if (tnode.intermediate_output_tuple_id_list.size() !=
188
2.89k
            tnode.intermediate_projections_list.size()) {
189
0
            return Status::InternalError(
190
0
                    "intermediate_output_tuple_id_list size:{} not match "
191
0
                    "intermediate_projections_list size:{}",
192
0
                    tnode.intermediate_output_tuple_id_list.size(),
193
0
                    tnode.intermediate_projections_list.size());
194
0
        }
195
2.89k
    }
196
575k
    auto substr = node_name.substr(0, node_name.find("_NODE"));
197
575k
    _op_name = substr + "_OPERATOR";
198
199
575k
    if (tnode.__isset.vconjunct) {
200
0
        return Status::InternalError("vconjunct is not supported yet");
201
575k
    } else if (tnode.__isset.conjuncts) {
202
265k
        for (const auto& conjunct : tnode.conjuncts) {
203
265k
            VExprContextSPtr context;
204
265k
            RETURN_IF_ERROR(VExpr::create_expr_tree(conjunct, context));
205
265k
            _conjuncts.emplace_back(context);
206
265k
        }
207
90.0k
    }
208
209
    // create the projections expr
210
575k
    if (tnode.__isset.projections) {
211
242k
        DCHECK(tnode.__isset.output_tuple_id);
212
242k
        RETURN_IF_ERROR(VExpr::create_expr_trees(tnode.projections, _projections));
213
242k
    }
214
575k
    if (!tnode.intermediate_projections_list.empty()) {
215
2.89k
        DCHECK(tnode.__isset.projections) << "no final projections";
216
2.89k
        _intermediate_projections.reserve(tnode.intermediate_projections_list.size());
217
3.78k
        for (const auto& tnode_projections : tnode.intermediate_projections_list) {
218
3.78k
            VExprContextSPtrs projections;
219
3.78k
            RETURN_IF_ERROR(VExpr::create_expr_trees(tnode_projections, projections));
220
3.78k
            _intermediate_projections.push_back(projections);
221
3.78k
        }
222
2.89k
    }
223
575k
    return Status::OK();
224
575k
}
225
226
605k
Status OperatorXBase::prepare(RuntimeState* state) {
227
605k
    for (auto& conjunct : _conjuncts) {
228
264k
        RETURN_IF_ERROR(conjunct->prepare(state, intermediate_row_desc()));
229
264k
    }
230
605k
    if (state->enable_adjust_conjunct_order_by_cost()) {
231
556k
        std::ranges::sort(_conjuncts, [](const auto& a, const auto& b) {
232
349k
            return a->execute_cost() < b->execute_cost();
233
349k
        });
234
556k
    };
235
236
609k
    for (int i = 0; i < _intermediate_projections.size(); i++) {
237
3.78k
        RETURN_IF_ERROR(
238
3.78k
                VExpr::prepare(_intermediate_projections[i], state, intermediate_row_desc(i)));
239
3.78k
    }
240
605k
    RETURN_IF_ERROR(VExpr::prepare(_projections, state, projections_row_desc()));
241
242
605k
    if (has_output_row_desc()) {
243
242k
        RETURN_IF_ERROR(VExpr::check_expr_output_type(_projections, *_output_row_descriptor));
244
242k
    }
245
246
605k
    for (auto& conjunct : _conjuncts) {
247
264k
        RETURN_IF_ERROR(conjunct->open(state));
248
264k
    }
249
605k
    RETURN_IF_ERROR(VExpr::open(_projections, state));
250
605k
    for (auto& projections : _intermediate_projections) {
251
3.78k
        RETURN_IF_ERROR(VExpr::open(projections, state));
252
3.78k
    }
253
605k
    if (_child && !is_source()) {
254
132k
        RETURN_IF_ERROR(_child->prepare(state));
255
132k
    }
256
257
605k
    if (VExpr::contains_blockable_function(_conjuncts) ||
258
605k
        VExpr::contains_blockable_function(_projections)) {
259
0
        _blockable = true;
260
0
    }
261
262
605k
    return Status::OK();
263
605k
}
264
265
6.39k
Status OperatorXBase::terminate(RuntimeState* state) {
266
6.39k
    if (_child && !is_source()) {
267
1.09k
        RETURN_IF_ERROR(_child->terminate(state));
268
1.09k
    }
269
6.39k
    auto result = state->get_local_state_result(operator_id());
270
6.39k
    if (!result) {
271
0
        return result.error();
272
0
    }
273
6.39k
    return result.value()->terminate(state);
274
6.39k
}
275
276
6.33M
Status OperatorXBase::close(RuntimeState* state) {
277
6.33M
    if (_child && !is_source()) {
278
1.36M
        RETURN_IF_ERROR(_child->close(state));
279
1.36M
    }
280
6.33M
    auto result = state->get_local_state_result(operator_id());
281
6.33M
    if (!result) {
282
0
        return result.error();
283
0
    }
284
6.33M
    return result.value()->close(state);
285
6.33M
}
286
287
27.7M
void PipelineXLocalStateBase::clear_origin_block() {
288
27.7M
    _origin_block.clear_column_data(_parent->intermediate_row_desc().num_materialized_slots());
289
27.7M
}
290
291
28.1M
Status PipelineXLocalStateBase::filter_block(const VExprContextSPtrs& expr_contexts, Block* block) {
292
28.1M
    RETURN_IF_ERROR(VExprContext::filter_block(expr_contexts, block, block->columns()));
293
294
28.1M
    _estimate_memory_usage += VExprContext::get_memory_usage(expr_contexts);
295
28.1M
    return Status::OK();
296
28.1M
}
297
298
0
bool PipelineXLocalStateBase::is_blockable() const {
299
0
    return std::any_of(_projections.begin(), _projections.end(),
300
0
                       [&](VExprContextSPtr expr) -> bool { return expr->is_blockable(); });
301
0
}
302
303
Status OperatorXBase::do_projections(RuntimeState* state, Block* origin_block,
304
27.7M
                                     Block* output_block) const {
305
27.7M
    auto* local_state = state->get_local_state(operator_id());
306
27.7M
    SCOPED_TIMER(local_state->exec_time_counter());
307
27.7M
    SCOPED_TIMER(local_state->_projection_timer);
308
27.7M
    const size_t rows = origin_block->rows();
309
27.7M
    if (rows == 0) {
310
27.6M
        return Status::OK();
311
27.6M
    }
312
117k
    Block input_block = *origin_block;
313
314
117k
    size_t bytes_usage = 0;
315
117k
    ColumnsWithTypeAndName new_columns;
316
117k
    for (const auto& projections : local_state->_intermediate_projections) {
317
1.00k
        if (projections.empty()) {
318
0
            return Status::InternalError("meet empty intermediate projection, node id: {}",
319
0
                                         node_id());
320
0
        }
321
1.00k
        new_columns.resize(projections.size());
322
6.57k
        for (int i = 0; i < projections.size(); i++) {
323
5.56k
            RETURN_IF_ERROR(projections[i]->execute(&input_block, new_columns[i]));
324
5.56k
            if (new_columns[i].column->size() != rows) {
325
0
                return Status::InternalError(
326
0
                        "intermediate projection result column size {} not equal input rows {}, "
327
0
                        "expr: {}",
328
0
                        new_columns[i].column->size(), rows,
329
0
                        projections[i]->root()->debug_string());
330
0
            }
331
5.56k
        }
332
1.00k
        Block tmp_block {new_columns};
333
1.00k
        bytes_usage += tmp_block.allocated_bytes();
334
1.00k
        input_block.swap(tmp_block);
335
1.00k
    }
336
337
117k
    if (input_block.rows() != rows) {
338
0
        return Status::InternalError(
339
0
                "after intermediate projections input block rows {} not equal origin rows {}, "
340
0
                "input_block: {}",
341
0
                input_block.rows(), rows, input_block.dump_structure());
342
0
    }
343
586k
    auto insert_column_datas = [&](auto& to, ColumnPtr& from, size_t rows) {
344
586k
        if (to->is_nullable() && !from->is_nullable()) {
345
0
            if (_keep_origin || !from->is_exclusive()) {
346
0
                auto& null_column = reinterpret_cast<ColumnNullable&>(*to);
347
0
                null_column.get_nested_column().insert_range_from(*from, 0, rows);
348
0
                null_column.get_null_map_column().get_data().resize_fill(rows, 0);
349
0
                bytes_usage += null_column.allocated_bytes();
350
0
            } else {
351
0
                to = make_nullable(from, false)->assume_mutable();
352
0
            }
353
586k
        } else {
354
586k
            if (_keep_origin || !from->is_exclusive()) {
355
577k
                to->insert_range_from(*from, 0, rows);
356
577k
                bytes_usage += from->allocated_bytes();
357
577k
            } else {
358
8.92k
                to = from->assume_mutable();
359
8.92k
            }
360
586k
        }
361
586k
    };
362
363
117k
    MutableBlock mutable_block =
364
117k
            VectorizedUtils::build_mutable_mem_reuse_block(output_block, *_output_row_descriptor);
365
117k
    if (rows != 0) {
366
117k
        auto& mutable_columns = mutable_block.mutable_columns();
367
117k
        const size_t origin_columns_count = input_block.columns();
368
117k
        DCHECK_EQ(mutable_columns.size(), local_state->_projections.size()) << debug_string();
369
703k
        for (int i = 0; i < mutable_columns.size(); ++i) {
370
586k
            auto result_column_id = -1;
371
586k
            ColumnPtr column_ptr;
372
586k
            RETURN_IF_ERROR(local_state->_projections[i]->execute(&input_block, column_ptr));
373
586k
            if (column_ptr->size() != rows) {
374
0
                return Status::InternalError(
375
0
                        "projection result column size {} not equal input rows {}, expr: {}",
376
0
                        column_ptr->size(), rows,
377
0
                        local_state->_projections[i]->root()->debug_string());
378
0
            }
379
586k
            column_ptr = column_ptr->convert_to_full_column_if_const();
380
586k
            if (result_column_id >= origin_columns_count) {
381
586k
                bytes_usage += column_ptr->allocated_bytes();
382
586k
            }
383
586k
            insert_column_datas(mutable_columns[i], column_ptr, rows);
384
586k
        }
385
117k
        DCHECK(mutable_block.rows() == rows);
386
117k
        output_block->set_columns(std::move(mutable_columns));
387
117k
    }
388
389
117k
    local_state->_estimate_memory_usage += bytes_usage;
390
391
117k
    return Status::OK();
392
117k
}
393
394
31.5M
Status OperatorXBase::get_block_after_projects(RuntimeState* state, Block* block, bool* eos) {
395
31.5M
    DBUG_EXECUTE_IF("Pipeline::return_empty_block", {
396
31.5M
        if (this->_op_name == "AGGREGATION_OPERATOR" || this->_op_name == "HASH_JOIN_OPERATOR" ||
397
31.5M
            this->_op_name == "PARTITIONED_AGGREGATION_OPERATOR" ||
398
31.5M
            this->_op_name == "PARTITIONED_HASH_JOIN_OPERATOR" ||
399
31.5M
            this->_op_name == "CROSS_JOIN_OPERATOR" || this->_op_name == "SORT_OPERATOR") {
400
31.5M
            if (_debug_point_count++ % 2 == 0) {
401
31.5M
                return Status::OK();
402
31.5M
            }
403
31.5M
        }
404
31.5M
    });
405
406
31.5M
    Status status;
407
31.5M
    auto* local_state = state->get_local_state(operator_id());
408
31.5M
    Defer defer([&]() {
409
31.5M
        if (status.ok()) {
410
31.5M
            if (auto rows = block->rows()) {
411
783k
                COUNTER_UPDATE(local_state->_rows_returned_counter, rows);
412
783k
                COUNTER_UPDATE(local_state->_blocks_returned_counter, 1);
413
783k
            }
414
31.5M
        }
415
31.5M
    });
416
31.5M
    if (_output_row_descriptor) {
417
27.7M
        local_state->clear_origin_block();
418
27.7M
        status = get_block(state, &local_state->_origin_block, eos);
419
27.7M
        if (UNLIKELY(!status.ok())) {
420
18
            return status;
421
18
        }
422
27.7M
        status = do_projections(state, &local_state->_origin_block, block);
423
27.7M
        return status;
424
27.7M
    }
425
3.72M
    status = get_block(state, block, eos);
426
3.72M
    RETURN_IF_ERROR(block->check_type_and_column());
427
3.72M
    return status;
428
3.72M
}
429
430
29.9M
void PipelineXLocalStateBase::reached_limit(Block* block, bool* eos) {
431
29.9M
    if (_parent->_limit != -1 and _num_rows_returned + block->rows() >= _parent->_limit) {
432
3.96k
        block->set_num_rows(_parent->_limit - _num_rows_returned);
433
3.96k
        *eos = true;
434
3.96k
    }
435
436
29.9M
    DBUG_EXECUTE_IF("Pipeline::reached_limit_early", {
437
29.9M
        auto op_name = to_lower(_parent->_op_name);
438
29.9M
        auto arg_op_name = dp->param<std::string>("op_name");
439
29.9M
        arg_op_name = to_lower(arg_op_name);
440
441
29.9M
        if (op_name == arg_op_name) {
442
29.9M
            *eos = true;
443
29.9M
        }
444
29.9M
    });
445
446
29.9M
    if (auto rows = block->rows()) {
447
693k
        _num_rows_returned += rows;
448
693k
    }
449
29.9M
}
450
451
29.3k
Status DataSinkOperatorXBase::terminate(RuntimeState* state) {
452
29.3k
    auto result = state->get_sink_local_state_result();
453
29.3k
    if (!result) {
454
0
        return result.error();
455
0
    }
456
29.3k
    return result.value()->terminate(state);
457
29.3k
}
458
459
58.2k
std::string DataSinkOperatorXBase::debug_string(int indentation_level) const {
460
58.2k
    fmt::memory_buffer debug_string_buffer;
461
462
58.2k
    fmt::format_to(debug_string_buffer, "{}{}: id={}, _is_serial_operator={}",
463
58.2k
                   std::string(indentation_level * 2, ' '), _name, node_id(), _is_serial_operator);
464
58.2k
    return fmt::to_string(debug_string_buffer);
465
58.2k
}
466
467
57.3k
std::string DataSinkOperatorXBase::debug_string(RuntimeState* state, int indentation_level) const {
468
57.3k
    return state->get_sink_local_state()->debug_string(indentation_level);
469
57.3k
}
470
471
343k
Status DataSinkOperatorXBase::init(const TDataSink& tsink) {
472
343k
    std::string op_name = "UNKNOWN_SINK";
473
343k
    auto it = _TDataSinkType_VALUES_TO_NAMES.find(tsink.type);
474
475
343k
    if (it != _TDataSinkType_VALUES_TO_NAMES.end()) {
476
343k
        op_name = it->second;
477
343k
    }
478
343k
    _name = op_name + "_OPERATOR";
479
343k
    return Status::OK();
480
343k
}
481
482
174k
Status DataSinkOperatorXBase::init(const TPlanNode& tnode, RuntimeState* state) {
483
174k
    std::string op_name = print_plan_node_type(tnode.node_type);
484
174k
    _nereids_id = tnode.nereids_id;
485
174k
    auto substr = op_name.substr(0, op_name.find("_NODE"));
486
174k
    _name = substr + "_SINK_OPERATOR";
487
174k
    return Status::OK();
488
174k
}
489
490
template <typename LocalStateType>
491
Status DataSinkOperatorX<LocalStateType>::setup_local_state(RuntimeState* state,
492
1.90M
                                                            LocalSinkStateInfo& info) {
493
1.90M
    auto local_state = LocalStateType::create_unique(this, state);
494
1.90M
    RETURN_IF_ERROR(local_state->init(state, info));
495
1.90M
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
496
1.90M
    return Status::OK();
497
1.90M
}
_ZN5doris17DataSinkOperatorXINS_27HashJoinBuildSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
492
154k
                                                            LocalSinkStateInfo& info) {
493
154k
    auto local_state = LocalStateType::create_unique(this, state);
494
154k
    RETURN_IF_ERROR(local_state->init(state, info));
495
154k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
496
154k
    return Status::OK();
497
154k
}
_ZN5doris17DataSinkOperatorXINS_20ResultSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
492
406k
                                                            LocalSinkStateInfo& info) {
493
406k
    auto local_state = LocalStateType::create_unique(this, state);
494
406k
    RETURN_IF_ERROR(local_state->init(state, info));
495
406k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
496
406k
    return Status::OK();
497
406k
}
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_23JdbcTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
_ZN5doris17DataSinkOperatorXINS_27MemoryScratchSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
492
3
                                                            LocalSinkStateInfo& info) {
493
3
    auto local_state = LocalStateType::create_unique(this, state);
494
3
    RETURN_IF_ERROR(local_state->init(state, info));
495
3
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
496
3
    return Status::OK();
497
3
}
_ZN5doris17DataSinkOperatorXINS_24ResultFileSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
492
354
                                                            LocalSinkStateInfo& info) {
493
354
    auto local_state = LocalStateType::create_unique(this, state);
494
354
    RETURN_IF_ERROR(local_state->init(state, info));
495
354
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
496
354
    return Status::OK();
497
354
}
_ZN5doris17DataSinkOperatorXINS_23OlapTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
492
52.2k
                                                            LocalSinkStateInfo& info) {
493
52.2k
    auto local_state = LocalStateType::create_unique(this, state);
494
52.2k
    RETURN_IF_ERROR(local_state->init(state, info));
495
52.2k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
496
52.2k
    return Status::OK();
497
52.2k
}
_ZN5doris17DataSinkOperatorXINS_25OlapTableSinkV2LocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
492
338
                                                            LocalSinkStateInfo& info) {
493
338
    auto local_state = LocalStateType::create_unique(this, state);
494
338
    RETURN_IF_ERROR(local_state->init(state, info));
495
338
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
496
338
    return Status::OK();
497
338
}
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
492
7.59k
                                                            LocalSinkStateInfo& info) {
493
7.59k
    auto local_state = LocalStateType::create_unique(this, state);
494
7.59k
    RETURN_IF_ERROR(local_state->init(state, info));
495
7.59k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
496
7.59k
    return Status::OK();
497
7.59k
}
_ZN5doris17DataSinkOperatorXINS_23BlackholeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
492
21
                                                            LocalSinkStateInfo& info) {
493
21
    auto local_state = LocalStateType::create_unique(this, state);
494
21
    RETURN_IF_ERROR(local_state->init(state, info));
495
21
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
496
21
    return Status::OK();
497
21
}
_ZN5doris17DataSinkOperatorXINS_18SortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
492
196k
                                                            LocalSinkStateInfo& info) {
493
196k
    auto local_state = LocalStateType::create_unique(this, state);
494
196k
    RETURN_IF_ERROR(local_state->init(state, info));
495
196k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
496
196k
    return Status::OK();
497
196k
}
_ZN5doris17DataSinkOperatorXINS_23SpillSortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
492
33
                                                            LocalSinkStateInfo& info) {
493
33
    auto local_state = LocalStateType::create_unique(this, state);
494
33
    RETURN_IF_ERROR(local_state->init(state, info));
495
33
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
496
33
    return Status::OK();
497
33
}
_ZN5doris17DataSinkOperatorXINS_27LocalExchangeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
492
325k
                                                            LocalSinkStateInfo& info) {
493
325k
    auto local_state = LocalStateType::create_unique(this, state);
494
325k
    RETURN_IF_ERROR(local_state->init(state, info));
495
325k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
496
325k
    return Status::OK();
497
325k
}
_ZN5doris17DataSinkOperatorXINS_17AggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
492
112k
                                                            LocalSinkStateInfo& info) {
493
112k
    auto local_state = LocalStateType::create_unique(this, state);
494
112k
    RETURN_IF_ERROR(local_state->init(state, info));
495
112k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
496
112k
    return Status::OK();
497
112k
}
_ZN5doris17DataSinkOperatorXINS_28PartitionedAggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
492
1.53k
                                                            LocalSinkStateInfo& info) {
493
1.53k
    auto local_state = LocalStateType::create_unique(this, state);
494
1.53k
    RETURN_IF_ERROR(local_state->init(state, info));
495
1.53k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
496
1.53k
    return Status::OK();
497
1.53k
}
_ZN5doris17DataSinkOperatorXINS_22ExchangeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
492
615k
                                                            LocalSinkStateInfo& info) {
493
615k
    auto local_state = LocalStateType::create_unique(this, state);
494
615k
    RETURN_IF_ERROR(local_state->init(state, info));
495
615k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
496
615k
    return Status::OK();
497
615k
}
_ZN5doris17DataSinkOperatorXINS_33NestedLoopJoinBuildSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
492
10.3k
                                                            LocalSinkStateInfo& info) {
493
10.3k
    auto local_state = LocalStateType::create_unique(this, state);
494
10.3k
    RETURN_IF_ERROR(local_state->init(state, info));
495
10.3k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
496
10.3k
    return Status::OK();
497
10.3k
}
_ZN5doris17DataSinkOperatorXINS_19UnionSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
492
9.60k
                                                            LocalSinkStateInfo& info) {
493
9.60k
    auto local_state = LocalStateType::create_unique(this, state);
494
9.60k
    RETURN_IF_ERROR(local_state->init(state, info));
495
9.60k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
496
9.60k
    return Status::OK();
497
9.60k
}
_ZN5doris17DataSinkOperatorXINS_33MultiCastDataStreamSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
492
3.84k
                                                            LocalSinkStateInfo& info) {
493
3.84k
    auto local_state = LocalStateType::create_unique(this, state);
494
3.84k
    RETURN_IF_ERROR(local_state->init(state, info));
495
3.84k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
496
3.84k
    return Status::OK();
497
3.84k
}
_ZN5doris17DataSinkOperatorXINS_27PartitionSortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
492
252
                                                            LocalSinkStateInfo& info) {
493
252
    auto local_state = LocalStateType::create_unique(this, state);
494
252
    RETURN_IF_ERROR(local_state->init(state, info));
495
252
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
496
252
    return Status::OK();
497
252
}
_ZN5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
492
4.59k
                                                            LocalSinkStateInfo& info) {
493
4.59k
    auto local_state = LocalStateType::create_unique(this, state);
494
4.59k
    RETURN_IF_ERROR(local_state->init(state, info));
495
4.59k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
496
4.59k
    return Status::OK();
497
4.59k
}
_ZN5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
492
2.49k
                                                            LocalSinkStateInfo& info) {
493
2.49k
    auto local_state = LocalStateType::create_unique(this, state);
494
2.49k
    RETURN_IF_ERROR(local_state->init(state, info));
495
2.49k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
496
2.49k
    return Status::OK();
497
2.49k
}
_ZN5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
492
2.37k
                                                            LocalSinkStateInfo& info) {
493
2.37k
    auto local_state = LocalStateType::create_unique(this, state);
494
2.37k
    RETURN_IF_ERROR(local_state->init(state, info));
495
2.37k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
496
2.37k
    return Status::OK();
497
2.37k
}
_ZN5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
492
2.42k
                                                            LocalSinkStateInfo& info) {
493
2.42k
    auto local_state = LocalStateType::create_unique(this, state);
494
2.42k
    RETURN_IF_ERROR(local_state->init(state, info));
495
2.42k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
496
2.42k
    return Status::OK();
497
2.42k
}
_ZN5doris17DataSinkOperatorXINS_33PartitionedHashJoinSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
492
1
                                                            LocalSinkStateInfo& info) {
493
1
    auto local_state = LocalStateType::create_unique(this, state);
494
1
    RETURN_IF_ERROR(local_state->init(state, info));
495
1
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
496
1
    return Status::OK();
497
1
}
_ZN5doris17DataSinkOperatorXINS_30GroupCommitBlockSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
492
165
                                                            LocalSinkStateInfo& info) {
493
165
    auto local_state = LocalStateType::create_unique(this, state);
494
165
    RETURN_IF_ERROR(local_state->init(state, info));
495
165
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
496
165
    return Status::OK();
497
165
}
_ZN5doris17DataSinkOperatorXINS_19CacheSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
492
108
                                                            LocalSinkStateInfo& info) {
493
108
    auto local_state = LocalStateType::create_unique(this, state);
494
108
    RETURN_IF_ERROR(local_state->init(state, info));
495
108
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
496
108
    return Status::OK();
497
108
}
_ZN5doris17DataSinkOperatorXINS_18DictSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
492
105
                                                            LocalSinkStateInfo& info) {
493
105
    auto local_state = LocalStateType::create_unique(this, state);
494
105
    RETURN_IF_ERROR(local_state->init(state, info));
495
105
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
496
105
    return Status::OK();
497
105
}
_ZN5doris17DataSinkOperatorXINS_20RecCTESinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
492
151
                                                            LocalSinkStateInfo& info) {
493
151
    auto local_state = LocalStateType::create_unique(this, state);
494
151
    RETURN_IF_ERROR(local_state->init(state, info));
495
151
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
496
151
    return Status::OK();
497
151
}
_ZN5doris17DataSinkOperatorXINS_26RecCTEAnchorSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
492
151
                                                            LocalSinkStateInfo& info) {
493
151
    auto local_state = LocalStateType::create_unique(this, state);
494
151
    RETURN_IF_ERROR(local_state->init(state, info));
495
151
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
496
151
    return Status::OK();
497
151
}
498
499
template <typename LocalStateType>
500
1.55M
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
501
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
502
0
                                 LocalExchangeSharedState>) {
503
0
        return nullptr;
504
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
505
0
                                        MultiCastSharedState>) {
506
0
        throw Exception(Status::FatalError("should not reach here!"));
507
1.55M
    } else {
508
1.55M
        auto ss = LocalStateType::SharedStateType::create_shared();
509
1.55M
        ss->id = operator_id();
510
1.55M
        for (auto& dest : dests_id()) {
511
1.54M
            ss->related_op_ids.insert(dest);
512
1.54M
        }
513
1.55M
        return ss;
514
1.55M
    }
515
1.55M
}
_ZNK5doris17DataSinkOperatorXINS_27HashJoinBuildSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
500
144k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
501
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
502
                                 LocalExchangeSharedState>) {
503
        return nullptr;
504
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
505
                                        MultiCastSharedState>) {
506
        throw Exception(Status::FatalError("should not reach here!"));
507
144k
    } else {
508
144k
        auto ss = LocalStateType::SharedStateType::create_shared();
509
144k
        ss->id = operator_id();
510
144k
        for (auto& dest : dests_id()) {
511
144k
            ss->related_op_ids.insert(dest);
512
144k
        }
513
144k
        return ss;
514
144k
    }
515
144k
}
_ZNK5doris17DataSinkOperatorXINS_20ResultSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
500
407k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
501
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
502
                                 LocalExchangeSharedState>) {
503
        return nullptr;
504
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
505
                                        MultiCastSharedState>) {
506
        throw Exception(Status::FatalError("should not reach here!"));
507
407k
    } else {
508
407k
        auto ss = LocalStateType::SharedStateType::create_shared();
509
407k
        ss->id = operator_id();
510
407k
        for (auto& dest : dests_id()) {
511
404k
            ss->related_op_ids.insert(dest);
512
404k
        }
513
407k
        return ss;
514
407k
    }
515
407k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_23JdbcTableSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_27MemoryScratchSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
500
3
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
501
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
502
                                 LocalExchangeSharedState>) {
503
        return nullptr;
504
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
505
                                        MultiCastSharedState>) {
506
        throw Exception(Status::FatalError("should not reach here!"));
507
3
    } else {
508
3
        auto ss = LocalStateType::SharedStateType::create_shared();
509
3
        ss->id = operator_id();
510
3
        for (auto& dest : dests_id()) {
511
3
            ss->related_op_ids.insert(dest);
512
3
        }
513
3
        return ss;
514
3
    }
515
3
}
_ZNK5doris17DataSinkOperatorXINS_24ResultFileSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
500
354
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
501
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
502
                                 LocalExchangeSharedState>) {
503
        return nullptr;
504
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
505
                                        MultiCastSharedState>) {
506
        throw Exception(Status::FatalError("should not reach here!"));
507
354
    } else {
508
354
        auto ss = LocalStateType::SharedStateType::create_shared();
509
354
        ss->id = operator_id();
510
354
        for (auto& dest : dests_id()) {
511
354
            ss->related_op_ids.insert(dest);
512
354
        }
513
354
        return ss;
514
354
    }
515
354
}
_ZNK5doris17DataSinkOperatorXINS_23OlapTableSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
500
51.2k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
501
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
502
                                 LocalExchangeSharedState>) {
503
        return nullptr;
504
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
505
                                        MultiCastSharedState>) {
506
        throw Exception(Status::FatalError("should not reach here!"));
507
51.2k
    } else {
508
51.2k
        auto ss = LocalStateType::SharedStateType::create_shared();
509
51.2k
        ss->id = operator_id();
510
51.2k
        for (auto& dest : dests_id()) {
511
51.0k
            ss->related_op_ids.insert(dest);
512
51.0k
        }
513
51.2k
        return ss;
514
51.2k
    }
515
51.2k
}
_ZNK5doris17DataSinkOperatorXINS_25OlapTableSinkV2LocalStateEE19create_shared_stateEv
Line
Count
Source
500
338
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
501
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
502
                                 LocalExchangeSharedState>) {
503
        return nullptr;
504
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
505
                                        MultiCastSharedState>) {
506
        throw Exception(Status::FatalError("should not reach here!"));
507
338
    } else {
508
338
        auto ss = LocalStateType::SharedStateType::create_shared();
509
338
        ss->id = operator_id();
510
338
        for (auto& dest : dests_id()) {
511
338
            ss->related_op_ids.insert(dest);
512
338
        }
513
338
        return ss;
514
338
    }
515
338
}
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
500
7.61k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
501
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
502
                                 LocalExchangeSharedState>) {
503
        return nullptr;
504
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
505
                                        MultiCastSharedState>) {
506
        throw Exception(Status::FatalError("should not reach here!"));
507
7.61k
    } else {
508
7.61k
        auto ss = LocalStateType::SharedStateType::create_shared();
509
7.61k
        ss->id = operator_id();
510
7.61k
        for (auto& dest : dests_id()) {
511
7.59k
            ss->related_op_ids.insert(dest);
512
7.59k
        }
513
7.61k
        return ss;
514
7.61k
    }
515
7.61k
}
_ZNK5doris17DataSinkOperatorXINS_23BlackholeSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
500
21
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
501
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
502
                                 LocalExchangeSharedState>) {
503
        return nullptr;
504
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
505
                                        MultiCastSharedState>) {
506
        throw Exception(Status::FatalError("should not reach here!"));
507
21
    } else {
508
21
        auto ss = LocalStateType::SharedStateType::create_shared();
509
21
        ss->id = operator_id();
510
21
        for (auto& dest : dests_id()) {
511
21
            ss->related_op_ids.insert(dest);
512
21
        }
513
21
        return ss;
514
21
    }
515
21
}
_ZNK5doris17DataSinkOperatorXINS_18SortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
500
196k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
501
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
502
                                 LocalExchangeSharedState>) {
503
        return nullptr;
504
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
505
                                        MultiCastSharedState>) {
506
        throw Exception(Status::FatalError("should not reach here!"));
507
196k
    } else {
508
196k
        auto ss = LocalStateType::SharedStateType::create_shared();
509
196k
        ss->id = operator_id();
510
196k
        for (auto& dest : dests_id()) {
511
195k
            ss->related_op_ids.insert(dest);
512
195k
        }
513
196k
        return ss;
514
196k
    }
515
196k
}
_ZNK5doris17DataSinkOperatorXINS_23SpillSortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
500
35
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
501
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
502
                                 LocalExchangeSharedState>) {
503
        return nullptr;
504
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
505
                                        MultiCastSharedState>) {
506
        throw Exception(Status::FatalError("should not reach here!"));
507
35
    } else {
508
35
        auto ss = LocalStateType::SharedStateType::create_shared();
509
35
        ss->id = operator_id();
510
35
        for (auto& dest : dests_id()) {
511
35
            ss->related_op_ids.insert(dest);
512
35
        }
513
35
        return ss;
514
35
    }
515
35
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_27LocalExchangeSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_17AggSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
500
112k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
501
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
502
                                 LocalExchangeSharedState>) {
503
        return nullptr;
504
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
505
                                        MultiCastSharedState>) {
506
        throw Exception(Status::FatalError("should not reach here!"));
507
112k
    } else {
508
112k
        auto ss = LocalStateType::SharedStateType::create_shared();
509
112k
        ss->id = operator_id();
510
112k
        for (auto& dest : dests_id()) {
511
112k
            ss->related_op_ids.insert(dest);
512
112k
        }
513
112k
        return ss;
514
112k
    }
515
112k
}
_ZNK5doris17DataSinkOperatorXINS_28PartitionedAggSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
500
1.53k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
501
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
502
                                 LocalExchangeSharedState>) {
503
        return nullptr;
504
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
505
                                        MultiCastSharedState>) {
506
        throw Exception(Status::FatalError("should not reach here!"));
507
1.53k
    } else {
508
1.53k
        auto ss = LocalStateType::SharedStateType::create_shared();
509
1.53k
        ss->id = operator_id();
510
1.53k
        for (auto& dest : dests_id()) {
511
1.53k
            ss->related_op_ids.insert(dest);
512
1.53k
        }
513
1.53k
        return ss;
514
1.53k
    }
515
1.53k
}
_ZNK5doris17DataSinkOperatorXINS_22ExchangeSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
500
616k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
501
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
502
                                 LocalExchangeSharedState>) {
503
        return nullptr;
504
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
505
                                        MultiCastSharedState>) {
506
        throw Exception(Status::FatalError("should not reach here!"));
507
616k
    } else {
508
616k
        auto ss = LocalStateType::SharedStateType::create_shared();
509
616k
        ss->id = operator_id();
510
616k
        for (auto& dest : dests_id()) {
511
611k
            ss->related_op_ids.insert(dest);
512
611k
        }
513
616k
        return ss;
514
616k
    }
515
616k
}
_ZNK5doris17DataSinkOperatorXINS_33NestedLoopJoinBuildSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
500
10.3k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
501
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
502
                                 LocalExchangeSharedState>) {
503
        return nullptr;
504
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
505
                                        MultiCastSharedState>) {
506
        throw Exception(Status::FatalError("should not reach here!"));
507
10.3k
    } else {
508
10.3k
        auto ss = LocalStateType::SharedStateType::create_shared();
509
10.3k
        ss->id = operator_id();
510
10.3k
        for (auto& dest : dests_id()) {
511
10.3k
            ss->related_op_ids.insert(dest);
512
10.3k
        }
513
10.3k
        return ss;
514
10.3k
    }
515
10.3k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_19UnionSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_33MultiCastDataStreamSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_27PartitionSortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
500
356
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
501
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
502
                                 LocalExchangeSharedState>) {
503
        return nullptr;
504
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
505
                                        MultiCastSharedState>) {
506
        throw Exception(Status::FatalError("should not reach here!"));
507
356
    } else {
508
356
        auto ss = LocalStateType::SharedStateType::create_shared();
509
356
        ss->id = operator_id();
510
356
        for (auto& dest : dests_id()) {
511
356
            ss->related_op_ids.insert(dest);
512
356
        }
513
356
        return ss;
514
356
    }
515
356
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb1EEEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb0EEEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb1EEEE19create_shared_stateEv
Line
Count
Source
500
2.36k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
501
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
502
                                 LocalExchangeSharedState>) {
503
        return nullptr;
504
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
505
                                        MultiCastSharedState>) {
506
        throw Exception(Status::FatalError("should not reach here!"));
507
2.36k
    } else {
508
2.36k
        auto ss = LocalStateType::SharedStateType::create_shared();
509
2.36k
        ss->id = operator_id();
510
2.36k
        for (auto& dest : dests_id()) {
511
2.36k
            ss->related_op_ids.insert(dest);
512
2.36k
        }
513
2.36k
        return ss;
514
2.36k
    }
515
2.36k
}
_ZNK5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb0EEEE19create_shared_stateEv
Line
Count
Source
500
2.43k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
501
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
502
                                 LocalExchangeSharedState>) {
503
        return nullptr;
504
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
505
                                        MultiCastSharedState>) {
506
        throw Exception(Status::FatalError("should not reach here!"));
507
2.43k
    } else {
508
2.43k
        auto ss = LocalStateType::SharedStateType::create_shared();
509
2.43k
        ss->id = operator_id();
510
2.43k
        for (auto& dest : dests_id()) {
511
2.42k
            ss->related_op_ids.insert(dest);
512
2.42k
        }
513
2.43k
        return ss;
514
2.43k
    }
515
2.43k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_33PartitionedHashJoinSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_30GroupCommitBlockSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
500
165
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
501
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
502
                                 LocalExchangeSharedState>) {
503
        return nullptr;
504
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
505
                                        MultiCastSharedState>) {
506
        throw Exception(Status::FatalError("should not reach here!"));
507
165
    } else {
508
165
        auto ss = LocalStateType::SharedStateType::create_shared();
509
165
        ss->id = operator_id();
510
165
        for (auto& dest : dests_id()) {
511
165
            ss->related_op_ids.insert(dest);
512
165
        }
513
165
        return ss;
514
165
    }
515
165
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_19CacheSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_18DictSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
500
105
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
501
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
502
                                 LocalExchangeSharedState>) {
503
        return nullptr;
504
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
505
                                        MultiCastSharedState>) {
506
        throw Exception(Status::FatalError("should not reach here!"));
507
105
    } else {
508
105
        auto ss = LocalStateType::SharedStateType::create_shared();
509
105
        ss->id = operator_id();
510
105
        for (auto& dest : dests_id()) {
511
105
            ss->related_op_ids.insert(dest);
512
105
        }
513
105
        return ss;
514
105
    }
515
105
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_20RecCTESinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_26RecCTEAnchorSinkLocalStateEE19create_shared_stateEv
516
517
template <typename LocalStateType>
518
2.50M
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
519
2.50M
    auto local_state = LocalStateType::create_unique(state, this);
520
2.50M
    RETURN_IF_ERROR(local_state->init(state, info));
521
2.50M
    state->emplace_local_state(operator_id(), std::move(local_state));
522
2.50M
    return Status::OK();
523
2.50M
}
_ZN5doris9OperatorXINS_23HashJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
518
105k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
519
105k
    auto local_state = LocalStateType::create_unique(state, this);
520
105k
    RETURN_IF_ERROR(local_state->init(state, info));
521
105k
    state->emplace_local_state(operator_id(), std::move(local_state));
522
105k
    return Status::OK();
523
105k
}
_ZN5doris9OperatorXINS_18OlapScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
518
262k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
519
262k
    auto local_state = LocalStateType::create_unique(state, this);
520
262k
    RETURN_IF_ERROR(local_state->init(state, info));
521
262k
    state->emplace_local_state(operator_id(), std::move(local_state));
522
262k
    return Status::OK();
523
262k
}
_ZN5doris9OperatorXINS_21GroupCommitLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
518
77
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
519
77
    auto local_state = LocalStateType::create_unique(state, this);
520
77
    RETURN_IF_ERROR(local_state->init(state, info));
521
77
    state->emplace_local_state(operator_id(), std::move(local_state));
522
77
    return Status::OK();
523
77
}
Unexecuted instantiation: _ZN5doris9OperatorXINS_18JDBCScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris9OperatorXINS_18FileScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
518
2.68k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
519
2.68k
    auto local_state = LocalStateType::create_unique(state, this);
520
2.68k
    RETURN_IF_ERROR(local_state->init(state, info));
521
2.68k
    state->emplace_local_state(operator_id(), std::move(local_state));
522
2.68k
    return Status::OK();
523
2.68k
}
Unexecuted instantiation: _ZN5doris9OperatorXINS_16EsScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris9OperatorXINS_18AnalyticLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
518
7.54k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
519
7.54k
    auto local_state = LocalStateType::create_unique(state, this);
520
7.54k
    RETURN_IF_ERROR(local_state->init(state, info));
521
7.54k
    state->emplace_local_state(operator_id(), std::move(local_state));
522
7.54k
    return Status::OK();
523
7.54k
}
_ZN5doris9OperatorXINS_14SortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
518
7.58k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
519
7.58k
    auto local_state = LocalStateType::create_unique(state, this);
520
7.58k
    RETURN_IF_ERROR(local_state->init(state, info));
521
7.58k
    state->emplace_local_state(operator_id(), std::move(local_state));
522
7.58k
    return Status::OK();
523
7.58k
}
_ZN5doris9OperatorXINS_19SpillSortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
518
27
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
519
27
    auto local_state = LocalStateType::create_unique(state, this);
520
27
    RETURN_IF_ERROR(local_state->init(state, info));
521
27
    state->emplace_local_state(operator_id(), std::move(local_state));
522
27
    return Status::OK();
523
27
}
_ZN5doris9OperatorXINS_24LocalMergeSortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
518
187k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
519
187k
    auto local_state = LocalStateType::create_unique(state, this);
520
187k
    RETURN_IF_ERROR(local_state->init(state, info));
521
187k
    state->emplace_local_state(operator_id(), std::move(local_state));
522
187k
    return Status::OK();
523
187k
}
_ZN5doris9OperatorXINS_13AggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
518
112k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
519
112k
    auto local_state = LocalStateType::create_unique(state, this);
520
112k
    RETURN_IF_ERROR(local_state->init(state, info));
521
112k
    state->emplace_local_state(operator_id(), std::move(local_state));
522
112k
    return Status::OK();
523
112k
}
_ZN5doris9OperatorXINS_24PartitionedAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
518
1.52k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
519
1.52k
    auto local_state = LocalStateType::create_unique(state, this);
520
1.52k
    RETURN_IF_ERROR(local_state->init(state, info));
521
1.52k
    state->emplace_local_state(operator_id(), std::move(local_state));
522
1.52k
    return Status::OK();
523
1.52k
}
_ZN5doris9OperatorXINS_23TableFunctionLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
518
5.16k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
519
5.16k
    auto local_state = LocalStateType::create_unique(state, this);
520
5.16k
    RETURN_IF_ERROR(local_state->init(state, info));
521
5.16k
    state->emplace_local_state(operator_id(), std::move(local_state));
522
5.16k
    return Status::OK();
523
5.16k
}
_ZN5doris9OperatorXINS_18ExchangeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
518
420k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
519
420k
    auto local_state = LocalStateType::create_unique(state, this);
520
420k
    RETURN_IF_ERROR(local_state->init(state, info));
521
420k
    state->emplace_local_state(operator_id(), std::move(local_state));
522
420k
    return Status::OK();
523
420k
}
_ZN5doris9OperatorXINS_16RepeatLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
518
1.12k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
519
1.12k
    auto local_state = LocalStateType::create_unique(state, this);
520
1.12k
    RETURN_IF_ERROR(local_state->init(state, info));
521
1.12k
    state->emplace_local_state(operator_id(), std::move(local_state));
522
1.12k
    return Status::OK();
523
1.12k
}
_ZN5doris9OperatorXINS_29NestedLoopJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
518
10.3k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
519
10.3k
    auto local_state = LocalStateType::create_unique(state, this);
520
10.3k
    RETURN_IF_ERROR(local_state->init(state, info));
521
10.3k
    state->emplace_local_state(operator_id(), std::move(local_state));
522
10.3k
    return Status::OK();
523
10.3k
}
_ZN5doris9OperatorXINS_23AssertNumRowsLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
518
21
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
519
21
    auto local_state = LocalStateType::create_unique(state, this);
520
21
    RETURN_IF_ERROR(local_state->init(state, info));
521
21
    state->emplace_local_state(operator_id(), std::move(local_state));
522
21
    return Status::OK();
523
21
}
_ZN5doris9OperatorXINS_18EmptySetLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
518
1.48k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
519
1.48k
    auto local_state = LocalStateType::create_unique(state, this);
520
1.48k
    RETURN_IF_ERROR(local_state->init(state, info));
521
1.48k
    state->emplace_local_state(operator_id(), std::move(local_state));
522
1.48k
    return Status::OK();
523
1.48k
}
_ZN5doris9OperatorXINS_21UnionSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
518
51.7k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
519
51.7k
    auto local_state = LocalStateType::create_unique(state, this);
520
51.7k
    RETURN_IF_ERROR(local_state->init(state, info));
521
51.7k
    state->emplace_local_state(operator_id(), std::move(local_state));
522
51.7k
    return Status::OK();
523
51.7k
}
_ZN5doris9OperatorXINS_35MultiCastDataStreamSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
518
9.61k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
519
9.61k
    auto local_state = LocalStateType::create_unique(state, this);
520
9.61k
    RETURN_IF_ERROR(local_state->init(state, info));
521
9.61k
    state->emplace_local_state(operator_id(), std::move(local_state));
522
9.61k
    return Status::OK();
523
9.61k
}
_ZN5doris9OperatorXINS_29PartitionSortSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
518
249
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
519
249
    auto local_state = LocalStateType::create_unique(state, this);
520
249
    RETURN_IF_ERROR(local_state->init(state, info));
521
249
    state->emplace_local_state(operator_id(), std::move(local_state));
522
249
    return Status::OK();
523
249
}
_ZN5doris9OperatorXINS_19SetSourceLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
518
2.37k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
519
2.37k
    auto local_state = LocalStateType::create_unique(state, this);
520
2.37k
    RETURN_IF_ERROR(local_state->init(state, info));
521
2.37k
    state->emplace_local_state(operator_id(), std::move(local_state));
522
2.37k
    return Status::OK();
523
2.37k
}
_ZN5doris9OperatorXINS_19SetSourceLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
518
2.42k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
519
2.42k
    auto local_state = LocalStateType::create_unique(state, this);
520
2.42k
    RETURN_IF_ERROR(local_state->init(state, info));
521
2.42k
    state->emplace_local_state(operator_id(), std::move(local_state));
522
2.42k
    return Status::OK();
523
2.42k
}
_ZN5doris9OperatorXINS_17DataGenLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
518
267
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
519
267
    auto local_state = LocalStateType::create_unique(state, this);
520
267
    RETURN_IF_ERROR(local_state->init(state, info));
521
267
    state->emplace_local_state(operator_id(), std::move(local_state));
522
267
    return Status::OK();
523
267
}
_ZN5doris9OperatorXINS_20SchemaScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
518
1.54k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
519
1.54k
    auto local_state = LocalStateType::create_unique(state, this);
520
1.54k
    RETURN_IF_ERROR(local_state->init(state, info));
521
1.54k
    state->emplace_local_state(operator_id(), std::move(local_state));
522
1.54k
    return Status::OK();
523
1.54k
}
_ZN5doris9OperatorXINS_18MetaScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
518
5.00k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
519
5.00k
    auto local_state = LocalStateType::create_unique(state, this);
520
5.00k
    RETURN_IF_ERROR(local_state->init(state, info));
521
5.00k
    state->emplace_local_state(operator_id(), std::move(local_state));
522
5.00k
    return Status::OK();
523
5.00k
}
_ZN5doris9OperatorXINS_29LocalExchangeSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
518
754k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
519
754k
    auto local_state = LocalStateType::create_unique(state, this);
520
754k
    RETURN_IF_ERROR(local_state->init(state, info));
521
754k
    state->emplace_local_state(operator_id(), std::move(local_state));
522
754k
    return Status::OK();
523
754k
}
Unexecuted instantiation: _ZN5doris9OperatorXINS_34PartitionedHashJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris9OperatorXINS_21CacheSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
518
108
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
519
108
    auto local_state = LocalStateType::create_unique(state, this);
520
108
    RETURN_IF_ERROR(local_state->init(state, info));
521
108
    state->emplace_local_state(operator_id(), std::move(local_state));
522
108
    return Status::OK();
523
108
}
_ZN5doris9OperatorXINS_22RecCTESourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
518
151
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
519
151
    auto local_state = LocalStateType::create_unique(state, this);
520
151
    RETURN_IF_ERROR(local_state->init(state, info));
521
151
    state->emplace_local_state(operator_id(), std::move(local_state));
522
151
    return Status::OK();
523
151
}
_ZN5doris9OperatorXINS_20RecCTEScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
518
1.94k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
519
1.94k
    auto local_state = LocalStateType::create_unique(state, this);
520
1.94k
    RETURN_IF_ERROR(local_state->init(state, info));
521
1.94k
    state->emplace_local_state(operator_id(), std::move(local_state));
522
1.94k
    return Status::OK();
523
1.94k
}
_ZN5doris9OperatorXINS_25MaterializationLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
518
685
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
519
685
    auto local_state = LocalStateType::create_unique(state, this);
520
685
    RETURN_IF_ERROR(local_state->init(state, info));
521
685
    state->emplace_local_state(operator_id(), std::move(local_state));
522
685
    return Status::OK();
523
685
}
_ZN5doris9OperatorXINS_16SelectLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
518
1.80k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
519
1.80k
    auto local_state = LocalStateType::create_unique(state, this);
520
1.80k
    RETURN_IF_ERROR(local_state->init(state, info));
521
1.80k
    state->emplace_local_state(operator_id(), std::move(local_state));
522
1.80k
    return Status::OK();
523
1.80k
}
_ZN5doris9OperatorXINS_22StreamingAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
518
6.64k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
519
6.64k
    auto local_state = LocalStateType::create_unique(state, this);
520
6.64k
    RETURN_IF_ERROR(local_state->init(state, info));
521
6.64k
    state->emplace_local_state(operator_id(), std::move(local_state));
522
6.64k
    return Status::OK();
523
6.64k
}
_ZN5doris9OperatorXINS_30DistinctStreamingAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
518
539k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
519
539k
    auto local_state = LocalStateType::create_unique(state, this);
520
539k
    RETURN_IF_ERROR(local_state->init(state, info));
521
539k
    state->emplace_local_state(operator_id(), std::move(local_state));
522
539k
    return Status::OK();
523
539k
}
524
525
PipelineXSinkLocalStateBase::PipelineXSinkLocalStateBase(DataSinkOperatorXBase* parent,
526
                                                         RuntimeState* state)
527
1.90M
        : _parent(parent), _state(state) {}
528
529
PipelineXLocalStateBase::PipelineXLocalStateBase(RuntimeState* state, OperatorXBase* parent)
530
2.49M
        : _num_rows_returned(0), _rows_returned_counter(nullptr), _parent(parent), _state(state) {}
531
532
template <typename SharedStateArg>
533
2.49M
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
534
2.49M
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
535
2.49M
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
536
2.49M
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
537
2.49M
    _operator_profile->set_metadata(_parent->node_id());
538
    // indent is false so that source operator will have same
539
    // indentation_level with its parent operator.
540
2.49M
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
541
2.49M
    _operator_profile->add_child(_common_profile.get(), true);
542
2.49M
    _operator_profile->add_child(_custom_profile.get(), true);
543
2.49M
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
544
2.49M
    if constexpr (!is_fake_shared) {
545
1.25M
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
546
762k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
547
762k
                                    .first.get()
548
762k
                                    ->template cast<SharedStateArg>();
549
550
762k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
551
762k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
552
762k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
553
762k
        } else if (info.shared_state) {
554
435k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
555
0
                DCHECK(false);
556
0
            }
557
            // For UnionSourceOperator without children, there is no shared state.
558
435k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
559
560
435k
            _dependency = _shared_state->create_source_dependency(
561
435k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
562
435k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
563
435k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
564
435k
        } else {
565
18.4E
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
566
18.4E
                DCHECK(false);
567
18.4E
            }
568
52.8k
        }
569
1.25M
    }
570
571
2.49M
    if (must_set_shared_state() && _shared_state == nullptr) {
572
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
573
0
    }
574
575
2.49M
    _rows_returned_counter =
576
2.49M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
577
2.49M
    _blocks_returned_counter =
578
2.49M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
579
2.49M
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
580
2.49M
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
581
2.49M
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
582
2.49M
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
583
2.49M
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
584
2.49M
    _memory_used_counter =
585
2.49M
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
586
2.49M
    _common_profile->add_info_string("IsColocate",
587
2.49M
                                     std::to_string(_parent->is_colocated_operator()));
588
2.49M
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
589
2.49M
    _common_profile->add_info_string("FollowedByShuffledOperator",
590
2.49M
                                     std::to_string(_parent->followed_by_shuffled_operator()));
591
2.49M
    return Status::OK();
592
2.49M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
533
104k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
534
104k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
535
104k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
536
104k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
537
104k
    _operator_profile->set_metadata(_parent->node_id());
538
    // indent is false so that source operator will have same
539
    // indentation_level with its parent operator.
540
104k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
541
104k
    _operator_profile->add_child(_common_profile.get(), true);
542
104k
    _operator_profile->add_child(_custom_profile.get(), true);
543
104k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
544
104k
    if constexpr (!is_fake_shared) {
545
104k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
546
9.58k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
547
9.58k
                                    .first.get()
548
9.58k
                                    ->template cast<SharedStateArg>();
549
550
9.58k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
551
9.58k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
552
9.58k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
553
95.2k
        } else if (info.shared_state) {
554
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
555
                DCHECK(false);
556
            }
557
            // For UnionSourceOperator without children, there is no shared state.
558
93.9k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
559
560
93.9k
            _dependency = _shared_state->create_source_dependency(
561
93.9k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
562
93.9k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
563
93.9k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
564
93.9k
        } else {
565
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
566
                DCHECK(false);
567
            }
568
1.28k
        }
569
104k
    }
570
571
104k
    if (must_set_shared_state() && _shared_state == nullptr) {
572
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
573
0
    }
574
575
104k
    _rows_returned_counter =
576
104k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
577
104k
    _blocks_returned_counter =
578
104k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
579
104k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
580
104k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
581
104k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
582
104k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
583
104k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
584
104k
    _memory_used_counter =
585
104k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
586
104k
    _common_profile->add_info_string("IsColocate",
587
104k
                                     std::to_string(_parent->is_colocated_operator()));
588
104k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
589
104k
    _common_profile->add_info_string("FollowedByShuffledOperator",
590
104k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
591
104k
    return Status::OK();
592
104k
}
_ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
533
1
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
534
1
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
535
1
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
536
1
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
537
1
    _operator_profile->set_metadata(_parent->node_id());
538
    // indent is false so that source operator will have same
539
    // indentation_level with its parent operator.
540
1
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
541
1
    _operator_profile->add_child(_common_profile.get(), true);
542
1
    _operator_profile->add_child(_custom_profile.get(), true);
543
1
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
544
1
    if constexpr (!is_fake_shared) {
545
1
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
546
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
547
0
                                    .first.get()
548
0
                                    ->template cast<SharedStateArg>();
549
550
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
551
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
552
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
553
1
        } else if (info.shared_state) {
554
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
555
                DCHECK(false);
556
            }
557
            // For UnionSourceOperator without children, there is no shared state.
558
1
            _shared_state = info.shared_state->template cast<SharedStateArg>();
559
560
1
            _dependency = _shared_state->create_source_dependency(
561
1
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
562
1
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
563
1
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
564
1
        } else {
565
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
566
                DCHECK(false);
567
            }
568
0
        }
569
1
    }
570
571
1
    if (must_set_shared_state() && _shared_state == nullptr) {
572
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
573
0
    }
574
575
1
    _rows_returned_counter =
576
1
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
577
1
    _blocks_returned_counter =
578
1
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
579
1
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
580
1
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
581
1
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
582
1
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
583
1
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
584
1
    _memory_used_counter =
585
1
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
586
1
    _common_profile->add_info_string("IsColocate",
587
1
                                     std::to_string(_parent->is_colocated_operator()));
588
1
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
589
1
    _common_profile->add_info_string("FollowedByShuffledOperator",
590
1
                                     std::to_string(_parent->followed_by_shuffled_operator()));
591
1
    return Status::OK();
592
1
}
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
533
195k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
534
195k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
535
195k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
536
195k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
537
195k
    _operator_profile->set_metadata(_parent->node_id());
538
    // indent is false so that source operator will have same
539
    // indentation_level with its parent operator.
540
195k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
541
195k
    _operator_profile->add_child(_common_profile.get(), true);
542
195k
    _operator_profile->add_child(_custom_profile.get(), true);
543
195k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
544
195k
    if constexpr (!is_fake_shared) {
545
195k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
546
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
547
0
                                    .first.get()
548
0
                                    ->template cast<SharedStateArg>();
549
550
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
551
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
552
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
553
195k
        } else if (info.shared_state) {
554
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
555
                DCHECK(false);
556
            }
557
            // For UnionSourceOperator without children, there is no shared state.
558
191k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
559
560
191k
            _dependency = _shared_state->create_source_dependency(
561
191k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
562
191k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
563
191k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
564
191k
        } else {
565
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
566
                DCHECK(false);
567
            }
568
3.60k
        }
569
195k
    }
570
571
195k
    if (must_set_shared_state() && _shared_state == nullptr) {
572
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
573
0
    }
574
575
195k
    _rows_returned_counter =
576
195k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
577
195k
    _blocks_returned_counter =
578
195k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
579
195k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
580
195k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
581
195k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
582
195k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
583
195k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
584
195k
    _memory_used_counter =
585
195k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
586
195k
    _common_profile->add_info_string("IsColocate",
587
195k
                                     std::to_string(_parent->is_colocated_operator()));
588
195k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
589
195k
    _common_profile->add_info_string("FollowedByShuffledOperator",
590
195k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
591
195k
    return Status::OK();
592
195k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
533
27
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
534
27
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
535
27
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
536
27
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
537
27
    _operator_profile->set_metadata(_parent->node_id());
538
    // indent is false so that source operator will have same
539
    // indentation_level with its parent operator.
540
27
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
541
27
    _operator_profile->add_child(_common_profile.get(), true);
542
27
    _operator_profile->add_child(_custom_profile.get(), true);
543
27
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
544
27
    if constexpr (!is_fake_shared) {
545
27
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
546
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
547
0
                                    .first.get()
548
0
                                    ->template cast<SharedStateArg>();
549
550
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
551
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
552
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
553
27
        } else if (info.shared_state) {
554
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
555
                DCHECK(false);
556
            }
557
            // For UnionSourceOperator without children, there is no shared state.
558
27
            _shared_state = info.shared_state->template cast<SharedStateArg>();
559
560
27
            _dependency = _shared_state->create_source_dependency(
561
27
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
562
27
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
563
27
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
564
27
        } else {
565
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
566
                DCHECK(false);
567
            }
568
0
        }
569
27
    }
570
571
27
    if (must_set_shared_state() && _shared_state == nullptr) {
572
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
573
0
    }
574
575
27
    _rows_returned_counter =
576
27
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
577
27
    _blocks_returned_counter =
578
27
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
579
27
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
580
27
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
581
27
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
582
27
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
583
27
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
584
27
    _memory_used_counter =
585
27
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
586
27
    _common_profile->add_info_string("IsColocate",
587
27
                                     std::to_string(_parent->is_colocated_operator()));
588
27
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
589
27
    _common_profile->add_info_string("FollowedByShuffledOperator",
590
27
                                     std::to_string(_parent->followed_by_shuffled_operator()));
591
27
    return Status::OK();
592
27
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
533
10.3k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
534
10.3k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
535
10.3k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
536
10.3k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
537
10.3k
    _operator_profile->set_metadata(_parent->node_id());
538
    // indent is false so that source operator will have same
539
    // indentation_level with its parent operator.
540
10.3k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
541
10.3k
    _operator_profile->add_child(_common_profile.get(), true);
542
10.3k
    _operator_profile->add_child(_custom_profile.get(), true);
543
10.3k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
544
10.3k
    if constexpr (!is_fake_shared) {
545
10.3k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
546
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
547
0
                                    .first.get()
548
0
                                    ->template cast<SharedStateArg>();
549
550
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
551
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
552
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
553
10.3k
        } else if (info.shared_state) {
554
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
555
                DCHECK(false);
556
            }
557
            // For UnionSourceOperator without children, there is no shared state.
558
10.2k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
559
560
10.2k
            _dependency = _shared_state->create_source_dependency(
561
10.2k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
562
10.2k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
563
10.2k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
564
10.2k
        } else {
565
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
566
                DCHECK(false);
567
            }
568
10
        }
569
10.3k
    }
570
571
10.3k
    if (must_set_shared_state() && _shared_state == nullptr) {
572
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
573
0
    }
574
575
10.3k
    _rows_returned_counter =
576
10.3k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
577
10.3k
    _blocks_returned_counter =
578
10.3k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
579
10.3k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
580
10.3k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
581
10.3k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
582
10.3k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
583
10.3k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
584
10.3k
    _memory_used_counter =
585
10.3k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
586
10.3k
    _common_profile->add_info_string("IsColocate",
587
10.3k
                                     std::to_string(_parent->is_colocated_operator()));
588
10.3k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
589
10.3k
    _common_profile->add_info_string("FollowedByShuffledOperator",
590
10.3k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
591
10.3k
    return Status::OK();
592
10.3k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
533
7.53k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
534
7.53k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
535
7.53k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
536
7.53k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
537
7.53k
    _operator_profile->set_metadata(_parent->node_id());
538
    // indent is false so that source operator will have same
539
    // indentation_level with its parent operator.
540
7.53k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
541
7.53k
    _operator_profile->add_child(_common_profile.get(), true);
542
7.53k
    _operator_profile->add_child(_custom_profile.get(), true);
543
7.53k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
544
7.53k
    if constexpr (!is_fake_shared) {
545
7.53k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
546
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
547
0
                                    .first.get()
548
0
                                    ->template cast<SharedStateArg>();
549
550
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
551
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
552
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
553
7.53k
        } else if (info.shared_state) {
554
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
555
                DCHECK(false);
556
            }
557
            // For UnionSourceOperator without children, there is no shared state.
558
7.47k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
559
560
7.47k
            _dependency = _shared_state->create_source_dependency(
561
7.47k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
562
7.47k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
563
7.47k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
564
7.47k
        } else {
565
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
566
                DCHECK(false);
567
            }
568
66
        }
569
7.53k
    }
570
571
7.53k
    if (must_set_shared_state() && _shared_state == nullptr) {
572
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
573
0
    }
574
575
7.53k
    _rows_returned_counter =
576
7.53k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
577
7.53k
    _blocks_returned_counter =
578
7.53k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
579
7.53k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
580
7.53k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
581
7.53k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
582
7.53k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
583
7.53k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
584
7.53k
    _memory_used_counter =
585
7.53k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
586
7.53k
    _common_profile->add_info_string("IsColocate",
587
7.53k
                                     std::to_string(_parent->is_colocated_operator()));
588
7.53k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
589
7.53k
    _common_profile->add_info_string("FollowedByShuffledOperator",
590
7.53k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
591
7.53k
    return Status::OK();
592
7.53k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
533
112k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
534
112k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
535
112k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
536
112k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
537
112k
    _operator_profile->set_metadata(_parent->node_id());
538
    // indent is false so that source operator will have same
539
    // indentation_level with its parent operator.
540
112k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
541
112k
    _operator_profile->add_child(_common_profile.get(), true);
542
112k
    _operator_profile->add_child(_custom_profile.get(), true);
543
112k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
544
112k
    if constexpr (!is_fake_shared) {
545
112k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
546
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
547
0
                                    .first.get()
548
0
                                    ->template cast<SharedStateArg>();
549
550
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
551
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
552
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
553
112k
        } else if (info.shared_state) {
554
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
555
                DCHECK(false);
556
            }
557
            // For UnionSourceOperator without children, there is no shared state.
558
110k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
559
560
110k
            _dependency = _shared_state->create_source_dependency(
561
110k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
562
110k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
563
110k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
564
110k
        } else {
565
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
566
                DCHECK(false);
567
            }
568
1.29k
        }
569
112k
    }
570
571
112k
    if (must_set_shared_state() && _shared_state == nullptr) {
572
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
573
0
    }
574
575
112k
    _rows_returned_counter =
576
112k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
577
112k
    _blocks_returned_counter =
578
112k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
579
112k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
580
112k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
581
112k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
582
112k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
583
112k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
584
112k
    _memory_used_counter =
585
112k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
586
112k
    _common_profile->add_info_string("IsColocate",
587
112k
                                     std::to_string(_parent->is_colocated_operator()));
588
112k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
589
112k
    _common_profile->add_info_string("FollowedByShuffledOperator",
590
112k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
591
112k
    return Status::OK();
592
112k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
533
1.52k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
534
1.52k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
535
1.52k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
536
1.52k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
537
1.52k
    _operator_profile->set_metadata(_parent->node_id());
538
    // indent is false so that source operator will have same
539
    // indentation_level with its parent operator.
540
1.52k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
541
1.52k
    _operator_profile->add_child(_common_profile.get(), true);
542
1.52k
    _operator_profile->add_child(_custom_profile.get(), true);
543
1.52k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
544
1.52k
    if constexpr (!is_fake_shared) {
545
1.52k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
546
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
547
0
                                    .first.get()
548
0
                                    ->template cast<SharedStateArg>();
549
550
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
551
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
552
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
553
1.52k
        } else if (info.shared_state) {
554
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
555
                DCHECK(false);
556
            }
557
            // For UnionSourceOperator without children, there is no shared state.
558
1.52k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
559
560
1.52k
            _dependency = _shared_state->create_source_dependency(
561
1.52k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
562
1.52k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
563
1.52k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
564
1.52k
        } else {
565
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
566
                DCHECK(false);
567
            }
568
0
        }
569
1.52k
    }
570
571
1.52k
    if (must_set_shared_state() && _shared_state == nullptr) {
572
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
573
0
    }
574
575
1.52k
    _rows_returned_counter =
576
1.52k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
577
1.52k
    _blocks_returned_counter =
578
1.52k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
579
1.52k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
580
1.52k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
581
1.52k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
582
1.52k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
583
1.52k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
584
1.52k
    _memory_used_counter =
585
1.52k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
586
1.52k
    _common_profile->add_info_string("IsColocate",
587
1.52k
                                     std::to_string(_parent->is_colocated_operator()));
588
1.52k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
589
1.52k
    _common_profile->add_info_string("FollowedByShuffledOperator",
590
1.52k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
591
1.52k
    return Status::OK();
592
1.52k
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
533
1.24M
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
534
1.24M
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
535
1.24M
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
536
1.24M
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
537
1.24M
    _operator_profile->set_metadata(_parent->node_id());
538
    // indent is false so that source operator will have same
539
    // indentation_level with its parent operator.
540
1.24M
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
541
1.24M
    _operator_profile->add_child(_common_profile.get(), true);
542
1.24M
    _operator_profile->add_child(_custom_profile.get(), true);
543
1.24M
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
544
    if constexpr (!is_fake_shared) {
545
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
546
            _shared_state = info.shared_state_map.at(_parent->operator_id())
547
                                    .first.get()
548
                                    ->template cast<SharedStateArg>();
549
550
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
551
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
552
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
553
        } else if (info.shared_state) {
554
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
555
                DCHECK(false);
556
            }
557
            // For UnionSourceOperator without children, there is no shared state.
558
            _shared_state = info.shared_state->template cast<SharedStateArg>();
559
560
            _dependency = _shared_state->create_source_dependency(
561
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
562
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
563
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
564
        } else {
565
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
566
                DCHECK(false);
567
            }
568
        }
569
    }
570
571
1.24M
    if (must_set_shared_state() && _shared_state == nullptr) {
572
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
573
0
    }
574
575
1.24M
    _rows_returned_counter =
576
1.24M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
577
1.24M
    _blocks_returned_counter =
578
1.24M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
579
1.24M
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
580
1.24M
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
581
1.24M
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
582
1.24M
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
583
1.24M
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
584
1.24M
    _memory_used_counter =
585
1.24M
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
586
1.24M
    _common_profile->add_info_string("IsColocate",
587
1.24M
                                     std::to_string(_parent->is_colocated_operator()));
588
1.24M
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
589
1.24M
    _common_profile->add_info_string("FollowedByShuffledOperator",
590
1.24M
                                     std::to_string(_parent->followed_by_shuffled_operator()));
591
1.24M
    return Status::OK();
592
1.24M
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
533
51.4k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
534
51.4k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
535
51.4k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
536
51.4k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
537
51.4k
    _operator_profile->set_metadata(_parent->node_id());
538
    // indent is false so that source operator will have same
539
    // indentation_level with its parent operator.
540
51.4k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
541
51.4k
    _operator_profile->add_child(_common_profile.get(), true);
542
51.4k
    _operator_profile->add_child(_custom_profile.get(), true);
543
51.4k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
544
51.4k
    if constexpr (!is_fake_shared) {
545
51.4k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
546
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
547
0
                                    .first.get()
548
0
                                    ->template cast<SharedStateArg>();
549
550
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
551
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
552
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
553
51.4k
        } else if (info.shared_state) {
554
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
555
                DCHECK(false);
556
            }
557
            // For UnionSourceOperator without children, there is no shared state.
558
4.15k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
559
560
4.15k
            _dependency = _shared_state->create_source_dependency(
561
4.15k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
562
4.15k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
563
4.15k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
564
47.3k
        } else {
565
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
566
                DCHECK(false);
567
            }
568
47.3k
        }
569
51.4k
    }
570
571
51.4k
    if (must_set_shared_state() && _shared_state == nullptr) {
572
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
573
0
    }
574
575
51.4k
    _rows_returned_counter =
576
51.4k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
577
51.4k
    _blocks_returned_counter =
578
51.4k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
579
51.4k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
580
51.4k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
581
51.4k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
582
51.4k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
583
51.4k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
584
51.4k
    _memory_used_counter =
585
51.4k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
586
51.4k
    _common_profile->add_info_string("IsColocate",
587
51.4k
                                     std::to_string(_parent->is_colocated_operator()));
588
51.4k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
589
51.4k
    _common_profile->add_info_string("FollowedByShuffledOperator",
590
51.4k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
591
51.4k
    return Status::OK();
592
51.4k
}
_ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
533
111
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
534
111
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
535
111
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
536
111
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
537
111
    _operator_profile->set_metadata(_parent->node_id());
538
    // indent is false so that source operator will have same
539
    // indentation_level with its parent operator.
540
111
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
541
111
    _operator_profile->add_child(_common_profile.get(), true);
542
111
    _operator_profile->add_child(_custom_profile.get(), true);
543
111
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
544
111
    if constexpr (!is_fake_shared) {
545
111
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
546
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
547
0
                                    .first.get()
548
0
                                    ->template cast<SharedStateArg>();
549
550
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
551
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
552
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
553
111
        } else if (info.shared_state) {
554
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
555
                DCHECK(false);
556
            }
557
            // For UnionSourceOperator without children, there is no shared state.
558
111
            _shared_state = info.shared_state->template cast<SharedStateArg>();
559
560
111
            _dependency = _shared_state->create_source_dependency(
561
111
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
562
111
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
563
111
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
564
111
        } else {
565
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
566
                DCHECK(false);
567
            }
568
0
        }
569
111
    }
570
571
111
    if (must_set_shared_state() && _shared_state == nullptr) {
572
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
573
0
    }
574
575
111
    _rows_returned_counter =
576
111
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
577
111
    _blocks_returned_counter =
578
111
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
579
111
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
580
111
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
581
111
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
582
111
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
583
111
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
584
111
    _memory_used_counter =
585
111
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
586
111
    _common_profile->add_info_string("IsColocate",
587
111
                                     std::to_string(_parent->is_colocated_operator()));
588
111
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
589
111
    _common_profile->add_info_string("FollowedByShuffledOperator",
590
111
                                     std::to_string(_parent->followed_by_shuffled_operator()));
591
111
    return Status::OK();
592
111
}
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
533
9.61k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
534
9.61k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
535
9.61k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
536
9.61k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
537
9.61k
    _operator_profile->set_metadata(_parent->node_id());
538
    // indent is false so that source operator will have same
539
    // indentation_level with its parent operator.
540
9.61k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
541
9.61k
    _operator_profile->add_child(_common_profile.get(), true);
542
9.61k
    _operator_profile->add_child(_custom_profile.get(), true);
543
9.61k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
544
9.61k
    if constexpr (!is_fake_shared) {
545
9.61k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
546
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
547
0
                                    .first.get()
548
0
                                    ->template cast<SharedStateArg>();
549
550
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
551
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
552
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
553
9.61k
        } else if (info.shared_state) {
554
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
555
                DCHECK(false);
556
            }
557
            // For UnionSourceOperator without children, there is no shared state.
558
9.60k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
559
560
9.60k
            _dependency = _shared_state->create_source_dependency(
561
9.60k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
562
9.60k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
563
9.60k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
564
9.60k
        } else {
565
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
566
                DCHECK(false);
567
            }
568
6
        }
569
9.61k
    }
570
571
9.61k
    if (must_set_shared_state() && _shared_state == nullptr) {
572
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
573
0
    }
574
575
9.61k
    _rows_returned_counter =
576
9.61k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
577
9.61k
    _blocks_returned_counter =
578
9.61k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
579
9.61k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
580
9.61k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
581
9.61k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
582
9.61k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
583
9.61k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
584
9.61k
    _memory_used_counter =
585
9.61k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
586
9.61k
    _common_profile->add_info_string("IsColocate",
587
9.61k
                                     std::to_string(_parent->is_colocated_operator()));
588
9.61k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
589
9.61k
    _common_profile->add_info_string("FollowedByShuffledOperator",
590
9.61k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
591
9.61k
    return Status::OK();
592
9.61k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
533
354
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
534
354
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
535
354
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
536
354
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
537
354
    _operator_profile->set_metadata(_parent->node_id());
538
    // indent is false so that source operator will have same
539
    // indentation_level with its parent operator.
540
354
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
541
354
    _operator_profile->add_child(_common_profile.get(), true);
542
354
    _operator_profile->add_child(_custom_profile.get(), true);
543
354
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
544
354
    if constexpr (!is_fake_shared) {
545
354
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
546
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
547
0
                                    .first.get()
548
0
                                    ->template cast<SharedStateArg>();
549
550
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
551
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
552
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
553
354
        } else if (info.shared_state) {
554
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
555
                DCHECK(false);
556
            }
557
            // For UnionSourceOperator without children, there is no shared state.
558
352
            _shared_state = info.shared_state->template cast<SharedStateArg>();
559
560
352
            _dependency = _shared_state->create_source_dependency(
561
352
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
562
352
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
563
352
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
564
352
        } else {
565
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
566
                DCHECK(false);
567
            }
568
2
        }
569
354
    }
570
571
354
    if (must_set_shared_state() && _shared_state == nullptr) {
572
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
573
0
    }
574
575
354
    _rows_returned_counter =
576
354
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
577
354
    _blocks_returned_counter =
578
354
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
579
354
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
580
354
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
581
354
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
582
354
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
583
354
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
584
354
    _memory_used_counter =
585
354
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
586
354
    _common_profile->add_info_string("IsColocate",
587
354
                                     std::to_string(_parent->is_colocated_operator()));
588
354
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
589
354
    _common_profile->add_info_string("FollowedByShuffledOperator",
590
354
                                     std::to_string(_parent->followed_by_shuffled_operator()));
591
354
    return Status::OK();
592
354
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
533
4.82k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
534
4.82k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
535
4.82k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
536
4.82k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
537
4.82k
    _operator_profile->set_metadata(_parent->node_id());
538
    // indent is false so that source operator will have same
539
    // indentation_level with its parent operator.
540
4.82k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
541
4.82k
    _operator_profile->add_child(_common_profile.get(), true);
542
4.82k
    _operator_profile->add_child(_custom_profile.get(), true);
543
4.82k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
544
4.82k
    if constexpr (!is_fake_shared) {
545
4.82k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
546
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
547
0
                                    .first.get()
548
0
                                    ->template cast<SharedStateArg>();
549
550
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
551
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
552
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
553
4.82k
        } else if (info.shared_state) {
554
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
555
                DCHECK(false);
556
            }
557
            // For UnionSourceOperator without children, there is no shared state.
558
4.80k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
559
560
4.80k
            _dependency = _shared_state->create_source_dependency(
561
4.80k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
562
4.80k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
563
4.80k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
564
4.80k
        } else {
565
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
566
                DCHECK(false);
567
            }
568
20
        }
569
4.82k
    }
570
571
4.82k
    if (must_set_shared_state() && _shared_state == nullptr) {
572
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
573
0
    }
574
575
4.82k
    _rows_returned_counter =
576
4.82k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
577
4.82k
    _blocks_returned_counter =
578
4.82k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
579
4.82k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
580
4.82k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
581
4.82k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
582
4.82k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
583
4.82k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
584
4.82k
    _memory_used_counter =
585
4.82k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
586
4.82k
    _common_profile->add_info_string("IsColocate",
587
4.82k
                                     std::to_string(_parent->is_colocated_operator()));
588
4.82k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
589
4.82k
    _common_profile->add_info_string("FollowedByShuffledOperator",
590
4.82k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
591
4.82k
    return Status::OK();
592
4.82k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
533
751k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
534
751k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
535
751k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
536
751k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
537
751k
    _operator_profile->set_metadata(_parent->node_id());
538
    // indent is false so that source operator will have same
539
    // indentation_level with its parent operator.
540
751k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
541
751k
    _operator_profile->add_child(_common_profile.get(), true);
542
751k
    _operator_profile->add_child(_custom_profile.get(), true);
543
751k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
544
751k
    if constexpr (!is_fake_shared) {
545
752k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
546
752k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
547
752k
                                    .first.get()
548
752k
                                    ->template cast<SharedStateArg>();
549
550
752k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
551
752k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
552
752k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
553
18.4E
        } else if (info.shared_state) {
554
0
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
555
0
                DCHECK(false);
556
0
            }
557
            // For UnionSourceOperator without children, there is no shared state.
558
0
            _shared_state = info.shared_state->template cast<SharedStateArg>();
559
560
0
            _dependency = _shared_state->create_source_dependency(
561
0
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
562
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
563
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
564
18.4E
        } else {
565
18.4E
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
566
18.4E
                DCHECK(false);
567
18.4E
            }
568
18.4E
        }
569
751k
    }
570
571
751k
    if (must_set_shared_state() && _shared_state == nullptr) {
572
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
573
0
    }
574
575
751k
    _rows_returned_counter =
576
751k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
577
751k
    _blocks_returned_counter =
578
751k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
579
751k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
580
751k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
581
751k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
582
751k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
583
751k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
584
751k
    _memory_used_counter =
585
751k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
586
751k
    _common_profile->add_info_string("IsColocate",
587
751k
                                     std::to_string(_parent->is_colocated_operator()));
588
751k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
589
751k
    _common_profile->add_info_string("FollowedByShuffledOperator",
590
751k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
591
751k
    return Status::OK();
592
751k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
533
151
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
534
151
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
535
151
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
536
151
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
537
151
    _operator_profile->set_metadata(_parent->node_id());
538
    // indent is false so that source operator will have same
539
    // indentation_level with its parent operator.
540
151
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
541
151
    _operator_profile->add_child(_common_profile.get(), true);
542
151
    _operator_profile->add_child(_custom_profile.get(), true);
543
151
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
544
151
    if constexpr (!is_fake_shared) {
545
151
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
546
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
547
0
                                    .first.get()
548
0
                                    ->template cast<SharedStateArg>();
549
550
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
551
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
552
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
553
151
        } else if (info.shared_state) {
554
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
555
                DCHECK(false);
556
            }
557
            // For UnionSourceOperator without children, there is no shared state.
558
151
            _shared_state = info.shared_state->template cast<SharedStateArg>();
559
560
151
            _dependency = _shared_state->create_source_dependency(
561
151
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
562
151
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
563
151
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
564
151
        } else {
565
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
566
                DCHECK(false);
567
            }
568
0
        }
569
151
    }
570
571
151
    if (must_set_shared_state() && _shared_state == nullptr) {
572
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
573
0
    }
574
575
151
    _rows_returned_counter =
576
151
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
577
151
    _blocks_returned_counter =
578
151
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
579
151
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
580
151
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
581
151
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
582
151
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
583
151
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
584
151
    _memory_used_counter =
585
151
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
586
151
    _common_profile->add_info_string("IsColocate",
587
151
                                     std::to_string(_parent->is_colocated_operator()));
588
151
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
589
151
    _common_profile->add_info_string("FollowedByShuffledOperator",
590
151
                                     std::to_string(_parent->followed_by_shuffled_operator()));
591
151
    return Status::OK();
592
151
}
593
594
template <typename SharedStateArg>
595
2.52M
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
596
2.52M
    _conjuncts.resize(_parent->_conjuncts.size());
597
2.52M
    _projections.resize(_parent->_projections.size());
598
2.83M
    for (size_t i = 0; i < _conjuncts.size(); i++) {
599
313k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
600
313k
    }
601
4.75M
    for (size_t i = 0; i < _projections.size(); i++) {
602
2.22M
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
603
2.22M
    }
604
2.52M
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
605
2.53M
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
606
7.07k
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
607
44.2k
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
608
37.1k
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
609
37.1k
                    state, _intermediate_projections[i][j]));
610
37.1k
        }
611
7.07k
    }
612
2.52M
    return Status::OK();
613
2.52M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
595
106k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
596
106k
    _conjuncts.resize(_parent->_conjuncts.size());
597
106k
    _projections.resize(_parent->_projections.size());
598
108k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
599
1.92k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
600
1.92k
    }
601
582k
    for (size_t i = 0; i < _projections.size(); i++) {
602
475k
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
603
475k
    }
604
106k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
605
107k
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
606
491
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
607
3.92k
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
608
3.43k
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
609
3.43k
                    state, _intermediate_projections[i][j]));
610
3.43k
        }
611
491
    }
612
106k
    return Status::OK();
613
106k
}
_ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
595
3
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
596
3
    _conjuncts.resize(_parent->_conjuncts.size());
597
3
    _projections.resize(_parent->_projections.size());
598
3
    for (size_t i = 0; i < _conjuncts.size(); i++) {
599
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
600
0
    }
601
3
    for (size_t i = 0; i < _projections.size(); i++) {
602
0
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
603
0
    }
604
3
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
605
3
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
606
0
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
607
0
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
608
0
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
609
0
                    state, _intermediate_projections[i][j]));
610
0
        }
611
0
    }
612
3
    return Status::OK();
613
3
}
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
595
196k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
596
196k
    _conjuncts.resize(_parent->_conjuncts.size());
597
196k
    _projections.resize(_parent->_projections.size());
598
196k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
599
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
600
0
    }
601
197k
    for (size_t i = 0; i < _projections.size(); i++) {
602
283
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
603
283
    }
604
196k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
605
196k
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
606
0
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
607
0
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
608
0
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
609
0
                    state, _intermediate_projections[i][j]));
610
0
        }
611
0
    }
612
196k
    return Status::OK();
613
196k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
595
27
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
596
27
    _conjuncts.resize(_parent->_conjuncts.size());
597
27
    _projections.resize(_parent->_projections.size());
598
27
    for (size_t i = 0; i < _conjuncts.size(); i++) {
599
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
600
0
    }
601
27
    for (size_t i = 0; i < _projections.size(); i++) {
602
0
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
603
0
    }
604
27
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
605
27
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
606
0
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
607
0
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
608
0
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
609
0
                    state, _intermediate_projections[i][j]));
610
0
        }
611
0
    }
612
27
    return Status::OK();
613
27
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
595
10.3k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
596
10.3k
    _conjuncts.resize(_parent->_conjuncts.size());
597
10.3k
    _projections.resize(_parent->_projections.size());
598
10.4k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
599
63
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
600
63
    }
601
58.7k
    for (size_t i = 0; i < _projections.size(); i++) {
602
48.4k
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
603
48.4k
    }
604
10.3k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
605
10.3k
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
606
19
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
607
168
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
608
149
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
609
149
                    state, _intermediate_projections[i][j]));
610
149
        }
611
19
    }
612
10.3k
    return Status::OK();
613
10.3k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
595
7.62k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
596
7.62k
    _conjuncts.resize(_parent->_conjuncts.size());
597
7.62k
    _projections.resize(_parent->_projections.size());
598
8.33k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
599
707
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
600
707
    }
601
20.1k
    for (size_t i = 0; i < _projections.size(); i++) {
602
12.5k
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
603
12.5k
    }
604
7.62k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
605
7.79k
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
606
167
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
607
1.26k
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
608
1.10k
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
609
1.10k
                    state, _intermediate_projections[i][j]));
610
1.10k
        }
611
167
    }
612
7.62k
    return Status::OK();
613
7.62k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
595
112k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
596
112k
    _conjuncts.resize(_parent->_conjuncts.size());
597
112k
    _projections.resize(_parent->_projections.size());
598
114k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
599
1.71k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
600
1.71k
    }
601
360k
    for (size_t i = 0; i < _projections.size(); i++) {
602
247k
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
603
247k
    }
604
112k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
605
112k
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
606
149
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
607
1.06k
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
608
918
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
609
918
                    state, _intermediate_projections[i][j]));
610
918
        }
611
149
    }
612
112k
    return Status::OK();
613
112k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
595
1.53k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
596
1.53k
    _conjuncts.resize(_parent->_conjuncts.size());
597
1.53k
    _projections.resize(_parent->_projections.size());
598
1.53k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
599
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
600
0
    }
601
3.58k
    for (size_t i = 0; i < _projections.size(); i++) {
602
2.05k
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
603
2.05k
    }
604
1.53k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
605
1.53k
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
606
0
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
607
0
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
608
0
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
609
0
                    state, _intermediate_projections[i][j]));
610
0
        }
611
0
    }
612
1.53k
    return Status::OK();
613
1.53k
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
595
1.25M
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
596
1.25M
    _conjuncts.resize(_parent->_conjuncts.size());
597
1.25M
    _projections.resize(_parent->_projections.size());
598
1.56M
    for (size_t i = 0; i < _conjuncts.size(); i++) {
599
306k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
600
306k
    }
601
2.60M
    for (size_t i = 0; i < _projections.size(); i++) {
602
1.34M
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
603
1.34M
    }
604
1.25M
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
605
1.26M
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
606
6.24k
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
607
37.8k
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
608
31.5k
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
609
31.5k
                    state, _intermediate_projections[i][j]));
610
31.5k
        }
611
6.24k
    }
612
1.25M
    return Status::OK();
613
1.25M
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
595
51.9k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
596
51.9k
    _conjuncts.resize(_parent->_conjuncts.size());
597
51.9k
    _projections.resize(_parent->_projections.size());
598
51.9k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
599
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
600
0
    }
601
140k
    for (size_t i = 0; i < _projections.size(); i++) {
602
88.8k
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
603
88.8k
    }
604
51.9k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
605
51.9k
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
606
0
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
607
0
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
608
0
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
609
0
                    state, _intermediate_projections[i][j]));
610
0
        }
611
0
    }
612
51.9k
    return Status::OK();
613
51.9k
}
_ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
595
111
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
596
111
    _conjuncts.resize(_parent->_conjuncts.size());
597
111
    _projections.resize(_parent->_projections.size());
598
111
    for (size_t i = 0; i < _conjuncts.size(); i++) {
599
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
600
0
    }
601
111
    for (size_t i = 0; i < _projections.size(); i++) {
602
0
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
603
0
    }
604
111
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
605
111
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
606
0
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
607
0
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
608
0
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
609
0
                    state, _intermediate_projections[i][j]));
610
0
        }
611
0
    }
612
111
    return Status::OK();
613
111
}
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
595
9.59k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
596
9.59k
    _conjuncts.resize(_parent->_conjuncts.size());
597
9.59k
    _projections.resize(_parent->_projections.size());
598
12.2k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
599
2.65k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
600
2.65k
    }
601
9.59k
    for (size_t i = 0; i < _projections.size(); i++) {
602
0
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
603
0
    }
604
9.59k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
605
9.59k
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
606
0
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
607
0
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
608
0
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
609
0
                    state, _intermediate_projections[i][j]));
610
0
        }
611
0
    }
612
9.59k
    return Status::OK();
613
9.59k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
595
356
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
596
356
    _conjuncts.resize(_parent->_conjuncts.size());
597
356
    _projections.resize(_parent->_projections.size());
598
356
    for (size_t i = 0; i < _conjuncts.size(); i++) {
599
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
600
0
    }
601
356
    for (size_t i = 0; i < _projections.size(); i++) {
602
0
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
603
0
    }
604
356
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
605
356
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
606
0
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
607
0
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
608
0
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
609
0
                    state, _intermediate_projections[i][j]));
610
0
        }
611
0
    }
612
356
    return Status::OK();
613
356
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
595
4.83k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
596
4.83k
    _conjuncts.resize(_parent->_conjuncts.size());
597
4.83k
    _projections.resize(_parent->_projections.size());
598
4.83k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
599
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
600
0
    }
601
4.83k
    for (size_t i = 0; i < _projections.size(); i++) {
602
0
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
603
0
    }
604
4.83k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
605
4.83k
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
606
0
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
607
0
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
608
0
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
609
0
                    state, _intermediate_projections[i][j]));
610
0
        }
611
0
    }
612
4.83k
    return Status::OK();
613
4.83k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
595
763k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
596
763k
    _conjuncts.resize(_parent->_conjuncts.size());
597
763k
    _projections.resize(_parent->_projections.size());
598
763k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
599
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
600
0
    }
601
763k
    for (size_t i = 0; i < _projections.size(); i++) {
602
0
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
603
0
    }
604
763k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
605
763k
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
606
0
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
607
0
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
608
0
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
609
0
                    state, _intermediate_projections[i][j]));
610
0
        }
611
0
    }
612
763k
    return Status::OK();
613
763k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE4openEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
595
151
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
596
151
    _conjuncts.resize(_parent->_conjuncts.size());
597
151
    _projections.resize(_parent->_projections.size());
598
158
    for (size_t i = 0; i < _conjuncts.size(); i++) {
599
7
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
600
7
    }
601
447
    for (size_t i = 0; i < _projections.size(); i++) {
602
296
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
603
296
    }
604
151
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
605
152
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
606
1
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
607
3
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
608
2
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
609
2
                    state, _intermediate_projections[i][j]));
610
2
        }
611
1
    }
612
151
    return Status::OK();
613
151
}
614
615
template <typename SharedStateArg>
616
6.39k
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
617
6.39k
    if (_terminated) {
618
2
        return Status::OK();
619
2
    }
620
6.39k
    _terminated = true;
621
6.39k
    return Status::OK();
622
6.39k
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
616
412
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
617
412
    if (_terminated) {
618
0
        return Status::OK();
619
0
    }
620
412
    _terminated = true;
621
412
    return Status::OK();
622
412
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
616
296
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
617
296
    if (_terminated) {
618
0
        return Status::OK();
619
0
    }
620
296
    _terminated = true;
621
296
    return Status::OK();
622
296
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
616
103
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
617
103
    if (_terminated) {
618
0
        return Status::OK();
619
0
    }
620
103
    _terminated = true;
621
103
    return Status::OK();
622
103
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
616
1
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
617
1
    if (_terminated) {
618
0
        return Status::OK();
619
0
    }
620
1
    _terminated = true;
621
1
    return Status::OK();
622
1
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
616
222
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
617
222
    if (_terminated) {
618
0
        return Status::OK();
619
0
    }
620
222
    _terminated = true;
621
222
    return Status::OK();
622
222
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
616
4.24k
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
617
4.24k
    if (_terminated) {
618
1
        return Status::OK();
619
1
    }
620
4.23k
    _terminated = true;
621
4.23k
    return Status::OK();
622
4.24k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
616
9
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
617
9
    if (_terminated) {
618
0
        return Status::OK();
619
0
    }
620
9
    _terminated = true;
621
9
    return Status::OK();
622
9
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
616
7
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
617
7
    if (_terminated) {
618
0
        return Status::OK();
619
0
    }
620
7
    _terminated = true;
621
7
    return Status::OK();
622
7
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
616
5
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
617
5
    if (_terminated) {
618
0
        return Status::OK();
619
0
    }
620
5
    _terminated = true;
621
5
    return Status::OK();
622
5
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
616
1.08k
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
617
1.08k
    if (_terminated) {
618
1
        return Status::OK();
619
1
    }
620
1.08k
    _terminated = true;
621
1.08k
    return Status::OK();
622
1.08k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
616
12
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
617
12
    if (_terminated) {
618
0
        return Status::OK();
619
0
    }
620
12
    _terminated = true;
621
12
    return Status::OK();
622
12
}
623
624
template <typename SharedStateArg>
625
2.74M
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
626
2.74M
    if (_closed) {
627
225k
        return Status::OK();
628
225k
    }
629
2.52M
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
630
1.26M
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
631
1.26M
    }
632
2.52M
    _closed = true;
633
2.52M
    return Status::OK();
634
2.74M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
625
106k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
626
106k
    if (_closed) {
627
0
        return Status::OK();
628
0
    }
629
106k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
630
106k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
631
106k
    }
632
106k
    _closed = true;
633
106k
    return Status::OK();
634
106k
}
_ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
625
3
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
626
3
    if (_closed) {
627
0
        return Status::OK();
628
0
    }
629
3
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
630
3
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
631
3
    }
632
3
    _closed = true;
633
3
    return Status::OK();
634
3
}
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
625
391k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
626
391k
    if (_closed) {
627
195k
        return Status::OK();
628
195k
    }
629
195k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
630
195k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
631
195k
    }
632
195k
    _closed = true;
633
195k
    return Status::OK();
634
391k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
625
27
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
626
27
    if (_closed) {
627
0
        return Status::OK();
628
0
    }
629
27
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
630
27
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
631
27
    }
632
27
    _closed = true;
633
27
    return Status::OK();
634
27
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
625
10.3k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
626
10.3k
    if (_closed) {
627
0
        return Status::OK();
628
0
    }
629
10.3k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
630
10.3k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
631
10.3k
    }
632
10.3k
    _closed = true;
633
10.3k
    return Status::OK();
634
10.3k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
625
15.2k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
626
15.2k
    if (_closed) {
627
7.69k
        return Status::OK();
628
7.69k
    }
629
7.60k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
630
7.60k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
631
7.60k
    }
632
7.60k
    _closed = true;
633
7.60k
    return Status::OK();
634
15.2k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
625
111k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
626
111k
    if (_closed) {
627
0
        return Status::OK();
628
0
    }
629
111k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
630
111k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
631
111k
    }
632
111k
    _closed = true;
633
111k
    return Status::OK();
634
111k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
625
1.52k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
626
1.52k
    if (_closed) {
627
0
        return Status::OK();
628
0
    }
629
1.52k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
630
1.52k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
631
1.52k
    }
632
1.52k
    _closed = true;
633
1.52k
    return Status::OK();
634
1.52k
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
625
1.27M
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
626
1.27M
    if (_closed) {
627
16.3k
        return Status::OK();
628
16.3k
    }
629
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
630
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
631
    }
632
1.25M
    _closed = true;
633
1.25M
    return Status::OK();
634
1.27M
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
625
52.0k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
626
52.0k
    if (_closed) {
627
0
        return Status::OK();
628
0
    }
629
52.0k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
630
52.0k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
631
52.0k
    }
632
52.0k
    _closed = true;
633
52.0k
    return Status::OK();
634
52.0k
}
_ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
625
216
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
626
216
    if (_closed) {
627
108
        return Status::OK();
628
108
    }
629
108
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
630
108
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
631
108
    }
632
108
    _closed = true;
633
108
    return Status::OK();
634
216
}
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
625
9.54k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
626
9.54k
    if (_closed) {
627
0
        return Status::OK();
628
0
    }
629
9.54k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
630
9.54k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
631
9.54k
    }
632
9.54k
    _closed = true;
633
9.54k
    return Status::OK();
634
9.54k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
625
507
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
626
507
    if (_closed) {
627
254
        return Status::OK();
628
254
    }
629
253
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
630
253
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
631
253
    }
632
253
    _closed = true;
633
253
    return Status::OK();
634
507
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
625
9.67k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
626
9.67k
    if (_closed) {
627
4.85k
        return Status::OK();
628
4.85k
    }
629
4.81k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
630
4.81k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
631
4.81k
    }
632
4.81k
    _closed = true;
633
4.81k
    return Status::OK();
634
9.67k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
625
765k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
626
765k
    if (_closed) {
627
0
        return Status::OK();
628
0
    }
629
765k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
630
765k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
631
765k
    }
632
765k
    _closed = true;
633
765k
    return Status::OK();
634
765k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE5closeEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
625
304
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
626
304
    if (_closed) {
627
162
        return Status::OK();
628
162
    }
629
142
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
630
142
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
631
142
    }
632
142
    _closed = true;
633
142
    return Status::OK();
634
304
}
635
636
template <typename SharedState>
637
1.91M
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
638
    // create profile
639
1.91M
    _operator_profile =
640
1.91M
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
641
1.91M
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
642
1.91M
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
643
644
    // indentation is true
645
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
646
    // So we should set the indentation to true.
647
1.91M
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
648
1.91M
    _operator_profile->add_child(_common_profile, true);
649
1.91M
    _operator_profile->add_child(_custom_profile, true);
650
651
1.91M
    _operator_profile->set_metadata(_parent->node_id());
652
1.91M
    _wait_for_finish_dependency_timer =
653
1.91M
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
654
1.91M
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
655
1.91M
    if constexpr (!is_fake_shared) {
656
1.29M
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
657
1.29M
            info.shared_state_map.end()) {
658
336k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
659
325k
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
660
325k
            }
661
336k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
662
336k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
663
336k
                                                  ? 0
664
336k
                                                  : info.task_idx]
665
336k
                                  .get();
666
336k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
667
956k
        } else {
668
18.4E
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
669
18.4E
                DCHECK(false);
670
18.4E
            }
671
956k
            _shared_state = info.shared_state->template cast<SharedState>();
672
956k
            _dependency = _shared_state->create_sink_dependency(
673
956k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
674
956k
        }
675
1.29M
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
676
1.29M
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
677
1.29M
    }
678
679
1.91M
    if (must_set_shared_state() && _shared_state == nullptr) {
680
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
681
0
    }
682
683
1.91M
    _rows_input_counter =
684
1.91M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
685
1.91M
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
686
1.91M
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
687
1.91M
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
688
1.91M
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
689
1.91M
    _memory_used_counter =
690
1.91M
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
691
1.91M
    _common_profile->add_info_string("IsColocate",
692
1.91M
                                     std::to_string(_parent->is_colocated_operator()));
693
1.91M
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
694
1.91M
    _common_profile->add_info_string("FollowedByShuffledOperator",
695
1.91M
                                     std::to_string(_parent->followed_by_shuffled_operator()));
696
1.91M
    return Status::OK();
697
1.91M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
637
154k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
638
    // create profile
639
154k
    _operator_profile =
640
154k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
641
154k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
642
154k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
643
644
    // indentation is true
645
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
646
    // So we should set the indentation to true.
647
154k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
648
154k
    _operator_profile->add_child(_common_profile, true);
649
154k
    _operator_profile->add_child(_custom_profile, true);
650
651
154k
    _operator_profile->set_metadata(_parent->node_id());
652
154k
    _wait_for_finish_dependency_timer =
653
154k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
654
154k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
655
154k
    if constexpr (!is_fake_shared) {
656
154k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
657
154k
            info.shared_state_map.end()) {
658
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
659
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
660
            }
661
9.58k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
662
9.58k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
663
9.58k
                                                  ? 0
664
9.58k
                                                  : info.task_idx]
665
9.58k
                                  .get();
666
9.58k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
667
144k
        } else {
668
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
669
                DCHECK(false);
670
            }
671
144k
            _shared_state = info.shared_state->template cast<SharedState>();
672
144k
            _dependency = _shared_state->create_sink_dependency(
673
144k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
674
144k
        }
675
154k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
676
154k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
677
154k
    }
678
679
154k
    if (must_set_shared_state() && _shared_state == nullptr) {
680
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
681
0
    }
682
683
154k
    _rows_input_counter =
684
154k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
685
154k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
686
154k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
687
154k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
688
154k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
689
154k
    _memory_used_counter =
690
154k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
691
154k
    _common_profile->add_info_string("IsColocate",
692
154k
                                     std::to_string(_parent->is_colocated_operator()));
693
154k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
694
154k
    _common_profile->add_info_string("FollowedByShuffledOperator",
695
154k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
696
154k
    return Status::OK();
697
154k
}
_ZN5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
637
2
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
638
    // create profile
639
2
    _operator_profile =
640
2
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
641
2
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
642
2
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
643
644
    // indentation is true
645
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
646
    // So we should set the indentation to true.
647
2
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
648
2
    _operator_profile->add_child(_common_profile, true);
649
2
    _operator_profile->add_child(_custom_profile, true);
650
651
2
    _operator_profile->set_metadata(_parent->node_id());
652
2
    _wait_for_finish_dependency_timer =
653
2
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
654
2
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
655
2
    if constexpr (!is_fake_shared) {
656
2
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
657
2
            info.shared_state_map.end()) {
658
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
659
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
660
            }
661
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
662
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
663
0
                                                  ? 0
664
0
                                                  : info.task_idx]
665
0
                                  .get();
666
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
667
2
        } else {
668
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
669
                DCHECK(false);
670
            }
671
2
            _shared_state = info.shared_state->template cast<SharedState>();
672
2
            _dependency = _shared_state->create_sink_dependency(
673
2
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
674
2
        }
675
2
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
676
2
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
677
2
    }
678
679
2
    if (must_set_shared_state() && _shared_state == nullptr) {
680
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
681
0
    }
682
683
2
    _rows_input_counter =
684
2
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
685
2
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
686
2
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
687
2
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
688
2
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
689
2
    _memory_used_counter =
690
2
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
691
2
    _common_profile->add_info_string("IsColocate",
692
2
                                     std::to_string(_parent->is_colocated_operator()));
693
2
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
694
2
    _common_profile->add_info_string("FollowedByShuffledOperator",
695
2
                                     std::to_string(_parent->followed_by_shuffled_operator()));
696
2
    return Status::OK();
697
2
}
_ZN5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
637
195k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
638
    // create profile
639
195k
    _operator_profile =
640
195k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
641
195k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
642
195k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
643
644
    // indentation is true
645
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
646
    // So we should set the indentation to true.
647
195k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
648
195k
    _operator_profile->add_child(_common_profile, true);
649
195k
    _operator_profile->add_child(_custom_profile, true);
650
651
195k
    _operator_profile->set_metadata(_parent->node_id());
652
195k
    _wait_for_finish_dependency_timer =
653
195k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
654
195k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
655
195k
    if constexpr (!is_fake_shared) {
656
195k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
657
195k
            info.shared_state_map.end()) {
658
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
659
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
660
            }
661
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
662
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
663
0
                                                  ? 0
664
0
                                                  : info.task_idx]
665
0
                                  .get();
666
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
667
195k
        } else {
668
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
669
                DCHECK(false);
670
            }
671
195k
            _shared_state = info.shared_state->template cast<SharedState>();
672
195k
            _dependency = _shared_state->create_sink_dependency(
673
195k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
674
195k
        }
675
195k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
676
195k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
677
195k
    }
678
679
195k
    if (must_set_shared_state() && _shared_state == nullptr) {
680
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
681
0
    }
682
683
195k
    _rows_input_counter =
684
195k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
685
195k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
686
195k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
687
195k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
688
195k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
689
195k
    _memory_used_counter =
690
195k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
691
195k
    _common_profile->add_info_string("IsColocate",
692
195k
                                     std::to_string(_parent->is_colocated_operator()));
693
195k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
694
195k
    _common_profile->add_info_string("FollowedByShuffledOperator",
695
195k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
696
195k
    return Status::OK();
697
195k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
637
33
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
638
    // create profile
639
33
    _operator_profile =
640
33
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
641
33
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
642
33
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
643
644
    // indentation is true
645
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
646
    // So we should set the indentation to true.
647
33
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
648
33
    _operator_profile->add_child(_common_profile, true);
649
33
    _operator_profile->add_child(_custom_profile, true);
650
651
33
    _operator_profile->set_metadata(_parent->node_id());
652
33
    _wait_for_finish_dependency_timer =
653
33
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
654
33
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
655
33
    if constexpr (!is_fake_shared) {
656
33
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
657
33
            info.shared_state_map.end()) {
658
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
659
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
660
            }
661
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
662
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
663
0
                                                  ? 0
664
0
                                                  : info.task_idx]
665
0
                                  .get();
666
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
667
33
        } else {
668
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
669
                DCHECK(false);
670
            }
671
33
            _shared_state = info.shared_state->template cast<SharedState>();
672
33
            _dependency = _shared_state->create_sink_dependency(
673
33
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
674
33
        }
675
33
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
676
33
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
677
33
    }
678
679
33
    if (must_set_shared_state() && _shared_state == nullptr) {
680
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
681
0
    }
682
683
33
    _rows_input_counter =
684
33
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
685
33
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
686
33
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
687
33
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
688
33
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
689
33
    _memory_used_counter =
690
33
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
691
33
    _common_profile->add_info_string("IsColocate",
692
33
                                     std::to_string(_parent->is_colocated_operator()));
693
33
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
694
33
    _common_profile->add_info_string("FollowedByShuffledOperator",
695
33
                                     std::to_string(_parent->followed_by_shuffled_operator()));
696
33
    return Status::OK();
697
33
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
637
10.3k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
638
    // create profile
639
10.3k
    _operator_profile =
640
10.3k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
641
10.3k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
642
10.3k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
643
644
    // indentation is true
645
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
646
    // So we should set the indentation to true.
647
10.3k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
648
10.3k
    _operator_profile->add_child(_common_profile, true);
649
10.3k
    _operator_profile->add_child(_custom_profile, true);
650
651
10.3k
    _operator_profile->set_metadata(_parent->node_id());
652
10.3k
    _wait_for_finish_dependency_timer =
653
10.3k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
654
10.3k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
655
10.3k
    if constexpr (!is_fake_shared) {
656
10.3k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
657
10.3k
            info.shared_state_map.end()) {
658
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
659
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
660
            }
661
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
662
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
663
0
                                                  ? 0
664
0
                                                  : info.task_idx]
665
0
                                  .get();
666
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
667
10.3k
        } else {
668
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
669
                DCHECK(false);
670
            }
671
10.3k
            _shared_state = info.shared_state->template cast<SharedState>();
672
10.3k
            _dependency = _shared_state->create_sink_dependency(
673
10.3k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
674
10.3k
        }
675
10.3k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
676
10.3k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
677
10.3k
    }
678
679
10.3k
    if (must_set_shared_state() && _shared_state == nullptr) {
680
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
681
0
    }
682
683
10.3k
    _rows_input_counter =
684
10.3k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
685
10.3k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
686
10.3k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
687
10.3k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
688
10.3k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
689
10.3k
    _memory_used_counter =
690
10.3k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
691
10.3k
    _common_profile->add_info_string("IsColocate",
692
10.3k
                                     std::to_string(_parent->is_colocated_operator()));
693
10.3k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
694
10.3k
    _common_profile->add_info_string("FollowedByShuffledOperator",
695
10.3k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
696
10.3k
    return Status::OK();
697
10.3k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
637
7.59k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
638
    // create profile
639
7.59k
    _operator_profile =
640
7.59k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
641
7.59k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
642
7.59k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
643
644
    // indentation is true
645
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
646
    // So we should set the indentation to true.
647
7.59k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
648
7.59k
    _operator_profile->add_child(_common_profile, true);
649
7.59k
    _operator_profile->add_child(_custom_profile, true);
650
651
7.59k
    _operator_profile->set_metadata(_parent->node_id());
652
7.59k
    _wait_for_finish_dependency_timer =
653
7.59k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
654
7.59k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
655
7.59k
    if constexpr (!is_fake_shared) {
656
7.59k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
657
7.59k
            info.shared_state_map.end()) {
658
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
659
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
660
            }
661
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
662
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
663
0
                                                  ? 0
664
0
                                                  : info.task_idx]
665
0
                                  .get();
666
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
667
7.59k
        } else {
668
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
669
                DCHECK(false);
670
            }
671
7.59k
            _shared_state = info.shared_state->template cast<SharedState>();
672
7.59k
            _dependency = _shared_state->create_sink_dependency(
673
7.59k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
674
7.59k
        }
675
7.59k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
676
7.59k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
677
7.59k
    }
678
679
7.59k
    if (must_set_shared_state() && _shared_state == nullptr) {
680
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
681
0
    }
682
683
7.59k
    _rows_input_counter =
684
7.59k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
685
7.59k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
686
7.59k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
687
7.59k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
688
7.59k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
689
7.59k
    _memory_used_counter =
690
7.59k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
691
7.59k
    _common_profile->add_info_string("IsColocate",
692
7.59k
                                     std::to_string(_parent->is_colocated_operator()));
693
7.59k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
694
7.59k
    _common_profile->add_info_string("FollowedByShuffledOperator",
695
7.59k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
696
7.59k
    return Status::OK();
697
7.59k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
637
112k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
638
    // create profile
639
112k
    _operator_profile =
640
112k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
641
112k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
642
112k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
643
644
    // indentation is true
645
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
646
    // So we should set the indentation to true.
647
112k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
648
112k
    _operator_profile->add_child(_common_profile, true);
649
112k
    _operator_profile->add_child(_custom_profile, true);
650
651
112k
    _operator_profile->set_metadata(_parent->node_id());
652
112k
    _wait_for_finish_dependency_timer =
653
112k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
654
112k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
655
112k
    if constexpr (!is_fake_shared) {
656
112k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
657
112k
            info.shared_state_map.end()) {
658
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
659
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
660
            }
661
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
662
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
663
0
                                                  ? 0
664
0
                                                  : info.task_idx]
665
0
                                  .get();
666
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
667
112k
        } else {
668
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
669
                DCHECK(false);
670
            }
671
112k
            _shared_state = info.shared_state->template cast<SharedState>();
672
112k
            _dependency = _shared_state->create_sink_dependency(
673
112k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
674
112k
        }
675
112k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
676
112k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
677
112k
    }
678
679
112k
    if (must_set_shared_state() && _shared_state == nullptr) {
680
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
681
0
    }
682
683
112k
    _rows_input_counter =
684
112k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
685
112k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
686
112k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
687
112k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
688
112k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
689
112k
    _memory_used_counter =
690
112k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
691
112k
    _common_profile->add_info_string("IsColocate",
692
112k
                                     std::to_string(_parent->is_colocated_operator()));
693
112k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
694
112k
    _common_profile->add_info_string("FollowedByShuffledOperator",
695
112k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
696
112k
    return Status::OK();
697
112k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
637
1.53k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
638
    // create profile
639
1.53k
    _operator_profile =
640
1.53k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
641
1.53k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
642
1.53k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
643
644
    // indentation is true
645
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
646
    // So we should set the indentation to true.
647
1.53k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
648
1.53k
    _operator_profile->add_child(_common_profile, true);
649
1.53k
    _operator_profile->add_child(_custom_profile, true);
650
651
1.53k
    _operator_profile->set_metadata(_parent->node_id());
652
1.53k
    _wait_for_finish_dependency_timer =
653
1.53k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
654
1.53k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
655
1.53k
    if constexpr (!is_fake_shared) {
656
1.53k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
657
1.53k
            info.shared_state_map.end()) {
658
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
659
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
660
            }
661
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
662
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
663
0
                                                  ? 0
664
0
                                                  : info.task_idx]
665
0
                                  .get();
666
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
667
1.53k
        } else {
668
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
669
                DCHECK(false);
670
            }
671
1.53k
            _shared_state = info.shared_state->template cast<SharedState>();
672
1.53k
            _dependency = _shared_state->create_sink_dependency(
673
1.53k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
674
1.53k
        }
675
1.53k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
676
1.53k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
677
1.53k
    }
678
679
1.53k
    if (must_set_shared_state() && _shared_state == nullptr) {
680
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
681
0
    }
682
683
1.53k
    _rows_input_counter =
684
1.53k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
685
1.53k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
686
1.53k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
687
1.53k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
688
1.53k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
689
1.53k
    _memory_used_counter =
690
1.53k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
691
1.53k
    _common_profile->add_info_string("IsColocate",
692
1.53k
                                     std::to_string(_parent->is_colocated_operator()));
693
1.53k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
694
1.53k
    _common_profile->add_info_string("FollowedByShuffledOperator",
695
1.53k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
696
1.53k
    return Status::OK();
697
1.53k
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
637
617k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
638
    // create profile
639
617k
    _operator_profile =
640
617k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
641
617k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
642
617k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
643
644
    // indentation is true
645
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
646
    // So we should set the indentation to true.
647
617k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
648
617k
    _operator_profile->add_child(_common_profile, true);
649
617k
    _operator_profile->add_child(_custom_profile, true);
650
651
617k
    _operator_profile->set_metadata(_parent->node_id());
652
617k
    _wait_for_finish_dependency_timer =
653
617k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
654
617k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
655
    if constexpr (!is_fake_shared) {
656
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
657
            info.shared_state_map.end()) {
658
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
659
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
660
            }
661
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
662
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
663
                                                  ? 0
664
                                                  : info.task_idx]
665
                                  .get();
666
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
667
        } else {
668
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
669
                DCHECK(false);
670
            }
671
            _shared_state = info.shared_state->template cast<SharedState>();
672
            _dependency = _shared_state->create_sink_dependency(
673
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
674
        }
675
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
676
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
677
    }
678
679
617k
    if (must_set_shared_state() && _shared_state == nullptr) {
680
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
681
0
    }
682
683
617k
    _rows_input_counter =
684
617k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
685
617k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
686
617k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
687
617k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
688
617k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
689
617k
    _memory_used_counter =
690
617k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
691
617k
    _common_profile->add_info_string("IsColocate",
692
617k
                                     std::to_string(_parent->is_colocated_operator()));
693
617k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
694
617k
    _common_profile->add_info_string("FollowedByShuffledOperator",
695
617k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
696
617k
    return Status::OK();
697
617k
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
637
9.63k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
638
    // create profile
639
9.63k
    _operator_profile =
640
9.63k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
641
9.63k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
642
9.63k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
643
644
    // indentation is true
645
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
646
    // So we should set the indentation to true.
647
9.63k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
648
9.63k
    _operator_profile->add_child(_common_profile, true);
649
9.63k
    _operator_profile->add_child(_custom_profile, true);
650
651
9.63k
    _operator_profile->set_metadata(_parent->node_id());
652
9.63k
    _wait_for_finish_dependency_timer =
653
9.63k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
654
9.63k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
655
9.63k
    if constexpr (!is_fake_shared) {
656
9.63k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
657
9.63k
            info.shared_state_map.end()) {
658
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
659
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
660
            }
661
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
662
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
663
0
                                                  ? 0
664
0
                                                  : info.task_idx]
665
0
                                  .get();
666
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
667
9.63k
        } else {
668
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
669
                DCHECK(false);
670
            }
671
9.63k
            _shared_state = info.shared_state->template cast<SharedState>();
672
9.63k
            _dependency = _shared_state->create_sink_dependency(
673
9.63k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
674
9.63k
        }
675
9.63k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
676
9.63k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
677
9.63k
    }
678
679
9.63k
    if (must_set_shared_state() && _shared_state == nullptr) {
680
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
681
0
    }
682
683
9.63k
    _rows_input_counter =
684
9.63k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
685
9.63k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
686
9.63k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
687
9.63k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
688
9.63k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
689
9.63k
    _memory_used_counter =
690
9.63k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
691
9.63k
    _common_profile->add_info_string("IsColocate",
692
9.63k
                                     std::to_string(_parent->is_colocated_operator()));
693
9.63k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
694
9.63k
    _common_profile->add_info_string("FollowedByShuffledOperator",
695
9.63k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
696
9.63k
    return Status::OK();
697
9.63k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
637
356
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
638
    // create profile
639
356
    _operator_profile =
640
356
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
641
356
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
642
356
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
643
644
    // indentation is true
645
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
646
    // So we should set the indentation to true.
647
356
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
648
356
    _operator_profile->add_child(_common_profile, true);
649
356
    _operator_profile->add_child(_custom_profile, true);
650
651
356
    _operator_profile->set_metadata(_parent->node_id());
652
356
    _wait_for_finish_dependency_timer =
653
356
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
654
356
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
655
356
    if constexpr (!is_fake_shared) {
656
356
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
657
356
            info.shared_state_map.end()) {
658
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
659
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
660
            }
661
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
662
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
663
0
                                                  ? 0
664
0
                                                  : info.task_idx]
665
0
                                  .get();
666
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
667
356
        } else {
668
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
669
                DCHECK(false);
670
            }
671
356
            _shared_state = info.shared_state->template cast<SharedState>();
672
356
            _dependency = _shared_state->create_sink_dependency(
673
356
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
674
356
        }
675
356
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
676
356
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
677
356
    }
678
679
356
    if (must_set_shared_state() && _shared_state == nullptr) {
680
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
681
0
    }
682
683
356
    _rows_input_counter =
684
356
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
685
356
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
686
356
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
687
356
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
688
356
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
689
356
    _memory_used_counter =
690
356
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
691
356
    _common_profile->add_info_string("IsColocate",
692
356
                                     std::to_string(_parent->is_colocated_operator()));
693
356
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
694
356
    _common_profile->add_info_string("FollowedByShuffledOperator",
695
356
                                     std::to_string(_parent->followed_by_shuffled_operator()));
696
356
    return Status::OK();
697
356
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
637
3.84k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
638
    // create profile
639
3.84k
    _operator_profile =
640
3.84k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
641
3.84k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
642
3.84k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
643
644
    // indentation is true
645
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
646
    // So we should set the indentation to true.
647
3.84k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
648
3.84k
    _operator_profile->add_child(_common_profile, true);
649
3.84k
    _operator_profile->add_child(_custom_profile, true);
650
651
3.84k
    _operator_profile->set_metadata(_parent->node_id());
652
3.84k
    _wait_for_finish_dependency_timer =
653
3.84k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
654
3.84k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
655
3.84k
    if constexpr (!is_fake_shared) {
656
3.84k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
657
3.84k
            info.shared_state_map.end()) {
658
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
659
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
660
            }
661
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
662
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
663
0
                                                  ? 0
664
0
                                                  : info.task_idx]
665
0
                                  .get();
666
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
667
3.84k
        } else {
668
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
669
                DCHECK(false);
670
            }
671
3.84k
            _shared_state = info.shared_state->template cast<SharedState>();
672
3.84k
            _dependency = _shared_state->create_sink_dependency(
673
3.84k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
674
3.84k
        }
675
3.84k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
676
3.84k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
677
3.84k
    }
678
679
3.84k
    if (must_set_shared_state() && _shared_state == nullptr) {
680
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
681
0
    }
682
683
3.84k
    _rows_input_counter =
684
3.84k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
685
3.84k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
686
3.84k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
687
3.84k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
688
3.84k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
689
3.84k
    _memory_used_counter =
690
3.84k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
691
3.84k
    _common_profile->add_info_string("IsColocate",
692
3.84k
                                     std::to_string(_parent->is_colocated_operator()));
693
3.84k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
694
3.84k
    _common_profile->add_info_string("FollowedByShuffledOperator",
695
3.84k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
696
3.84k
    return Status::OK();
697
3.84k
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
637
11.9k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
638
    // create profile
639
11.9k
    _operator_profile =
640
11.9k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
641
11.9k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
642
11.9k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
643
644
    // indentation is true
645
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
646
    // So we should set the indentation to true.
647
11.9k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
648
11.9k
    _operator_profile->add_child(_common_profile, true);
649
11.9k
    _operator_profile->add_child(_custom_profile, true);
650
651
11.9k
    _operator_profile->set_metadata(_parent->node_id());
652
11.9k
    _wait_for_finish_dependency_timer =
653
11.9k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
654
11.9k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
655
11.9k
    if constexpr (!is_fake_shared) {
656
11.9k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
657
11.9k
            info.shared_state_map.end()) {
658
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
659
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
660
            }
661
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
662
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
663
0
                                                  ? 0
664
0
                                                  : info.task_idx]
665
0
                                  .get();
666
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
667
11.9k
        } else {
668
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
669
                DCHECK(false);
670
            }
671
11.9k
            _shared_state = info.shared_state->template cast<SharedState>();
672
11.9k
            _dependency = _shared_state->create_sink_dependency(
673
11.9k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
674
11.9k
        }
675
11.9k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
676
11.9k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
677
11.9k
    }
678
679
11.9k
    if (must_set_shared_state() && _shared_state == nullptr) {
680
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
681
0
    }
682
683
11.9k
    _rows_input_counter =
684
11.9k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
685
11.9k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
686
11.9k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
687
11.9k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
688
11.9k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
689
11.9k
    _memory_used_counter =
690
11.9k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
691
11.9k
    _common_profile->add_info_string("IsColocate",
692
11.9k
                                     std::to_string(_parent->is_colocated_operator()));
693
11.9k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
694
11.9k
    _common_profile->add_info_string("FollowedByShuffledOperator",
695
11.9k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
696
11.9k
    return Status::OK();
697
11.9k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
637
325k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
638
    // create profile
639
325k
    _operator_profile =
640
325k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
641
325k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
642
325k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
643
644
    // indentation is true
645
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
646
    // So we should set the indentation to true.
647
325k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
648
325k
    _operator_profile->add_child(_common_profile, true);
649
325k
    _operator_profile->add_child(_custom_profile, true);
650
651
325k
    _operator_profile->set_metadata(_parent->node_id());
652
325k
    _wait_for_finish_dependency_timer =
653
325k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
654
325k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
655
325k
    if constexpr (!is_fake_shared) {
656
325k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
657
325k
            info.shared_state_map.end()) {
658
325k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
659
325k
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
660
325k
            }
661
325k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
662
325k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
663
325k
                                                  ? 0
664
325k
                                                  : info.task_idx]
665
325k
                                  .get();
666
325k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
667
18.4E
        } else {
668
18.4E
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
669
18.4E
                DCHECK(false);
670
18.4E
            }
671
18.4E
            _shared_state = info.shared_state->template cast<SharedState>();
672
18.4E
            _dependency = _shared_state->create_sink_dependency(
673
18.4E
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
674
18.4E
        }
675
325k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
676
325k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
677
325k
    }
678
679
325k
    if (must_set_shared_state() && _shared_state == nullptr) {
680
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
681
0
    }
682
683
325k
    _rows_input_counter =
684
325k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
685
325k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
686
325k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
687
325k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
688
325k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
689
325k
    _memory_used_counter =
690
325k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
691
325k
    _common_profile->add_info_string("IsColocate",
692
325k
                                     std::to_string(_parent->is_colocated_operator()));
693
325k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
694
325k
    _common_profile->add_info_string("FollowedByShuffledOperator",
695
325k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
696
325k
    return Status::OK();
697
325k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
637
459k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
638
    // create profile
639
459k
    _operator_profile =
640
459k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
641
459k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
642
459k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
643
644
    // indentation is true
645
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
646
    // So we should set the indentation to true.
647
459k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
648
459k
    _operator_profile->add_child(_common_profile, true);
649
459k
    _operator_profile->add_child(_custom_profile, true);
650
651
459k
    _operator_profile->set_metadata(_parent->node_id());
652
459k
    _wait_for_finish_dependency_timer =
653
459k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
654
459k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
655
459k
    if constexpr (!is_fake_shared) {
656
459k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
657
459k
            info.shared_state_map.end()) {
658
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
659
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
660
            }
661
1.06k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
662
1.06k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
663
1.06k
                                                  ? 0
664
1.06k
                                                  : info.task_idx]
665
1.06k
                                  .get();
666
1.06k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
667
458k
        } else {
668
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
669
                DCHECK(false);
670
            }
671
458k
            _shared_state = info.shared_state->template cast<SharedState>();
672
458k
            _dependency = _shared_state->create_sink_dependency(
673
458k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
674
458k
        }
675
459k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
676
459k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
677
459k
    }
678
679
459k
    if (must_set_shared_state() && _shared_state == nullptr) {
680
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
681
0
    }
682
683
459k
    _rows_input_counter =
684
459k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
685
459k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
686
459k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
687
459k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
688
459k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
689
459k
    _memory_used_counter =
690
459k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
691
459k
    _common_profile->add_info_string("IsColocate",
692
459k
                                     std::to_string(_parent->is_colocated_operator()));
693
459k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
694
459k
    _common_profile->add_info_string("FollowedByShuffledOperator",
695
459k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
696
459k
    return Status::OK();
697
459k
}
_ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
637
111
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
638
    // create profile
639
111
    _operator_profile =
640
111
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
641
111
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
642
111
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
643
644
    // indentation is true
645
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
646
    // So we should set the indentation to true.
647
111
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
648
111
    _operator_profile->add_child(_common_profile, true);
649
111
    _operator_profile->add_child(_custom_profile, true);
650
651
111
    _operator_profile->set_metadata(_parent->node_id());
652
111
    _wait_for_finish_dependency_timer =
653
111
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
654
111
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
655
111
    if constexpr (!is_fake_shared) {
656
111
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
657
111
            info.shared_state_map.end()) {
658
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
659
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
660
            }
661
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
662
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
663
0
                                                  ? 0
664
0
                                                  : info.task_idx]
665
0
                                  .get();
666
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
667
111
        } else {
668
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
669
                DCHECK(false);
670
            }
671
111
            _shared_state = info.shared_state->template cast<SharedState>();
672
111
            _dependency = _shared_state->create_sink_dependency(
673
111
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
674
111
        }
675
111
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
676
111
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
677
111
    }
678
679
111
    if (must_set_shared_state() && _shared_state == nullptr) {
680
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
681
0
    }
682
683
111
    _rows_input_counter =
684
111
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
685
111
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
686
111
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
687
111
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
688
111
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
689
111
    _memory_used_counter =
690
111
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
691
111
    _common_profile->add_info_string("IsColocate",
692
111
                                     std::to_string(_parent->is_colocated_operator()));
693
111
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
694
111
    _common_profile->add_info_string("FollowedByShuffledOperator",
695
111
                                     std::to_string(_parent->followed_by_shuffled_operator()));
696
111
    return Status::OK();
697
111
}
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
637
302
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
638
    // create profile
639
302
    _operator_profile =
640
302
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
641
302
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
642
302
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
643
644
    // indentation is true
645
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
646
    // So we should set the indentation to true.
647
302
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
648
302
    _operator_profile->add_child(_common_profile, true);
649
302
    _operator_profile->add_child(_custom_profile, true);
650
651
302
    _operator_profile->set_metadata(_parent->node_id());
652
302
    _wait_for_finish_dependency_timer =
653
302
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
654
302
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
655
302
    if constexpr (!is_fake_shared) {
656
302
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
657
302
            info.shared_state_map.end()) {
658
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
659
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
660
            }
661
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
662
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
663
0
                                                  ? 0
664
0
                                                  : info.task_idx]
665
0
                                  .get();
666
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
667
302
        } else {
668
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
669
                DCHECK(false);
670
            }
671
302
            _shared_state = info.shared_state->template cast<SharedState>();
672
302
            _dependency = _shared_state->create_sink_dependency(
673
302
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
674
302
        }
675
302
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
676
302
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
677
302
    }
678
679
302
    if (must_set_shared_state() && _shared_state == nullptr) {
680
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
681
0
    }
682
683
302
    _rows_input_counter =
684
302
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
685
302
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
686
302
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
687
302
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
688
302
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
689
302
    _memory_used_counter =
690
302
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
691
302
    _common_profile->add_info_string("IsColocate",
692
302
                                     std::to_string(_parent->is_colocated_operator()));
693
302
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
694
302
    _common_profile->add_info_string("FollowedByShuffledOperator",
695
302
                                     std::to_string(_parent->followed_by_shuffled_operator()));
696
302
    return Status::OK();
697
302
}
698
699
template <typename SharedState>
700
1.91M
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
701
1.91M
    if (_closed) {
702
2
        return Status::OK();
703
2
    }
704
1.91M
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
705
1.29M
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
706
1.29M
    }
707
1.91M
    _closed = true;
708
1.91M
    return Status::OK();
709
1.91M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
700
154k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
701
154k
    if (_closed) {
702
0
        return Status::OK();
703
0
    }
704
154k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
705
154k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
706
154k
    }
707
154k
    _closed = true;
708
154k
    return Status::OK();
709
154k
}
_ZN5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
700
1
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
701
1
    if (_closed) {
702
0
        return Status::OK();
703
0
    }
704
1
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
705
1
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
706
1
    }
707
1
    _closed = true;
708
1
    return Status::OK();
709
1
}
_ZN5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
700
196k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
701
196k
    if (_closed) {
702
0
        return Status::OK();
703
0
    }
704
196k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
705
196k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
706
196k
    }
707
196k
    _closed = true;
708
196k
    return Status::OK();
709
196k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
700
25
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
701
25
    if (_closed) {
702
2
        return Status::OK();
703
2
    }
704
23
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
705
23
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
706
23
    }
707
23
    _closed = true;
708
23
    return Status::OK();
709
25
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
700
10.3k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
701
10.3k
    if (_closed) {
702
0
        return Status::OK();
703
0
    }
704
10.3k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
705
10.3k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
706
10.3k
    }
707
10.3k
    _closed = true;
708
10.3k
    return Status::OK();
709
10.3k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
700
7.58k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
701
7.58k
    if (_closed) {
702
0
        return Status::OK();
703
0
    }
704
7.58k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
705
7.58k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
706
7.58k
    }
707
7.58k
    _closed = true;
708
7.58k
    return Status::OK();
709
7.58k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
700
110k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
701
110k
    if (_closed) {
702
0
        return Status::OK();
703
0
    }
704
110k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
705
110k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
706
110k
    }
707
110k
    _closed = true;
708
110k
    return Status::OK();
709
110k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
700
1.52k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
701
1.52k
    if (_closed) {
702
0
        return Status::OK();
703
0
    }
704
1.52k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
705
1.52k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
706
1.52k
    }
707
1.52k
    _closed = true;
708
1.52k
    return Status::OK();
709
1.52k
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
700
619k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
701
619k
    if (_closed) {
702
0
        return Status::OK();
703
0
    }
704
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
705
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
706
    }
707
619k
    _closed = true;
708
619k
    return Status::OK();
709
619k
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
700
9.63k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
701
9.63k
    if (_closed) {
702
0
        return Status::OK();
703
0
    }
704
9.63k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
705
9.63k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
706
9.63k
    }
707
9.63k
    _closed = true;
708
9.63k
    return Status::OK();
709
9.63k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
700
253
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
701
253
    if (_closed) {
702
0
        return Status::OK();
703
0
    }
704
253
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
705
253
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
706
253
    }
707
253
    _closed = true;
708
253
    return Status::OK();
709
253
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
700
3.82k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
701
3.82k
    if (_closed) {
702
0
        return Status::OK();
703
0
    }
704
3.82k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
705
3.82k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
706
3.82k
    }
707
3.82k
    _closed = true;
708
3.82k
    return Status::OK();
709
3.82k
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
700
11.9k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
701
11.9k
    if (_closed) {
702
0
        return Status::OK();
703
0
    }
704
11.9k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
705
11.9k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
706
11.9k
    }
707
11.9k
    _closed = true;
708
11.9k
    return Status::OK();
709
11.9k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
700
327k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
701
327k
    if (_closed) {
702
0
        return Status::OK();
703
0
    }
704
327k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
705
327k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
706
327k
    }
707
327k
    _closed = true;
708
327k
    return Status::OK();
709
327k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
700
463k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
701
463k
    if (_closed) {
702
0
        return Status::OK();
703
0
    }
704
463k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
705
463k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
706
463k
    }
707
463k
    _closed = true;
708
463k
    return Status::OK();
709
463k
}
_ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
700
108
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
701
108
    if (_closed) {
702
0
        return Status::OK();
703
0
    }
704
108
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
705
108
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
706
108
    }
707
108
    _closed = true;
708
108
    return Status::OK();
709
108
}
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
700
302
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
701
302
    if (_closed) {
702
0
        return Status::OK();
703
0
    }
704
302
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
705
302
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
706
302
    }
707
302
    _closed = true;
708
302
    return Status::OK();
709
302
}
710
711
template <typename LocalStateType>
712
9.07k
Status StreamingOperatorX<LocalStateType>::get_block(RuntimeState* state, Block* block, bool* eos) {
713
9.07k
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
714
9.07k
    return pull(state, block, eos);
715
9.07k
}
_ZN5doris18StreamingOperatorXINS_23AssertNumRowsLocalStateEE9get_blockEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
712
31
Status StreamingOperatorX<LocalStateType>::get_block(RuntimeState* state, Block* block, bool* eos) {
713
31
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
714
31
    return pull(state, block, eos);
715
31
}
_ZN5doris18StreamingOperatorXINS_16SelectLocalStateEE9get_blockEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
712
9.04k
Status StreamingOperatorX<LocalStateType>::get_block(RuntimeState* state, Block* block, bool* eos) {
713
9.04k
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
714
9.04k
    return pull(state, block, eos);
715
9.04k
}
716
717
template <typename LocalStateType>
718
28.3M
Status StatefulOperatorX<LocalStateType>::get_block(RuntimeState* state, Block* block, bool* eos) {
719
28.3M
    auto& local_state = get_local_state(state);
720
28.3M
    if (need_more_input_data(state)) {
721
800k
        local_state._child_block->clear_column_data(
722
800k
                OperatorX<LocalStateType>::_child->row_desc().num_materialized_slots());
723
800k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
724
800k
                state, local_state._child_block.get(), &local_state._child_eos));
725
800k
        *eos = local_state._child_eos;
726
800k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
727
94.7k
            return Status::OK();
728
94.7k
        }
729
705k
        {
730
705k
            SCOPED_TIMER(local_state.exec_time_counter());
731
705k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
732
705k
        }
733
705k
    }
734
735
28.2M
    if (!need_more_input_data(state)) {
736
28.2M
        SCOPED_TIMER(local_state.exec_time_counter());
737
28.2M
        bool new_eos = false;
738
28.2M
        RETURN_IF_ERROR(pull(state, block, &new_eos));
739
28.2M
        if (new_eos) {
740
646k
            *eos = true;
741
27.5M
        } else if (!need_more_input_data(state)) {
742
27.5M
            *eos = false;
743
27.5M
        }
744
28.2M
    }
745
28.2M
    return Status::OK();
746
28.2M
}
_ZN5doris17StatefulOperatorXINS_23HashJoinProbeLocalStateEE9get_blockEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
718
154k
Status StatefulOperatorX<LocalStateType>::get_block(RuntimeState* state, Block* block, bool* eos) {
719
154k
    auto& local_state = get_local_state(state);
720
154k
    if (need_more_input_data(state)) {
721
115k
        local_state._child_block->clear_column_data(
722
115k
                OperatorX<LocalStateType>::_child->row_desc().num_materialized_slots());
723
115k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
724
115k
                state, local_state._child_block.get(), &local_state._child_eos));
725
115k
        *eos = local_state._child_eos;
726
115k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
727
25.8k
            return Status::OK();
728
25.8k
        }
729
89.3k
        {
730
89.3k
            SCOPED_TIMER(local_state.exec_time_counter());
731
89.3k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
732
89.3k
        }
733
89.3k
    }
734
735
128k
    if (!need_more_input_data(state)) {
736
128k
        SCOPED_TIMER(local_state.exec_time_counter());
737
128k
        bool new_eos = false;
738
128k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
739
128k
        if (new_eos) {
740
82.2k
            *eos = true;
741
82.2k
        } else if (!need_more_input_data(state)) {
742
8.94k
            *eos = false;
743
8.94k
        }
744
128k
    }
745
128k
    return Status::OK();
746
128k
}
Unexecuted instantiation: _ZN5doris17StatefulOperatorXINS_34PartitionedHashJoinProbeLocalStateEE9get_blockEPNS_12RuntimeStateEPNS_5BlockEPb
_ZN5doris17StatefulOperatorXINS_16RepeatLocalStateEE9get_blockEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
718
2.96k
Status StatefulOperatorX<LocalStateType>::get_block(RuntimeState* state, Block* block, bool* eos) {
719
2.96k
    auto& local_state = get_local_state(state);
720
2.96k
    if (need_more_input_data(state)) {
721
1.62k
        local_state._child_block->clear_column_data(
722
1.62k
                OperatorX<LocalStateType>::_child->row_desc().num_materialized_slots());
723
1.62k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
724
1.62k
                state, local_state._child_block.get(), &local_state._child_eos));
725
1.62k
        *eos = local_state._child_eos;
726
1.62k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
727
206
            return Status::OK();
728
206
        }
729
1.42k
        {
730
1.42k
            SCOPED_TIMER(local_state.exec_time_counter());
731
1.42k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
732
1.42k
        }
733
1.42k
    }
734
735
2.75k
    if (!need_more_input_data(state)) {
736
2.75k
        SCOPED_TIMER(local_state.exec_time_counter());
737
2.75k
        bool new_eos = false;
738
2.75k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
739
2.75k
        if (new_eos) {
740
1.12k
            *eos = true;
741
1.63k
        } else if (!need_more_input_data(state)) {
742
1.33k
            *eos = false;
743
1.33k
        }
744
2.75k
    }
745
2.75k
    return Status::OK();
746
2.75k
}
_ZN5doris17StatefulOperatorXINS_25MaterializationLocalStateEE9get_blockEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
718
1.61k
Status StatefulOperatorX<LocalStateType>::get_block(RuntimeState* state, Block* block, bool* eos) {
719
1.61k
    auto& local_state = get_local_state(state);
720
1.61k
    if (need_more_input_data(state)) {
721
1.61k
        local_state._child_block->clear_column_data(
722
1.61k
                OperatorX<LocalStateType>::_child->row_desc().num_materialized_slots());
723
1.61k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
724
1.61k
                state, local_state._child_block.get(), &local_state._child_eos));
725
1.61k
        *eos = local_state._child_eos;
726
1.61k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
727
655
            return Status::OK();
728
655
        }
729
955
        {
730
955
            SCOPED_TIMER(local_state.exec_time_counter());
731
955
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
732
955
        }
733
955
    }
734
735
955
    if (!need_more_input_data(state)) {
736
955
        SCOPED_TIMER(local_state.exec_time_counter());
737
955
        bool new_eos = false;
738
955
        RETURN_IF_ERROR(pull(state, block, &new_eos));
739
955
        if (new_eos) {
740
680
            *eos = true;
741
680
        } else if (!need_more_input_data(state)) {
742
0
            *eos = false;
743
0
        }
744
955
    }
745
955
    return Status::OK();
746
955
}
_ZN5doris17StatefulOperatorXINS_22StreamingAggLocalStateEE9get_blockEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
718
18.0k
Status StatefulOperatorX<LocalStateType>::get_block(RuntimeState* state, Block* block, bool* eos) {
719
18.0k
    auto& local_state = get_local_state(state);
720
18.0k
    if (need_more_input_data(state)) {
721
17.9k
        local_state._child_block->clear_column_data(
722
17.9k
                OperatorX<LocalStateType>::_child->row_desc().num_materialized_slots());
723
17.9k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
724
17.9k
                state, local_state._child_block.get(), &local_state._child_eos));
725
17.9k
        *eos = local_state._child_eos;
726
17.9k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
727
4.74k
            return Status::OK();
728
4.74k
        }
729
13.2k
        {
730
13.2k
            SCOPED_TIMER(local_state.exec_time_counter());
731
13.2k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
732
13.2k
        }
733
13.2k
    }
734
735
13.3k
    if (!need_more_input_data(state)) {
736
6.72k
        SCOPED_TIMER(local_state.exec_time_counter());
737
6.72k
        bool new_eos = false;
738
6.72k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
739
6.72k
        if (new_eos) {
740
6.56k
            *eos = true;
741
6.56k
        } else if (!need_more_input_data(state)) {
742
62
            *eos = false;
743
62
        }
744
6.72k
    }
745
13.3k
    return Status::OK();
746
13.3k
}
_ZN5doris17StatefulOperatorXINS_30DistinctStreamingAggLocalStateEE9get_blockEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
718
635k
Status StatefulOperatorX<LocalStateType>::get_block(RuntimeState* state, Block* block, bool* eos) {
719
635k
    auto& local_state = get_local_state(state);
720
636k
    if (need_more_input_data(state)) {
721
636k
        local_state._child_block->clear_column_data(
722
636k
                OperatorX<LocalStateType>::_child->row_desc().num_materialized_slots());
723
636k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
724
636k
                state, local_state._child_block.get(), &local_state._child_eos));
725
636k
        *eos = local_state._child_eos;
726
636k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
727
60.4k
            return Status::OK();
728
60.4k
        }
729
575k
        {
730
575k
            SCOPED_TIMER(local_state.exec_time_counter());
731
575k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
732
575k
        }
733
575k
    }
734
735
574k
    if (!need_more_input_data(state)) {
736
542k
        SCOPED_TIMER(local_state.exec_time_counter());
737
542k
        bool new_eos = false;
738
542k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
739
542k
        if (new_eos) {
740
540k
            *eos = true;
741
540k
        } else if (!need_more_input_data(state)) {
742
0
            *eos = false;
743
0
        }
744
542k
    }
745
574k
    return Status::OK();
746
574k
}
_ZN5doris17StatefulOperatorXINS_29NestedLoopJoinProbeLocalStateEE9get_blockEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
718
27.5M
Status StatefulOperatorX<LocalStateType>::get_block(RuntimeState* state, Block* block, bool* eos) {
719
27.5M
    auto& local_state = get_local_state(state);
720
27.5M
    if (need_more_input_data(state)) {
721
20.5k
        local_state._child_block->clear_column_data(
722
20.5k
                OperatorX<LocalStateType>::_child->row_desc().num_materialized_slots());
723
20.5k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
724
20.5k
                state, local_state._child_block.get(), &local_state._child_eos));
725
20.5k
        *eos = local_state._child_eos;
726
20.5k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
727
2.34k
            return Status::OK();
728
2.34k
        }
729
18.2k
        {
730
18.2k
            SCOPED_TIMER(local_state.exec_time_counter());
731
18.2k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
732
18.2k
        }
733
18.2k
    }
734
735
27.5M
    if (!need_more_input_data(state)) {
736
27.5M
        SCOPED_TIMER(local_state.exec_time_counter());
737
27.5M
        bool new_eos = false;
738
27.5M
        RETURN_IF_ERROR(pull(state, block, &new_eos));
739
27.5M
        if (new_eos) {
740
10.3k
            *eos = true;
741
27.5M
        } else if (!need_more_input_data(state)) {
742
27.5M
            *eos = false;
743
27.5M
        }
744
27.5M
    }
745
27.5M
    return Status::OK();
746
27.5M
}
_ZN5doris17StatefulOperatorXINS_23TableFunctionLocalStateEE9get_blockEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
718
7.46k
Status StatefulOperatorX<LocalStateType>::get_block(RuntimeState* state, Block* block, bool* eos) {
719
7.46k
    auto& local_state = get_local_state(state);
720
7.46k
    if (need_more_input_data(state)) {
721
7.09k
        local_state._child_block->clear_column_data(
722
7.09k
                OperatorX<LocalStateType>::_child->row_desc().num_materialized_slots());
723
7.09k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
724
7.09k
                state, local_state._child_block.get(), &local_state._child_eos));
725
7.09k
        *eos = local_state._child_eos;
726
7.09k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
727
404
            return Status::OK();
728
404
        }
729
6.68k
        {
730
6.68k
            SCOPED_TIMER(local_state.exec_time_counter());
731
6.68k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
732
6.68k
        }
733
6.68k
    }
734
735
7.05k
    if (!need_more_input_data(state)) {
736
7.05k
        SCOPED_TIMER(local_state.exec_time_counter());
737
7.05k
        bool new_eos = false;
738
7.05k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
739
7.05k
        if (new_eos) {
740
5.11k
            *eos = true;
741
5.11k
        } else if (!need_more_input_data(state)) {
742
374
            *eos = false;
743
374
        }
744
7.05k
    }
745
7.05k
    return Status::OK();
746
7.05k
}
747
748
template <typename Writer, typename Parent>
749
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
750
52.7k
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
751
52.7k
    RETURN_IF_ERROR(Base::init(state, info));
752
52.7k
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
753
52.7k
                                                         "AsyncWriterDependency", true);
754
52.7k
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
755
52.7k
                             _finish_dependency));
756
757
52.7k
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
758
52.7k
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
759
52.7k
    return Status::OK();
760
52.7k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
750
352
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
751
352
    RETURN_IF_ERROR(Base::init(state, info));
752
352
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
753
352
                                                         "AsyncWriterDependency", true);
754
352
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
755
352
                             _finish_dependency));
756
757
352
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
758
352
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
759
352
    return Status::OK();
760
352
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
750
52.0k
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
751
52.0k
    RETURN_IF_ERROR(Base::init(state, info));
752
52.0k
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
753
52.0k
                                                         "AsyncWriterDependency", true);
754
52.0k
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
755
52.0k
                             _finish_dependency));
756
757
52.0k
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
758
52.0k
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
759
52.0k
    return Status::OK();
760
52.0k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
750
338
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
751
338
    RETURN_IF_ERROR(Base::init(state, info));
752
338
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
753
338
                                                         "AsyncWriterDependency", true);
754
338
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
755
338
                             _finish_dependency));
756
757
338
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
758
338
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
759
338
    return Status::OK();
760
338
}
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
761
762
template <typename Writer, typename Parent>
763
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
764
53.1k
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
765
53.1k
    RETURN_IF_ERROR(Base::open(state));
766
53.1k
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
767
402k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
768
348k
        RETURN_IF_ERROR(
769
348k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
770
348k
    }
771
53.1k
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
772
53.1k
    return Status::OK();
773
53.1k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
764
353
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
765
353
    RETURN_IF_ERROR(Base::open(state));
766
353
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
767
1.83k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
768
1.48k
        RETURN_IF_ERROR(
769
1.48k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
770
1.48k
    }
771
353
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
772
353
    return Status::OK();
773
353
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4openEPNS_12RuntimeStateE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
764
52.4k
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
765
52.4k
    RETURN_IF_ERROR(Base::open(state));
766
52.4k
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
767
394k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
768
341k
        RETURN_IF_ERROR(
769
341k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
770
341k
    }
771
52.4k
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
772
52.4k
    return Status::OK();
773
52.4k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
764
338
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
765
338
    RETURN_IF_ERROR(Base::open(state));
766
338
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
767
6.08k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
768
5.74k
        RETURN_IF_ERROR(
769
5.74k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
770
5.74k
    }
771
338
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
772
338
    return Status::OK();
773
338
}
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
774
775
template <typename Writer, typename Parent>
776
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
777
64.4k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
778
64.4k
    return _writer->sink(block, eos);
779
64.4k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
777
1.31k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
778
1.31k
    return _writer->sink(block, eos);
779
1.31k
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
777
62.7k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
778
62.7k
    return _writer->sink(block, eos);
779
62.7k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
777
338
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
778
338
    return _writer->sink(block, eos);
779
338
}
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
780
781
template <typename Writer, typename Parent>
782
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
783
53.1k
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
784
53.1k
    if (_closed) {
785
0
        return Status::OK();
786
0
    }
787
53.1k
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
788
53.1k
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
789
    // if the init failed, the _writer may be nullptr. so here need check
790
53.2k
    if (_writer) {
791
53.2k
        Status st = _writer->get_writer_status();
792
53.2k
        if (exec_status.ok()) {
793
53.1k
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
794
53.1k
                                                       : Status::Cancelled("force close"));
795
53.1k
        } else {
796
55
            _writer->force_close(exec_status);
797
55
        }
798
        // If there is an error in process_block thread, then we should get the writer
799
        // status before call force_close. For example, the thread may failed in commit
800
        // transaction.
801
53.2k
        RETURN_IF_ERROR(st);
802
53.2k
    }
803
53.1k
    return Base::close(state, exec_status);
804
53.1k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
783
342
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
784
342
    if (_closed) {
785
0
        return Status::OK();
786
0
    }
787
342
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
788
342
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
789
    // if the init failed, the _writer may be nullptr. so here need check
790
342
    if (_writer) {
791
342
        Status st = _writer->get_writer_status();
792
342
        if (exec_status.ok()) {
793
342
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
794
342
                                                       : Status::Cancelled("force close"));
795
342
        } else {
796
0
            _writer->force_close(exec_status);
797
0
        }
798
        // If there is an error in process_block thread, then we should get the writer
799
        // status before call force_close. For example, the thread may failed in commit
800
        // transaction.
801
342
        RETURN_IF_ERROR(st);
802
342
    }
803
342
    return Base::close(state, exec_status);
804
342
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
783
52.5k
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
784
52.5k
    if (_closed) {
785
0
        return Status::OK();
786
0
    }
787
52.5k
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
788
52.5k
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
789
    // if the init failed, the _writer may be nullptr. so here need check
790
52.5k
    if (_writer) {
791
52.5k
        Status st = _writer->get_writer_status();
792
52.5k
        if (exec_status.ok()) {
793
52.4k
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
794
52.4k
                                                       : Status::Cancelled("force close"));
795
52.4k
        } else {
796
55
            _writer->force_close(exec_status);
797
55
        }
798
        // If there is an error in process_block thread, then we should get the writer
799
        // status before call force_close. For example, the thread may failed in commit
800
        // transaction.
801
52.5k
        RETURN_IF_ERROR(st);
802
52.5k
    }
803
52.4k
    return Base::close(state, exec_status);
804
52.5k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
783
338
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
784
338
    if (_closed) {
785
0
        return Status::OK();
786
0
    }
787
338
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
788
338
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
789
    // if the init failed, the _writer may be nullptr. so here need check
790
338
    if (_writer) {
791
338
        Status st = _writer->get_writer_status();
792
338
        if (exec_status.ok()) {
793
338
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
794
338
                                                       : Status::Cancelled("force close"));
795
338
        } else {
796
0
            _writer->force_close(exec_status);
797
0
        }
798
        // If there is an error in process_block thread, then we should get the writer
799
        // status before call force_close. For example, the thread may failed in commit
800
        // transaction.
801
338
        RETURN_IF_ERROR(st);
802
338
    }
803
338
    return Base::close(state, exec_status);
804
338
}
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
805
806
#define DECLARE_OPERATOR(LOCAL_STATE) template class DataSinkOperatorX<LOCAL_STATE>;
807
DECLARE_OPERATOR(HashJoinBuildSinkLocalState)
808
DECLARE_OPERATOR(ResultSinkLocalState)
809
DECLARE_OPERATOR(JdbcTableSinkLocalState)
810
DECLARE_OPERATOR(MemoryScratchSinkLocalState)
811
DECLARE_OPERATOR(ResultFileSinkLocalState)
812
DECLARE_OPERATOR(OlapTableSinkLocalState)
813
DECLARE_OPERATOR(OlapTableSinkV2LocalState)
814
DECLARE_OPERATOR(HiveTableSinkLocalState)
815
DECLARE_OPERATOR(TVFTableSinkLocalState)
816
DECLARE_OPERATOR(IcebergTableSinkLocalState)
817
DECLARE_OPERATOR(SpillIcebergTableSinkLocalState)
818
DECLARE_OPERATOR(IcebergDeleteSinkLocalState)
819
DECLARE_OPERATOR(IcebergMergeSinkLocalState)
820
DECLARE_OPERATOR(MCTableSinkLocalState)
821
DECLARE_OPERATOR(AnalyticSinkLocalState)
822
DECLARE_OPERATOR(BlackholeSinkLocalState)
823
DECLARE_OPERATOR(SortSinkLocalState)
824
DECLARE_OPERATOR(SpillSortSinkLocalState)
825
DECLARE_OPERATOR(LocalExchangeSinkLocalState)
826
DECLARE_OPERATOR(AggSinkLocalState)
827
DECLARE_OPERATOR(PartitionedAggSinkLocalState)
828
DECLARE_OPERATOR(ExchangeSinkLocalState)
829
DECLARE_OPERATOR(NestedLoopJoinBuildSinkLocalState)
830
DECLARE_OPERATOR(UnionSinkLocalState)
831
DECLARE_OPERATOR(MultiCastDataStreamSinkLocalState)
832
DECLARE_OPERATOR(PartitionSortSinkLocalState)
833
DECLARE_OPERATOR(SetProbeSinkLocalState<true>)
834
DECLARE_OPERATOR(SetProbeSinkLocalState<false>)
835
DECLARE_OPERATOR(SetSinkLocalState<true>)
836
DECLARE_OPERATOR(SetSinkLocalState<false>)
837
DECLARE_OPERATOR(PartitionedHashJoinSinkLocalState)
838
DECLARE_OPERATOR(GroupCommitBlockSinkLocalState)
839
DECLARE_OPERATOR(CacheSinkLocalState)
840
DECLARE_OPERATOR(DictSinkLocalState)
841
DECLARE_OPERATOR(RecCTESinkLocalState)
842
DECLARE_OPERATOR(RecCTEAnchorSinkLocalState)
843
844
#undef DECLARE_OPERATOR
845
846
#define DECLARE_OPERATOR(LOCAL_STATE) template class OperatorX<LOCAL_STATE>;
847
DECLARE_OPERATOR(HashJoinProbeLocalState)
848
DECLARE_OPERATOR(OlapScanLocalState)
849
DECLARE_OPERATOR(GroupCommitLocalState)
850
DECLARE_OPERATOR(JDBCScanLocalState)
851
DECLARE_OPERATOR(FileScanLocalState)
852
DECLARE_OPERATOR(EsScanLocalState)
853
DECLARE_OPERATOR(AnalyticLocalState)
854
DECLARE_OPERATOR(SortLocalState)
855
DECLARE_OPERATOR(SpillSortLocalState)
856
DECLARE_OPERATOR(LocalMergeSortLocalState)
857
DECLARE_OPERATOR(AggLocalState)
858
DECLARE_OPERATOR(PartitionedAggLocalState)
859
DECLARE_OPERATOR(TableFunctionLocalState)
860
DECLARE_OPERATOR(ExchangeLocalState)
861
DECLARE_OPERATOR(RepeatLocalState)
862
DECLARE_OPERATOR(NestedLoopJoinProbeLocalState)
863
DECLARE_OPERATOR(AssertNumRowsLocalState)
864
DECLARE_OPERATOR(EmptySetLocalState)
865
DECLARE_OPERATOR(UnionSourceLocalState)
866
DECLARE_OPERATOR(MultiCastDataStreamSourceLocalState)
867
DECLARE_OPERATOR(PartitionSortSourceLocalState)
868
DECLARE_OPERATOR(SetSourceLocalState<true>)
869
DECLARE_OPERATOR(SetSourceLocalState<false>)
870
DECLARE_OPERATOR(DataGenLocalState)
871
DECLARE_OPERATOR(SchemaScanLocalState)
872
DECLARE_OPERATOR(MetaScanLocalState)
873
DECLARE_OPERATOR(LocalExchangeSourceLocalState)
874
DECLARE_OPERATOR(PartitionedHashJoinProbeLocalState)
875
DECLARE_OPERATOR(CacheSourceLocalState)
876
DECLARE_OPERATOR(RecCTESourceLocalState)
877
DECLARE_OPERATOR(RecCTEScanLocalState)
878
879
#ifdef BE_TEST
880
DECLARE_OPERATOR(MockLocalState)
881
DECLARE_OPERATOR(MockScanLocalState)
882
#endif
883
#undef DECLARE_OPERATOR
884
885
template class StreamingOperatorX<AssertNumRowsLocalState>;
886
template class StreamingOperatorX<SelectLocalState>;
887
888
template class StatefulOperatorX<HashJoinProbeLocalState>;
889
template class StatefulOperatorX<PartitionedHashJoinProbeLocalState>;
890
template class StatefulOperatorX<RepeatLocalState>;
891
template class StatefulOperatorX<MaterializationLocalState>;
892
template class StatefulOperatorX<StreamingAggLocalState>;
893
template class StatefulOperatorX<DistinctStreamingAggLocalState>;
894
template class StatefulOperatorX<NestedLoopJoinProbeLocalState>;
895
template class StatefulOperatorX<TableFunctionLocalState>;
896
897
template class PipelineXSinkLocalState<HashJoinSharedState>;
898
template class PipelineXSinkLocalState<PartitionedHashJoinSharedState>;
899
template class PipelineXSinkLocalState<SortSharedState>;
900
template class PipelineXSinkLocalState<SpillSortSharedState>;
901
template class PipelineXSinkLocalState<NestedLoopJoinSharedState>;
902
template class PipelineXSinkLocalState<AnalyticSharedState>;
903
template class PipelineXSinkLocalState<AggSharedState>;
904
template class PipelineXSinkLocalState<PartitionedAggSharedState>;
905
template class PipelineXSinkLocalState<FakeSharedState>;
906
template class PipelineXSinkLocalState<UnionSharedState>;
907
template class PipelineXSinkLocalState<PartitionSortNodeSharedState>;
908
template class PipelineXSinkLocalState<MultiCastSharedState>;
909
template class PipelineXSinkLocalState<SetSharedState>;
910
template class PipelineXSinkLocalState<LocalExchangeSharedState>;
911
template class PipelineXSinkLocalState<BasicSharedState>;
912
template class PipelineXSinkLocalState<DataQueueSharedState>;
913
template class PipelineXSinkLocalState<RecCTESharedState>;
914
915
template class PipelineXLocalState<HashJoinSharedState>;
916
template class PipelineXLocalState<PartitionedHashJoinSharedState>;
917
template class PipelineXLocalState<SortSharedState>;
918
template class PipelineXLocalState<SpillSortSharedState>;
919
template class PipelineXLocalState<NestedLoopJoinSharedState>;
920
template class PipelineXLocalState<AnalyticSharedState>;
921
template class PipelineXLocalState<AggSharedState>;
922
template class PipelineXLocalState<PartitionedAggSharedState>;
923
template class PipelineXLocalState<FakeSharedState>;
924
template class PipelineXLocalState<UnionSharedState>;
925
template class PipelineXLocalState<DataQueueSharedState>;
926
template class PipelineXLocalState<MultiCastSharedState>;
927
template class PipelineXLocalState<PartitionSortNodeSharedState>;
928
template class PipelineXLocalState<SetSharedState>;
929
template class PipelineXLocalState<LocalExchangeSharedState>;
930
template class PipelineXLocalState<BasicSharedState>;
931
template class PipelineXLocalState<RecCTESharedState>;
932
933
template class AsyncWriterSink<doris::VFileResultWriter, ResultFileSinkOperatorX>;
934
template class AsyncWriterSink<doris::VJdbcTableWriter, JdbcTableSinkOperatorX>;
935
template class AsyncWriterSink<doris::VTabletWriter, OlapTableSinkOperatorX>;
936
template class AsyncWriterSink<doris::VTabletWriterV2, OlapTableSinkV2OperatorX>;
937
template class AsyncWriterSink<doris::VHiveTableWriter, HiveTableSinkOperatorX>;
938
template class AsyncWriterSink<doris::VIcebergTableWriter, IcebergTableSinkOperatorX>;
939
template class AsyncWriterSink<doris::VIcebergTableWriter, SpillIcebergTableSinkOperatorX>;
940
template class AsyncWriterSink<doris::VIcebergDeleteSink, IcebergDeleteSinkOperatorX>;
941
template class AsyncWriterSink<doris::VIcebergMergeSink, IcebergMergeSinkOperatorX>;
942
template class AsyncWriterSink<doris::VMCTableWriter, MCTableSinkOperatorX>;
943
template class AsyncWriterSink<doris::VTVFTableWriter, TVFTableSinkOperatorX>;
944
945
#ifdef BE_TEST
946
template class OperatorX<DummyOperatorLocalState>;
947
template class DataSinkOperatorX<DummySinkLocalState>;
948
#endif
949
950
#include "common/compile_check_end.h"
951
} // namespace doris