Coverage Report

Created: 2026-09-06 19:49

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